38template<
class FaceList,
class Po
intField>
44 const label startFacei,
45 const label startEdgeI,
49 label index =
pFaces.find(startFacei);
51 if (!pFacesHad[index])
54 pFacesHad[index] =
true;
57 const labelList& fEdges = faceEdges()[startFacei];
63 label edgeI = fEdges[i];
65 const edge&
e = edges()[edgeI];
67 if (edgeI != startEdgeI && (
e[0] == pointi ||
e[1] == pointi))
78 <<
"Problem: cannot find edge out of " << fEdges
79 <<
"on face " << startFacei <<
" that uses point " << pointi
80 <<
" and is not edge " << startEdgeI <<
abort(FatalError);
84 const labelList& eFaces = edgeFaces()[nextEdgeI];
88 if (eFaces[i] != startFacei)
106template<
class FaceList,
class Po
intField>
118 label nNbrs = edgeFcs[edgeI].
size();
120 if (nNbrs < 1 || nNbrs > 2)
140template<
class FaceList,
class Po
intField>
154 bool illegalTopo =
false;
158 label nNbrs = edgeFcs[edgeI].
size();
160 if (nNbrs < 1 || nNbrs > 2)
166 Info<<
"Edge " << edgeI <<
" with vertices:" << edges()[edgeI]
167 <<
" has " << nNbrs <<
" face neighbours"
173 const edge&
e = edges()[edgeI];
175 setPtr->
insert(meshPoints()[
e.start()]);
176 setPtr->
insert(meshPoints()[
e.end()]);
187template<
class FaceList,
class Po
intField>
200 bool foundError =
false;
211 label startEdgeI = pEdges[0];
213 const labelList& eFaces = ef[startEdgeI];
219 this->visitPointRegion
232 label unset = pFacesHad.
find(
false);
238 label meshPointi = mp[pointi];
242 setPtr->
insert(meshPointi);
247 Info<<
"Point " << meshPointi
248 <<
" uses faces which are not connected through an edge"
250 <<
"This means that the surface formed by this patched"
251 <<
" is multiply connected at this point" <<
nl
252 <<
"Connected (patch) faces:" <<
nl;
262 Info<<
nl <<
"Unconnected (patch) faces:" <<
nl;
Various functions to operate on Lists.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
A list of faces which address into the list of points.
bool checkPointManifold(const bool report=false, labelHashSet *setPtr=nullptr) const
Checks primitivePatch for faces sharing point but not edge.
surfaceTopo surfaceType() const
Calculate surface type formed by patch.
bool checkTopology(const bool report=false, labelHashSet *setPtr=nullptr) const
Check surface formed by patch for manifoldness (see above).
surfaceTopo
Enumeration defining the surface type. Used in check routines.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
void size(const label n)
Older name for setAddressableSize.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define DebugInFunction
Report an information message using Foam::Info.
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.
errorManip< error > abort(error &err)
constexpr char nl
The newline '\n' character (0x0a)
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::HEX);labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells].reset(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
#define forAll(list, i)
Loop across all elements in list.