Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / engine / engineTopoChangerMesh / thoboisSliding / setThoboisSlidingConstraint.H
blobb0c8eeee1e2d956ec65cdff5988339903fe6b006
3     const pointZoneMesh& pZones = pointZones();
5     label constraintSize = 0;
7     forAll(valves_, valveI)
8     {
9     
10         vector valveVel =
11             valves_[valveI].curVelocity()*valves_[valveI].cs().axis();
13         if(valves_[valveI].curLift() > valves_[valveI].deformationLift())
14         {
15             valveVel = vector::zero;
16         }
17     
18     
19         {
20     
21 //          label movingPtsIndex = pZones.findZoneID("movingPointsV"+Foam::name(valveI + 1));
22 //          const labelList& movingPointsV = pZones[movingPtsIndex];
24             labelList movingPointsV;
25           
26             {   
27                 label valveMovingCellsIndex = cellZones().findZoneID("movingCellsZoneV" + Foam::name(valveI + 1));
28           
29                 if (valveMovingCellsIndex < 0)
30                 {      
31                     FatalErrorIn("bool verticalValves::update()")
32                         << "movingCellsZoneV"+ Foam::name(valveI+1)
33                         << abort(FatalError);
34                 }
36                 const labelList& movingCellsZoneV = cellZones()[valveMovingCellsIndex];
37     
38                 const labelListList& cp = cellPoints();
40                 boolList count(newPoints.size(), false);
42                 forAll (movingCellsZoneV, cellI)
43                 {
44                     const labelList& curCellPoints = cp[movingCellsZoneV[cellI]];
46                     forAll (curCellPoints, i)
47                     {
48                         count[curCellPoints[i]] = true;
49                     }
50                 }
52                 // Count the points
53                 label nCounted = 0;
54                 forAll (count, pointI)
55                 {
56                     if (count[pointI] == true)
57                     {
58                         nCounted++;
59                     }
60                 }
62                 movingPointsV.setSize(nCounted);
64                 // Collect the points
65                 nCounted = 0;
66                 forAll (count, pointI)
67                 {
68                     if (count[pointI] == true)
69                     {
70                         movingPointsV[nCounted] = pointI;
71                         nCounted++;
72                     }
73                 }
74               
75             }
76     
77             forAll(movingPointsV, mpI)
78             {
79                 constrainedPoints.append(movingPointsV[mpI]);
80                 constrainedVelocity.append(valveVel);
81            
82                 constraintSize++;
83             }
84     
85         }
87         {
89 //        label staticPtsIndex = pZones.findZoneID("staticPointsV"+Foam::name(valveI + 1));
90 //        const labelList& staticPointsV = pZones[staticPtsIndex];
92             labelList staticPointsV;
93           
94             {   
95                 label valveStaticCellsIndex = cellZones().findZoneID("staticCellsZoneV" + Foam::name(valveI + 1));
96           
97                 if (valveStaticCellsIndex < 0)
98                 {      
99                     FatalErrorIn("bool verticalValves::update()")
100                         << "staticCellsZoneV"+ Foam::name(valveI+1)
101                         << abort(FatalError);
102                 }
104                 const labelList& staticCellsZoneV = cellZones()[valveStaticCellsIndex];
105     
106                 const labelListList& cp = cellPoints();
108                 boolList count(newPoints.size(), false);
110                 forAll (staticCellsZoneV, cellI)
111                 {
112                     const labelList& curCellPoints = cp[staticCellsZoneV[cellI]];
114                     forAll (curCellPoints, i)
115                     {
116                         count[curCellPoints[i]] = true;
117                     }
118                 }
120                 // Count the points
121                 label nCounted = 0;
122                 forAll (count, pointI)
123                 {
124                     if (count[pointI] == true)
125                     {
126                         nCounted++;
127                     }
128                 }
130                 staticPointsV.setSize(nCounted);
132                 // Collect the points
133                 nCounted = 0;
134                 forAll (count, pointI)
135                 {
136                     if (count[pointI] == true)
137                     {
138                         staticPointsV[nCounted] = pointI;
139                         nCounted++;
140                     }
141                 }
142               
143             }
145     
146             forAll(staticPointsV, spI)
147             {
148                 constrainedPoints.append(staticPointsV[spI]);
149                 constrainedVelocity.append(vector::zero);
150                 constraintSize++;
151             }
153         }
155     }