Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / engine / engineTopoChangerMesh / pistonSliding / setPistonSlidingConstraint.H
blob5fe4b2b1bdd4ce0f4c585c6ca6f5ac51494ddb6b
3     const faceZoneMesh& fZones = faceZones();
4     const pointZoneMesh& pZones = pointZones();
5     const cellZoneMesh& cZones = cellZones();
7     label constraintSize = 0;
9     forAll(valves_, valveI)
10     {
12         vector valveVel =
13             valves_[valveI].curVelocity()*valves_[valveI].cs().axis();
15         if(valves_[valveI].curLift() > valves_[valveI].deformationLift())
16         {
17             valveVel = vector::zero;
18         }
20         {
21             label movingPtsIndex =
22                 pZones.findZoneID("movingPointsV"+Foam::name(valveI + 1));
24             const labelList& movingPointsV = pZones[movingPtsIndex];
26             forAll(movingPointsV, mpI)
27             {
28                 constrainedPoints.append(movingPointsV[mpI]);
29                 constrainedVelocity.append(valveVel);
31                 constraintSize++;
32             }
33         }
35         {
36             label staticPtsIndex =
37                 pZones.findZoneID("staticPointsV"+Foam::name(valveI + 1));
39             const labelList& staticPointsV = pZones[staticPtsIndex];
41             forAll(staticPointsV, spI)
42             {
43                 constrainedPoints.append(staticPointsV[spI]);
44                 constrainedVelocity.append(vector::zero);
45                 constraintSize++;
46             }
47         }
49         {
52             label movingBottomPtsIndex =
53                 pZones.findZoneID
54                 (
55                     "movingPointsBottomZoneV"
56                    + Foam::name(valveI + 1)
57                 );
59             const labelList& movingBottomPointsV =
60                 pZones[movingBottomPtsIndex];
62             forAll(movingBottomPointsV, mbpI)
63             {
64                 constrainedPoints.append(movingBottomPointsV[mbpI]);
65                 constrainedVelocity.append(valveVel);
66                 constraintSize++;
67             }
69         }
70     }