41 void Foam::thresholdCellFaces::calculate
44 const scalar lowerThreshold,
45 const scalar upperThreshold,
46 const bool triangulate
70 surfZones[patchI+1] = surfZone
86 DynamicList<face> surfFaces(0.5 * mesh_.
nFaces());
87 DynamicList<label> surfCells(surfFaces.size());
89 labelList oldToNewPoints(origPoints.size(), -1);
98 if (field[own[faceI]] > lowerThreshold)
100 if (field[nei[faceI]] < lowerThreshold)
105 else if (field[nei[faceI]] > lowerThreshold)
111 if (field[own[faceI]] < upperThreshold)
113 if (field[nei[faceI]] > upperThreshold)
118 else if (field[nei[faceI]] < upperThreshold)
126 const face&
f = origFaces[faceI];
130 if (oldToNewPoints[f[fp]] == -1)
132 oldToNewPoints[f[fp]] = nPoints++;
147 surfFace = f.reverseFace();
154 label count = surfFace.triangles(origPoints, surfFaces);
157 surfCells.append(cellId);
162 surfFaces.append(surfFace);
163 surfCells.append(cellId);
168 surfZones[0].size() = surfFaces.size();
174 const polyPatch&
p = bMesh[patchI];
175 surfZone& zone = surfZones[patchI+1];
177 zone.start() = nFaces;
181 isA<emptyPolyPatch>(p)
188 label faceI = p.start();
195 field[own[faceI]] > lowerThreshold
196 && field[own[faceI]] < upperThreshold
199 const face& f = origFaces[faceI];
202 if (oldToNewPoints[f[fp]] == -1)
204 oldToNewPoints[f[fp]] = nPoints++;
208 label cellId = own[faceI];
212 label count = f.triangles(origPoints, surfFaces);
215 surfCells.append(cellId);
221 surfCells.append(cellId);
228 zone.size() = surfFaces.size() - zone.start();
244 forAll(oldToNewPoints, pointI)
246 if (oldToNewPoints[pointI] >= 0)
248 surfPoints[oldToNewPoints[pointI]] = origPoints[pointI];
252 surfPoints.setSize(nPoints);
268 const scalar lowerThreshold,
269 const scalar upperThreshold,
270 const bool triangulate
276 if (lowerThreshold > upperThreshold)
278 WarningIn(
"thresholdCellFaces::thresholdCellFaces(...)")
279 <<
"lower > upper limit! "
280 << lowerThreshold <<
" > " << upperThreshold <<
endl;
283 calculate(field, lowerThreshold, upperThreshold, triangulate);