Go to the documentation of this file.
75 for (
label elemI = startI; elemI < freeI; elemI++)
77 lst[newI++] = lst[elemI];
80 if ((freeI - startI) < 0)
136 const label startEdgeI,
137 const label startVertI,
138 const label nFeaturePts,
156 vertI =
mesh().edges()[edgeI].start();
168 edgeI = getFirstVertEdge(faceI, vertI);
178 if (nVisited == nFeaturePts)
183 vertI =
mesh().edges()[edgeI].otherVertex(vertI);
201 const label startEdgeI,
202 const label startVertI
208 label superVertI = 0;
211 label edgeI = startEdgeI;
213 label vertI = startVertI;
215 superVerts[superVertI++] = vertI;
217 label prevEdgeI = -1;
221 vertI =
mesh().edges()[edgeI].otherVertex(vertI);
223 superVerts[superVertI++] = vertI;
231 superVerts.
setSize(superVertI);
248 const point& ctr =
mesh().cellCentres()[cellI];
251 scalar maxCos = -GREAT;
255 label edgeI = cEdges[cEdgeI];
268 scalar cosAngle =
mag(refDir &
n);
270 if (cosAngle > maxCos)
290 const label startEdgeI,
291 const label startVertI,
298 label oppositeVertI = -1;
299 label oppositeEdgeI = -1;
333 edgeI = oppositeEdgeI;
337 vertI = superEdge[1];
347 Pout<<
" Don't know what to do. Stepped to non-feature point "
348 <<
"at index " << index <<
" in superEdge:" << superEdge
352 vertI = superEdge[index];
376 const label fromFaceI,
377 const label fromEdgeI,
378 const label fromVertI,
385 label faceI = fromFaceI;
386 label edgeI = fromEdgeI;
387 label vertI = fromVertI;
393 Pout<<
"Entering walk with : cell:" << cellI <<
" face:" << faceI;
396 Pout<<
" verts:" <<
mesh().faces()[faceI];
398 Pout<<
" edge:" << edgeI;
401 Pout<<
" verts:" <<
mesh().edges()[edgeI];
406 label startLoop = -1;
424 label firstFree = loop.size();
426 subsetList(startLoop, firstFree, loop);
427 subsetList(startLoop, firstFree, loopWeights);
447 label firstFree = loop.size();
449 subsetList(startLoop, firstFree, loop);
450 subsetList(startLoop, firstFree, loopWeights);
465 loop.
append(edgeToEVert(edgeI));
473 Pout<<
" stepped across edge " <<
mesh().edges()[edgeI]
474 <<
" to face " << faceI <<
" verts:"
478 label nextEdgeI = -1;
479 label nextVertI = -1;
501 loop.
append(vertToEVert(vertI));
502 loopWeights.
append(-GREAT);
508 labelList nextEdges = getVertEdgesNonFace
515 if (nextEdges.empty())
537 Pout<<
" stepped from non-edge vertex " << vertI
538 <<
" to face " << faceI <<
" verts:"
539 <<
mesh().faces()[faceI]
540 <<
" since candidate edges:" << nextEdges <<
endl;
543 label nextEdgeI = -1;
544 label nextVertI = -1;
561 else if (nextEdges.
size() == 1)
564 edgeI = nextEdges[0];
568 Pout<<
" stepped from non-edge vertex " << vertI
569 <<
" along edge " << edgeI <<
" verts:"
570 <<
mesh().edges()[edgeI]
571 <<
" out of candidate edges:"
572 << nextEdges <<
endl;
575 vertI =
mesh().edges()[edgeI].otherVertex(vertI);
586 edgeI = nextEdges[index];
590 Pout<<
" stepped from non-edge vertex " << vertI
591 <<
" along edge " << edgeI <<
" verts:"
592 <<
mesh().edges()[edgeI]
593 <<
" out of candidate edges:" << nextEdges <<
endl;
596 vertI =
mesh().edges()[edgeI].otherVertex(vertI);
612 if (nextFaces.
size() == 1)
615 faceI = nextFaces[0];
617 label nextEdgeI = -1;
618 label nextVertI = -1;
635 else if (nextFaces.
size() == 2)
648 vertI =
mesh().edges()[edgeI].otherVertex(vertI);
653 <<
"Choosing from more than "
654 <<
"two candidates:" << nextFaces
655 <<
" when coming from vertex " << vertI <<
" on cell "
663 Pout<<
"Walked to : face:" << faceI;
666 Pout<<
" verts:" <<
mesh().faces()[faceI];
668 Pout<<
" edge:" << edgeI;
671 Pout<<
" verts:" <<
mesh().edges()[edgeI];
731 getAlignedNonFeatureEdge
751 edgeI = getMisAlignedEdge(refDir, cellI);
778 if (localLoop.size() <=2)
785 loopWeights.transfer(localLoopWeights);
810 const plane& cutPlane,
const cellShapeList & cellShapes
virtual bool cut(const vector &refDir, const label cellI, const boolList &vertIsCut, const boolList &edgeIsCut, const scalarField &edgeWeight, labelList &loop, scalarField &loopWeights) const
Create cut along circumference of cellI. Gets current mesh cuts.
void walkFace(const cellFeatures &features, const label faceI, const label startEdgeI, const label startVertI, const label nFeaturePts, label &edgeI, label &vertI) const
Walk across superface discarding non-feature points.
virtual bool cut(const vector &refDir, const label cellI, const boolList &vertIsCut, const boolList &edgeIsCut, const scalarField &edgeWeight, labelList &loop, scalarField &loopWeights) const
Create cut along circumference of cellI. Gets current mesh cuts.
topoCellLooper(const topoCellLooper &)
Disallow default bitwise copy construct.
static const scalar featureCos
Cos of angle for feature recognition (of splitHexes)
void walkAcrossFace(const cellFeatures &features, const label faceI, const label startEdgeI, const label startVertI, const label nFeats, label &edgeI, label &vertI) const
Starts from edge and vertex on edge on face (or neighbouring face)
#define forAll(list, i)
Loop across all elements in list.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const cellList & cells() const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Unit conversion functions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("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]=cellShape(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]
A cellMatcher for hex cells.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
const faceList & faces() const
void setCapacity(const label)
Alter the size of the underlying storage.
bool isFeatureEdge(const label edgeI) const
Is edge a feature edge (uniquely determined since on cell.
Macros for easy insertion into run-time selection tables.
errorManip< error > abort(error &err)
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual ~topoCellLooper()
Destructor.
prefixOSstream Pout(cout, "Pout")
labelList getSuperEdge(const cellFeatures &features, const label faceI, const label startEdgeI, const label startVertI) const
Returns list of vertices on 'superEdge' i.e. list of edges connected.
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dimensionedScalar e
Elementary charge.
static void subsetList(const label startI, const label freeI, DynamicList< T > &lst)
In-memory truncate a list.
label getAlignedNonFeatureEdge(const vector &refDir, const label cellI, const cellFeatures &features) const
Various functions to operate on Lists.
void size(const label)
Override size to be inconsistent with allocated storage.
bool isFeaturePoint(const label edge0, const label edge1) const
Are two edges connected at feature point?
defineTypeNameAndDebug(combustionModel, 0)
Implementation of cellLooper.
void walkSplitHex(const label cellI, const cellFeatures &features, const label fromFaceI, const label fromEdgeI, const label fromVertI, DynamicList< label > &loop, DynamicList< scalar > &loopWeights) const
Walks splitcell circumference. Sets loop/loopweights to walk on.
bool isFeatureVertex(const label faceI, const label vertI) const
Is vertexI on faceI used by two edges that form feature.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
dimensionedScalar cos(const dimensionedScalar &ds)