38 template<
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
84 const labelList& eFaces = edgeFaces()[nextEdgeI];
88 if (eFaces[i] != startFacei)
106 template<
class FaceList,
class Po
intField>
118 label nNbrs = edgeFcs[edgeI].
size();
120 if (nNbrs < 1 || nNbrs > 2)
140 template<
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()]);
187 template<
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;
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 checkPointManifold(const bool report=false, labelHashSet *setPtr=nullptr) const
Checks primitivePatch for faces sharing point but not edge.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
bool checkTopology(const bool report=false, labelHashSet *setPtr=nullptr) const
Check surface formed by patch for manifoldness (see above).
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
void unset(List< bool > &bools, const labelUList &locations)
Unset the listed locations (assign 'false').
A list of faces which address into the list of points.
const dimensionedScalar e
Elementary charge.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
surfaceTopo surfaceType() const
Calculate surface type formed by patch.
#define DebugInFunction
Report an information message using Foam::Info.
errorManip< error > abort(error &err)
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]
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
List< bool > boolList
A List of bools.
const dimensionedScalar mp
Proton mass.