3 Info << "moving piston points" << endl;
5 boolList scaleDisp(nPoints(), true);
6 label nScaled = nPoints();
8 List<bool> pistonPoint(newPoints.size(), false);
10 label pistonPtsIndex = pointZones().findZoneID("pistonPoints");
11 const labelList& pistonPoints = pointZones()[pistonPtsIndex];
13 const scalarField& movingPointsMPiston = movingPointsMaskPiston();
15 forAll(pistonPoints, i)
17 label pointI = pistonPoints[i];
18 pistonPoint[pointI] = true;
19 point& p = newPoints[pointI];
21 if (p.z() < pistonPosition() - 1.0e-6)
23 scaleDisp[pointI] = false;
31 scalar pistonTopZ = -GREAT;
32 forAll(pistonPoints, i)
34 point& p = newPoints[pistonPoints[i]];
35 p.z() = p.z() + deltaZ*movingPointsMPiston[pistonPoints[i]];
36 pistonTopZ = max(pistonTopZ, p.z());
39 // NN! fix. only needed for compression
42 // check if piston-points have moved beyond the layer above
47 bool foundLow = false;
48 if (virtualPistonPosition() > newPoints[i].z())
55 (1.0 - movingPointsMPiston[i])*newPoints[i].z()
57 movingPointsMPiston[i] *
72 deleteDemandDrivenData(movingPointsMaskPistonPtr_);
74 forAll(valves(), valveI)
77 Info << "moving valve points valve n. " << valveI << endl;
79 boolList scaleDisp(nPoints(), true);
80 label nScaled = nPoints();
82 List<bool> pistonPointValve(newPoints.size(), false);
84 label pistonValvePtsIndex =
85 pointZones().findZoneID("valvePistonPointsV"+Foam::name(valveI + 1));
87 const labelList& pistonPointsV = pointZones()[pistonValvePtsIndex];
89 const scalarField& movingPointsMPistonValves = movingPointsMaskPistonValves(valveI);
91 forAll(pistonPointsV, i)
93 label pointI = pistonPointsV[i];
94 pistonPointValve[pointI] = true;
95 point& p = newPoints[pointI];
97 if (p.z() < pistonPosition() - 1.0e-6)
99 scaleDisp[pointI] = false;
106 // Always move piston
107 scalar pistonTopZ = -GREAT;
108 forAll(pistonPointsV, i)
110 point& p = newPoints[pistonPointsV[i]];
112 p.z() = p.z() + deltaZ*movingPointsMPistonValves[pistonPointsV[i]];
113 pistonTopZ = max(pistonTopZ, p.z());
116 // NN! fix. only needed for compression
119 // check if piston-points have moved beyond the layer above
122 if (!pistonPointValve[i])
124 bool foundLow = false;
125 if (virtualPistonPosition() > newPoints[i].z())
132 (1.0 - movingPointsMPistonValves[i])*newPoints[i].z()
134 movingPointsMPistonValves[i] *
139 0.9*minLayerThickness
149 deleteDemandDrivenData(movingPointsMaskPistonValvesPtr_);