Forward compatibility: flex
[foam-extend-3.2.git] / src / engine / engineTopoChangerMesh / thoboisSliding / addMeshModifiersThoboisSliding.H
blob3dd33b016a07c24025133e5b1d2c8cf65fe2eb51
1 //    List<polyMeshModifier*> tm(3*nValves() + 2);
2 //    DynamicList<polyMeshModifier*> tm;
4     label nMods = 0;
6     for (label valveI = 0; valveI < nValves(); valveI++)
7     {
8         // Add valve curtain sliding interface
9         if
10         (
11             valves_[valveI].curtainInCylinderPatchID().active()
12          && valves_[valveI].curtainInPortPatchID().active()
13         )
14         {
15             Info << "Adding a sliding interface mesh modifier to the valve " <<
16             valveI + 1 << endl;
18             topoChanger_.setSize(nMods+1);
20             topoChanger_.set
21             (
22                 nMods,
23                 new slidingInterface
24                 (
25                     "valveSlider" + Foam::name(valveI + 1),
26                     nMods,
27                     topoChanger_,
28                     "curtainPortZoneV" + Foam::name(valveI + 1),
29                     "curtainCylZoneV" + Foam::name(valveI + 1),
30                     "cutPointsV" + Foam::name(valveI + 1),
31                     "cutFaceZoneV" + Foam::name(valveI + 1),
32                     valves_[valveI].curtainInPortPatchID().name(),
33                     valves_[valveI].curtainInCylinderPatchID().name(),
34                     slidingInterface::INTEGRAL, // always integral
35                     true,  // attach-detach action
36                     intersection::VISIBLE
37                 )
38             );
39             nMods++;
41             Info<< "valveSlider" + Foam::name(valveI + 1) << nl
42                 << nMods << endl;
43         }
45         // Add valve poppet layer addition
46         if (valves_[valveI].poppetPatchID().active())
47         {
49             Info<< "Adding a layer addition/removal mesh modifier "
50                 << "to the poppet of the valve " << valveI + 1 << endl;
52             topoChanger_.setSize(nMods+1);
54             topoChanger_.set
55             (
56                 nMods,
57                 new layerAdditionRemoval
58                 (
59                     "valvePoppetLayer" + Foam::name(valveI + 1),
60                     nMods,
61                     topoChanger_,
62                     "layeringFacesTopZoneV" + Foam::name(valveI + 1),
63                     valves_[valveI].minTopLayer(),
64                     valves_[valveI].maxTopLayer()
65                 )
66             );
68             nMods++;
69             Info<< "valvePoppetLayer" + Foam::name(valveI + 1) << nl
70                 << nMods << endl;
71         }
73         // Add valve bottom layer addition
74         if (valves_[valveI].bottomPatchID().active())
75         {
76             Info<< "Adding a layer addition/removal mesh modifier "
77                 << "to the bottom of the valve " << valveI + 1 << endl;
79             topoChanger_.setSize(nMods+1);
81             topoChanger_.set
82             (
83                 nMods,
84                 new layerAdditionRemoval
85                 (
86                     "valveBottomLayer" + Foam::name(valveI + 1),
87                     nMods,
88                     topoChanger_,
89                     "layeringFacesBottomZoneV" + Foam::name(valveI + 1),
90                     valves_[valveI].minBottomLayer(),
91                     valves_[valveI].maxBottomLayer()
92                 )
93             );
95             nMods++;
96             Info<< "valveBottomLayer" + Foam::name(valveI + 1) << nl
97                 << nMods << endl;
98         }
99 /*        {
101             Info<< "Adding a layer addition/removal mesh modifier
102                 << "to the piston-valve " << valveI + 1 << endl;
104             topoChanger_.setSize(nMods+1);
106             topoChanger_.hook
107             (
108                 new layerAdditionRemoval
109                 (
110                     "valvePistonLayer" + Foam::name(valveI + 1),
111                     nMods,
112                     topoChanger_,
113                     "pistonLayerFacesV" + Foam::name(valveI + 1),
114                     piston().minLayer(),
115                     piston().maxLayer()
116                 )
117             );
118             nMods++;
119             Info << "valvePistonLayer" + Foam::name(valveI + 1) << endl;
120             Info << nMods << endl;
121         }
123         // Add attach-detach for valve
124         if
125         (
126             valves_[valveI].detachInCylinderPatchID().active()
127          && valves_[valveI].detachInPortPatchID().active()
128         )
129         {
131             Info<< "Adding a attach/detach boundary mesh modifier :
132                 << "to the valve " << valveI + 1 << endl;
134             topoChanger_.setSize(nMods+1);
136             topoChanger_.hook
137             (
138                 new attachDetach
139                 (
140                     "valveAttachDetach" + Foam::name(valveI + 1),
141                     nMods,
142                     topoChanger_,
143                     "detachFaceZoneV" + Foam::name(valveI + 1),
144                     valves_[valveI].detachInCylinderPatchID().name(),
145                     valves_[valveI].detachInPortPatchID().name(),
146                     scalarField(0),
147                     true                // Manual triggering
148                 )
149             );
151             nMods++;
152             Info << "Attach detach" << endl;
153         }
154     }
156     // Add piston layer addition
157     if (piston().patchID().active())
158     {
160         Info<< "Adding a layer addition/removal mesh modifier "
161             << "to the piston" << endl;
163         topoChanger_.setSize(nMods+1);
165         topoChanger_.hook
166         (
167             new layerAdditionRemoval
168             (
169                 "pistonLayer",
170                 nMods,
171                 topoChanger_,
172                 "pistonLayerFaces",
173                 piston().minLayer(),
174                 piston().maxLayer()
175             )
176         );
178         nMods++;
179         Info<< "pistonLayer" << nl
180             << nMods << endl;
181     }
183     }
185     Info << "Adding " << nMods << " topology modifiers" << endl;