46 bool Foam::meshStructure::isStructuredCell
53 const cell& cFaces =
mesh.cells()[celli];
59 if (faceToPatchEdgeAddressing_[cFaces[i]] != -1)
65 if (nSide != cFaces.size()-2)
73 if (faceToPatchEdgeAddressing_[cFaces[i]] != -1)
75 const face&
f =
mesh.faces()[cFaces[i]];
78 label nLayerPlus1 = 0;
82 if (pointLayer_[pointi] == layerI)
86 else if (pointLayer_[pointi] == layerI+1)
92 if (
f.size() != 4 || (nLayer+nLayerPlus1 != 4))
103 void Foam::meshStructure::correct
105 const polyMesh&
mesh,
107 const globalIndex& globalFaces,
108 const globalIndex& globalEdges,
109 const globalIndex& globalPoints
113 List<topoDistanceData> cellData(
mesh.
nCells());
114 List<topoDistanceData> faceData(
mesh.
nFaces());
119 Info<< typeName <<
" : seeding "
120 <<
returnReduce(pp.size(), sumOp<label>()) <<
" patch faces"
127 List<topoDistanceData> patchData(pp.size());
130 patchFaces[patchFacei] = pp.addressing()[patchFacei];
131 patchData[patchFacei] = topoDistanceData
133 globalFaces.toGlobal(patchFacei),
140 FaceCellWave<topoDistanceData> distanceCalc
154 cellToPatchFaceAddressing_.setSize(
mesh.
nCells());
156 forAll(cellToPatchFaceAddressing_, celli)
158 cellToPatchFaceAddressing_[celli] = cellData[celli].data();
159 cellLayer_[celli] = cellData[celli].distance();
167 faceToPatchFaceAddressing_.setSize(
mesh.
nFaces());
168 faceToPatchEdgeAddressing_.setSize(
mesh.
nFaces());
169 faceToPatchEdgeAddressing_ =
labelMin;
172 forAll(faceToPatchFaceAddressing_, facei)
175 label patchFacei = faceData[facei].data();
176 label patchDist = faceData[facei].distance();
185 faceToPatchFaceAddressing_[facei] = 0;
186 faceLayer_[facei] = cellData[own].distance();
191 faceToPatchFaceAddressing_[facei] = patchFacei+1;
192 faceToPatchEdgeAddressing_[facei] = -1;
193 faceLayer_[facei] = patchDist;
198 faceToPatchFaceAddressing_[facei] = -(patchFacei+1);
199 faceToPatchEdgeAddressing_[facei] = -1;
200 faceLayer_[facei] = patchDist;
203 else if (patchDist == cellData[own].
distance())
206 faceToPatchFaceAddressing_[facei] = -(patchFacei+1);
207 faceToPatchEdgeAddressing_[facei] = -1;
208 faceLayer_[facei] = patchDist;
229 Info<< typeName <<
" : seeding "
230 <<
returnReduce(pp.nPoints(), sumOp<label>()) <<
" patch points"
235 List<pointTopoDistanceData> edgeData(
mesh.
nEdges());
236 List<pointTopoDistanceData> pointData(
mesh.
nPoints());
240 List<pointTopoDistanceData> patchData(pp.nPoints());
241 forAll(pp.meshPoints(), patchPointi)
243 patchPoints[patchPointi] = pp.meshPoints()[patchPointi];
244 patchData[patchPointi] = pointTopoDistanceData
246 globalPoints.toGlobal(patchPointi),
253 PointEdgeWave<pointTopoDistanceData> distanceCalc
266 pointToPatchPointAddressing_[pointi] = pointData[pointi].data();
267 pointLayer_[pointi] = pointData[pointi].distance();
272 EdgeMap<label> pointsToEdge(pp.nEdges());
275 const edge&
e = pp.edges()[edgeI];
278 globalPoints.toGlobal(
e[0]),
279 globalPoints.toGlobal(
e[1])
281 pointsToEdge.insert(globalEdge, globalEdges.toGlobal(edgeI));
285 forAll(faceToPatchEdgeAddressing_, facei)
287 if (faceToPatchEdgeAddressing_[facei] ==
labelMin)
294 label levelI = pointLayer_[
f[0]];
295 for (
label fp = 1; fp <
f.size(); fp++)
297 if (pointLayer_[
f[fp]] != levelI)
314 label patchFacei = faceData[facei].data();
315 label patchDist = faceData[facei].distance();
317 faceToPatchEdgeAddressing_[facei] = -1;
318 faceToPatchFaceAddressing_[facei] = patchFacei+1;
319 faceLayer_[facei] = patchDist;
329 label nextPointi =
f.nextLabel(fp);
331 const auto fnd = pointsToEdge.cfind
335 pointData[pointi].data(),
336 pointData[nextPointi].data()
342 faceToPatchEdgeAddressing_[facei] = fnd.val();
343 faceToPatchFaceAddressing_[facei] = 0;
345 faceLayer_[facei] = cellData[own].distance();
365 forAll(layerToCells, layerI)
367 const labelList& lCells = layerToCells[layerI];
371 label celli = lCells[lCelli];
373 structured_ = isStructuredCell
392 reduce(structured_, andOp<bool>());