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 labelList pistonPoints;
18 label pistonCellIndex = cellZones().findZoneID("movingCellsPiston");
20 if (pistonCellIndex < 0)
22 FatalErrorIn("bool verticalValves::update()")
23 << "Cannot find cell zone movingCellsPiston"
27 const labelList& pistonCells = cellZones()[pistonCellIndex];
29 const labelListList& cp = cellPoints();
31 boolList count(newPoints.size(), false);
33 forAll (pistonCells, cellI)
35 const labelList& curCellPoints = cp[pistonCells[cellI]];
37 forAll (curCellPoints, i)
39 count[curCellPoints[i]] = true;
45 forAll (count, pointI)
47 if (count[pointI] == true)
53 pistonPoints.setSize(nCounted);
57 forAll (count, pointI)
59 if (count[pointI] == true)
61 pistonPoints[nCounted] = pointI;
73 scalar pistonTopZ = -GREAT;
74 forAll(pistonPoints, i)
76 point& p = newPoints[pistonPoints[i]];
77 p.z() = p.z() + deltaZ*movingPointsMPiston[pistonPoints[i]];
78 pistonTopZ = max(pistonTopZ, p.z());
81 // NN! fix. only needed for compression
84 // check if piston-points have moved beyond the layer above
89 bool foundLow = false;
90 if (virtualPistonPosition() > newPoints[i].z())
97 (1.0 - movingPointsMPiston[i])*newPoints[i].z()
99 movingPointsMPiston[i] *
104 0.9*minLayerThickness
114 deleteDemandDrivenData(movingPointsMaskPistonPtr_);
116 forAll(valves(), valveI)
119 Info << "moving valve points valve n. " << valveI << endl;
121 boolList scaleDisp(nPoints(), true);
122 label nScaled = nPoints();
124 const scalarField& movingPointsMPistonValves = movingPointsMaskPistonValves(valveI);
126 List<bool> pistonPointValve(newPoints.size(), false);
127 labelList pistonPointsV;
130 label pistonCellVIndex = cellZones().findZoneID("movingCellsPistonV"+ Foam::name(valveI + 1));
132 if (pistonCellVIndex < 0)
134 FatalErrorIn("bool verticalValves::update()")
135 << "movingCellsPistonV"+ Foam::name(valveI + 1)
136 << abort(FatalError);
139 const labelList& pistonCellsV = cellZones()[pistonCellVIndex];
141 const labelListList& cp = cellPoints();
143 boolList count(newPoints.size(), false);
145 forAll (pistonCellsV, cellI)
147 const labelList& curCellPoints = cp[pistonCellsV[cellI]];
149 forAll (curCellPoints, i)
151 count[curCellPoints[i]] = true;
157 forAll (count, pointI)
159 if (count[pointI] == true)
165 pistonPointsV.setSize(nCounted);
167 // Collect the points
169 forAll (count, pointI)
171 if (count[pointI] == true)
173 pistonPointsV[nCounted] = pointI;
181 forAll(pistonPointsV, i)
183 label pointI = pistonPointsV[i];
184 pistonPointValve[pointI] = true;
185 point& p = newPoints[pointI];
187 if (p.z() < pistonPosition() - 1.0e-6)
189 scaleDisp[pointI] = false;
196 // Always move piston
197 scalar pistonTopZ = -GREAT;
198 forAll(pistonPointsV, i)
200 point& p = newPoints[pistonPointsV[i]];
202 p.z() = p.z() + deltaZ*movingPointsMPistonValves[pistonPointsV[i]];
203 pistonTopZ = max(pistonTopZ, p.z());
206 // NN! fix. only needed for compression
209 // check if piston-points have moved beyond the layer above
212 if (!pistonPointValve[i])
214 bool foundLow = false;
215 if (virtualPistonPosition() > newPoints[i].z())
222 (1.0 - movingPointsMPistonValves[i])*newPoints[i].z()
224 movingPointsMPistonValves[i] *
229 0.9*minLayerThickness
239 deleteDemandDrivenData(movingPointsMaskPistonValvesPtr_);