46bool Foam::meshStructure::isStructuredCell
59 if (faceToPatchEdgeAddressing_[cFaces[i]] != -1)
65 if (nSide != cFaces.size()-2)
73 if (faceToPatchEdgeAddressing_[cFaces[i]] != -1)
78 label nLayerPlus1 = 0;
82 if (pointLayer_[pointi] == layerI)
86 else if (pointLayer_[pointi] == layerI+1)
92 if (
f.
size() != 4 || (nLayer+nLayerPlus1 != 4))
105 const polyMesh&
mesh,
107 const globalIndex& globalFaces,
108 const globalIndex& globalEdges,
109 const globalIndex& globalPoints
113 List<topoDistanceData<label>> cellData(
mesh.
nCells());
114 List<topoDistanceData<label>> faceData(
mesh.
nFaces());
119 Info<< typeName <<
" : seeding "
120 <<
returnReduce(pp.size(), sumOp<label>()) <<
" patch faces"
127 List<topoDistanceData<label>> patchData(pp.size());
130 patchFaces[patchFacei] = pp.addressing()[patchFacei];
131 patchData[patchFacei] = topoDistanceData<label>
134 globalFaces.toGlobal(patchFacei)
140 FaceCellWave<topoDistanceData<label>> 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<label>> edgeData(
mesh.
nEdges());
236 List<pointTopoDistanceData<label>> pointData(
mesh.
nPoints());
240 List<pointTopoDistanceData<label>> patchData(pp.nPoints());
241 forAll(pp.meshPoints(), patchPointi)
243 patchPoints[patchPointi] = pp.meshPoints()[patchPointi];
244 patchData[patchPointi] = pointTopoDistanceData<label>
247 globalPoints.toGlobal(patchPointi)
253 PointEdgeWave<pointTopoDistanceData<label>> 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)
315 label patchFacei = faceData[facei].
data();
316 label patchDist = faceData[facei].distance();
318 faceToPatchEdgeAddressing_[facei] = -1;
319 faceToPatchFaceAddressing_[facei] = patchFacei+1;
320 faceLayer_[facei] = patchDist;
329 label pointi =
f[fp];
330 label nextPointi =
f.nextLabel(fp);
332 const auto fnd = pointsToEdge.cfind
336 pointData[pointi].data(),
337 pointData[nextPointi].data()
343 faceToPatchEdgeAddressing_[facei] = fnd.val();
344 faceToPatchFaceAddressing_[facei] = 0;
346 faceLayer_[facei] = cellData[own].distance();
362 label nLayers =
gMax(cellLayer_)+1;
366 forAll(layerToCells, layerI)
368 const labelList& lCells = layerToCells[layerI];
372 label celli = lCells[lCelli];
374 structured_ = isStructuredCell
393 reduce(structured_, andOp<bool>());
void setSize(const label n)
Alias for resize()
A list of faces which address into the list of points.
label nEdges() const
Number of edges in patch.
label nPoints() const
Number of points supporting patch faces.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
void size(const label n)
Older name for setAddressableSize.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label nTotalPoints() const noexcept
Return total number of points in decomposed mesh. Not.
label nTotalCells() const noexcept
Return total number of cells in decomposed mesh.
Calculates points shared by more than two processor patches or cyclic patches.
Detect extruded mesh structure given a set of faces (uindirectPrimitivePatch).
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const globalMeshData & globalData() const
Return parallel info.
virtual const labelList & faceNeighbour() const
Return face neighbour.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
label nFaces() const noexcept
Number of mesh faces.
const cellList & cells() const
label nEdges() const
Number of mesh edges.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
scalar distance(const vector &p1, const vector &p2)
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.
List< labelList > labelListList
A List of labelList.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
Type gMax(const FieldField< Field, Type > &f)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.