38template<
class FaceList,
class Po
intField>
40Foam::PrimitivePatch<FaceList, PointField>::visitPointRegion
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
76 <<
" and is not edge " << startEdgei <<
abort(FatalError);
80 for (
const label edgeFacei : edgeFaces()[nextEdgei])
82 if (edgeFacei != startFacei)
100template<
class FaceList,
class Po
intField>
120 const label nNbrs = edgeFcs[edgei].
size();
122 if (nNbrs < 1 || nNbrs > 2)
157template<
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];
199template<
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])
labelHashSet * pointSetPtr
labelHashSet * badEdgesPtr
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void resize_nocopy(const label len)
Alter addressable list size, allocating new space if required without necessarily recovering old cont...
const labelListList & pointEdges() const
Return point-edge addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
bool checkTopology(const bool report=false, labelHashSet *pointSetPtr=nullptr) const
Check surface formed by patch for manifoldness (see above).
const labelList & meshPoints() const
Return labelList of mesh points in patch.
bool checkPointManifold(const bool report=false, labelHashSet *pointSetPtr=nullptr) const
Checks primitivePatch for faces sharing point but not edge.
const labelListList & pointFaces() const
Return point-face addressing.
surfaceTopo surfaceType(labelHashSet *badEdgesPtr=nullptr) const
Calculate surface type formed by patch, optionally recording the indices of illegal edges.
const labelListList & edgeFaces() const
Return edge-face addressing.
surfaceTopo
Enumeration defining the surface type. Used in check routines.
bool contains(const T &val) const
True if the value is contained in the list.
void size(const label n)
Older name for setAddressableSize.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
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];} pointMap[start]=pointMap[end]=Foam::min(start, end);} } 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};constexpr 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< DynamicList< face > > pFaces[nBCs]
#define forAll(list, i)
Loop across all elements in list.