38 template<
class FaceList,
class Po
intField>
44 const label startFacei,
45 const label startEdgei,
46 UList<bool>& pFacesVisited
49 const label index =
pFaces.find(startFacei);
51 if (index >= 0 && !pFacesVisited[index])
54 pFacesVisited[index] =
true;
59 for (
const label faceEdgei : faceEdges()[startFacei])
61 const edge&
e = edges()[faceEdgei];
63 if (faceEdgei != startEdgei &&
e.contains(pointi))
65 nextEdgei = faceEdgei;
73 <<
"Problem: cannot find edge out of " 74 << faceEdges()[startFacei]
75 <<
"on face " << startFacei <<
" that uses point " << pointi
80 for (
const label edgeFacei : edgeFaces()[nextEdgei])
82 if (edgeFacei != startFacei)
100 template<
class FaceList,
class Po
intField>
120 const label nNbrs = edgeFcs[edgei].
size();
122 if (nNbrs < 1 || nNbrs > 2)
144 pType = surfaceTopo::OPEN;
150 return surfaceTopo::ILLEGAL;
157 template<
class FaceList,
class Po
intField>
173 const label nNbrs = edgeFcs[edgei].
size();
175 if (nNbrs < 1 || nNbrs > 2)
181 Info<<
"Edge " << edgei <<
" with vertices:" << edges()[edgei]
182 <<
" has " << nNbrs <<
" face neighbours" <<
endl;
187 const edge&
e = edges()[edgei];
199 template<
class FaceList,
class Po
intField>
222 pFacesVisited =
false;
226 const label startEdgei = pEdges[0];
228 const labelList& eFaces = ef[startEdgei];
230 for (
const label edgeFacei : eFaces)
234 this->visitPointRegion
251 const label meshPointi =
mp[pointi];
260 Info<<
"Point " << meshPointi
261 <<
" uses faces which are not connected through an edge" 263 <<
"This means that the surface formed by this patched" 264 <<
" is multiply connected at this point" <<
nl 265 <<
"Connected (patch) faces:" <<
nl;
269 if (pFacesVisited[i])
275 Info<<
nl <<
"Unconnected (patch) faces:" <<
nl;
278 if (!pFacesVisited[i])
void size(const label n)
Older name for setAddressableSize.
surfaceTopo
Enumeration defining the surface type. Used in check routines.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool contains(const T &val) const
True if the value is contained in the list.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
A list of faces which address into the list of points.
const dimensionedScalar e
Elementary charge.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
labelHashSet * pointSetPtr
labelHashSet * badEdgesPtr
errorManip< error > abort(error &err)
bool checkTopology(const bool report=false, labelHashSet *pointSetPtr=nullptr) const
Check surface formed by patch for manifoldness (see above).
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]
surfaceTopo surfaceType(labelHashSet *badEdgesPtr=nullptr) const
Calculate surface type formed by patch, optionally recording the indices of illegal edges...
messageStream Info
Information stream (stdout output on master, null elsewhere)
void resize_nocopy(const label len)
Alter addressable list size, allocating new space if required without necessarily recovering old cont...
const dimensionedScalar mp
Proton mass.
bool checkPointManifold(const bool report=false, labelHashSet *pointSetPtr=nullptr) const
Checks primitivePatch for faces sharing point but not edge.