Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / engine / engineTopoChangerMesh / accordionEngineMesh / setAccordionEngineMeshConstraints.H
blob6cddfce3db489dca9eeeb4429a85143a7bf43dfd
3     const pointZoneMesh& pZones = pointZones();
5     label constraintSize = 0;
7     forAll(valves_, valveI)
8     {
9         vector valveVel =
10             valves_[valveI].curVelocity()*valves_[valveI].cs().axis();
12         {
13             label movingPtsIndex =
14                 pZones.findZoneID("movingPointsV"+Foam::name(valveI + 1));
15             const labelList& movingPointsV = pZones[movingPtsIndex];
17             forAll(movingPointsV, mpI)
18             {
19                 constrainedPoints.append(movingPointsV[mpI]);
20                 constrainedVelocity.append(valveVel);
22                 constraintSize++;
23             }
24         }
26         {
28             label movingInternalPtsIndex =
29                 pZones.findZoneID
30                 (
31                     "movingInternalPointsV"
32                   + Foam::name(valveI + 1)
33                 );
35             const labelList& movingInternalPointsV =
36                 pZones[movingInternalPtsIndex];
38             forAll(movingInternalPointsV, mipI)
39             {
40                 constrainedPoints.append(movingInternalPointsV[mipI]);
41                 constrainedVelocity.append(valveVel);
43                 constraintSize++;
44             }
45         }
47         {
49             label staticPtsIndex =
50                 pZones.findZoneID("staticPointsV" + Foam::name(valveI + 1));
51             const labelList& staticPointsV = pZones[staticPtsIndex];
53             forAll(staticPointsV, spI)
54             {
55                 constrainedPoints.append(staticPointsV[spI]);
56                 constrainedVelocity.append(vector::zero);
57                 constraintSize++;
59             }
61         }
63         if (piston().patchID().active())
64         {
65             vector pistonVel =
66                 piston().cs().axis()*engineTime_.pistonSpeed().value();
68             label pistonPtsIndex = pZones.findZoneID("movingPistonPoints");
69             const labelList& movingPointsP = pZones[pistonPtsIndex];
71             forAll(movingPointsP, mpI)
72             {
73                 constrainedPoints.append(movingPointsP[mpI]);
74                 constrainedVelocity.append(pistonVel);
75 //                constrainedVelocity.append(vector::zero);
76                 constraintSize++;
78             }
79         }
80     }
82     Info << "constraintSize = " << constraintSize << endl;