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<label>> cellData(
mesh.
nCells());
114 List<topoDistanceData<label>> faceData(
mesh.
nFaces());
119 Info<< typeName <<
" : seeding " 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 " 235 List<pointTopoDistanceData<label>> edgeData(
mesh.
nEdges());
236 List<pointTopoDistanceData<label>> pointData(
mesh.
nPoints());
240 List<pointTopoDistanceData<label>> patchData(
pp.
nPoints());
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());
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
402 const polyMesh&
mesh,
410 globalIndex(
pp.size()),
label nPoints() const
Number of points supporting patch faces.
void size(const label n)
Older name for setAddressableSize.
label nPoints() const noexcept
Number of mesh points.
meshStructure(const polyMesh &mesh, const uindirectPrimitivePatch &)
Construct from mesh and faces in mesh. Any addressing to.
virtual const labelList & faceNeighbour() const
Return face neighbour.
constexpr char nl
The newline '\n' character (0x0a)
T * data() noexcept
Return pointer to the underlying array serving as data storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar distance(const vector &p1, const vector &p2)
label nFaces() const noexcept
Number of mesh faces.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
List< labelList > labelListList
List of labelList.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
label nTotalPoints() const noexcept
Total global number of mesh points. Not compensated for duplicate points!
#define forAll(list, i)
Loop across all elements in list.
A list of faces which address into the list of points.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
static void reduceAnd(bool &value, const label communicator=worldComm)
Logical (and) reduction (MPI_AllReduce)
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
virtual const labelList & faceOwner() const
Return face owner.
const globalMeshData & globalData() const
Return parallel info (demand-driven)
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
virtual const faceList & faces() const
Return raw faces.
label nEdges() const
Number of mesh edges.
label nEdges() const
Number of edges in patch.
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil) - psi) *pSat, rhoMin);# 1 "/home/chef2/andy/OpenFOAM/release/v2406/OpenFOAM-v2406/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
defineTypeNameAndDebug(combustionModel, 0)
label nTotalCells() const noexcept
Total global number of mesh cells.
Calculates points shared by more than two processor patches or cyclic patches.
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.
label nCells() const noexcept
Number of mesh cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())