49 bool Foam::hexCellLooper::walkHex
52 const label startFacei,
53 const label startEdgeI,
59 label facei = startFacei;
61 label edgeI = startEdgeI;
69 Pout<<
" walkHex : inserting cut onto edge:" << edgeI
74 loop[cutI] = edgeToEVert(edgeI);
75 loopWeights[cutI] = 0.5;
85 if (edgeI == startEdgeI)
95 Pout<<
"hexCellLooper::walkHex" <<
"Problem : cell:" << celli
96 <<
" collected loop:";
97 writeCuts(
Pout, loop, loopWeights);
98 Pout<<
"loopWeights:" << loopWeights <<
endl;
110 void Foam::hexCellLooper::makeFace
119 facePoints.setSize(loop.size());
120 faceVerts.setSize(loop.size());
124 label cut = loop[cutI];
128 label edgeI = getEdge(cut);
136 loopWeights[cutI]*v1 + (1.0-loopWeights[cutI])*v0;
140 label vertI = getVertex(cut);
145 faceVerts[cutI] = cutI;
197 success = walkHex(celli, face0, edgeI, loop, loopWeights);
219 <<
"could not cut cell " << celli <<
endl;
221 fileName cutsFile(
"hexCellLooper_" +
name(celli) +
".obj");
223 Pout<<
"hexCellLooper : writing cell to " << cutsFile <<
endl;
244 label elem = loop[elemI];
246 if (loopSet.found(elem))
251 loopSet.insert(elem);
258 makeFace(loop, loopWeights, faceVerts, facePoints);
260 if ((faceVerts.mag(facePoints) < small) || (loop.
size() < 3))
263 <<
" on points:" << facePoints <<
endl 275 const plane& cutPlane,
virtual ~hexCellLooper()
Destructor.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
A face is a list of labels corresponding to mesh vertices.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
A static collection of cell models, and a means of looking them up.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
const cellModel & hex_
Reference to hex cell shape.
hexCellLooper(const polyMesh &mesh)
Construct from components.
Macros for easy insertion into run-time selection tables.
Various functions to operate on Lists.
virtual const pointField & points() const
Return raw points.
vectorField pointField
pointField is a vectorField.
stressControl lookup("compactNormalStress") >> compactNormalStress
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const cellShapeList & cellShapes
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
const polyMesh & mesh() const
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
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.
word name(const complex &)
Return a string representation of a complex.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
void setSize(const label)
Reset size of List.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
prefixOSstream Pout(cout, "Pout")
A List with indirect addressing.
Mesh consisting of general polyhedral cells.
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.
Implementation of cellLooper. Does pure geometric cut through cell.