51 bool Foam::hexCellLooper::walkHex
54 const label startFacei,
55 const label startEdgeI,
61 label facei = startFacei;
63 label edgeI = startEdgeI;
71 Pout<<
" walkHex : inserting cut onto edge:" << edgeI
77 loopWeights[cutI] = 0.5;
87 if (edgeI == startEdgeI)
97 Pout<<
"hexCellLooper::walkHex" <<
"Problem : cell:" << celli
98 <<
" collected loop:";
100 Pout<<
"loopWeights:" << loopWeights <<
endl;
110 void Foam::hexCellLooper::makeFace
119 facePoints.setSize(loop.size());
120 faceVerts.setSize(loop.size());
124 label cut = loop[cutI];
136 loopWeights[cutI]*v1 + (1.0-loopWeights[cutI])*v0;
140 label vertI = getVertex(cut);
145 faceVerts[cutI] = cutI;
152 Foam::hexCellLooper::hexCellLooper(
const polyMesh&
mesh)
154 geomCellLooper(
mesh),
190 success = walkHex(celli, face0, edgeI, loop, loopWeights);
212 <<
"could not cut cell " << celli <<
endl;
214 fileName cutsFile(
"hexCellLooper_" +
name(celli) +
".obj");
216 Pout<<
"hexCellLooper : writing cell to " << cutsFile <<
endl;
218 OFstream cutsStream(cutsFile);
237 label elem = loop[elemI];
239 if (loopSet.found(elem))
244 loopSet.insert(elem);
248 face faceVerts(loop.
size());
251 makeFace(loop, loopWeights, faceVerts, facePoints);
253 if ((faceVerts.mag(facePoints) < SMALL) || (loop.
size() < 3))
256 <<
" on points:" << facePoints <<
endl 257 << UIndirectList<point>(facePoints, faceVerts)
268 const plane& cutPlane,
void size(const label n)
Older name for setAddressableSize.
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.
bool empty() const noexcept
True if List is empty (ie, size() is zero)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & writeCuts(Ostream &os, const labelList &, const scalarField &) const
Write cut descriptions to Ostream.
Macros for easy insertion into run-time selection tables.
Various functions to operate on Lists.
static label edgeToEVert(const primitiveMesh &mesh, const label edgeI)
Convert edgeI to eVert.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
static label getEdge(List< DynamicList< label >> &pe, DynamicList< edge > &es, const label pointi, const label nextPointi)
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
errorManip< error > abort(error &err)
const polyMesh & mesh() const
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
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.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
Maps a geometry to a set of cell primitives.
List< label > labelList
A List of labels.
List< bool > boolList
A List of bools.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
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.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)