46bool 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))
103void Foam::meshStructure::correct
134 globalFaces.toGlobal(patchFacei)
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;
224 pointToPatchPointAddressing_.setSize(
mesh.
nPoints());
243 patchPoints[patchPointi] =
pp.
meshPoints()[patchPointi];
266 pointToPatchPointAddressing_[pointi] = pointData[pointi].data();
267 pointLayer_[pointi] = pointData[pointi].distance();
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
402 const polyMesh&
mesh,
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Map from edge (expressed as its endpoints) to value. Hashing (and ==) on an edge is symmetric.
Wave propagation of information through grid. Every iteration information goes through one layer of c...
const Addr & addressing() const noexcept
The addressing used for the list.
label size() const noexcept
The number of elements in the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Wave propagation of information through grid. Every iteration information goes through one layer of e...
label nEdges() const
Number of edges in patch.
label nPoints() const
Number of points supporting patch faces.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
void size(const label n)
Older name for setAddressableSize.
static void reduceAnd(bool &value, const int communicator=worldComm)
Logical (and) reduction (MPI_AllReduce).
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
A face is a list of labels corresponding to mesh vertices.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
label nTotalPoints() const noexcept
Total global number of mesh points. Not compensated for duplicate points!
label nTotalCells() const noexcept
Total global number of mesh cells.
Calculates points shared by more than two processor patches or cyclic patches.
Detect extruded mesh structure given a set of faces (uindirectPrimitivePatch).
meshStructure(const polyMesh &mesh, const uindirectPrimitivePatch &)
Construct from mesh and faces in mesh. Any addressing to.
For use with PointEdgeWave. Determines topological distance to starting points. Templated on passive ...
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 (demand-driven).
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.
label nEdges() const
Number of mesh edges.
For use with FaceCellWave. Determines topological distance to starting faces. Templated on passive tr...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Namespace for handling debugging switches.
scalar distance(const vector &p1, const vector &p2)
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
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.
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.