Go to the documentation of this file.
64 scalar minLen = GREAT;
82 const plane& cutPlane,
93 if ((
s > -pointEqualTol_) && (
s < 1 + pointEqualTol_))
123 else if (weight > (1-tol))
140 scalar nComp =
n & base;
142 if (
mag(nComp) > 0.8)
151 if (
mag(nComp) > 0.8)
164 e0 /=
mag(e0) + VSMALL;
184 label edgeI = getEdge(loop[index]);
188 const label prevCut = loop[loop.rcIndex(index)];
189 const label nextCut = loop[loop.fcIndex(index)];
191 if (!isEdge(prevCut) && !isEdge(nextCut))
195 label v0 = getVertex(prevCut);
196 label v1 = getVertex(nextCut);
200 (v0 ==
e[0] && v1 ==
e[1])
201 || (v0 ==
e[1] && v1 ==
e[0])
243 plane(
mesh().cellCentres()[cellI], refDir),
256 const plane& cutPlane,
293 label edgeI = cellEdges[i];
295 const edge&
e = edges[edgeI];
297 bool useStart =
false;
305 if (!checkedPoints.
found(
e.start()))
307 checkedPoints.
insert(
e.start());
309 scalar typStartLen = pointEqualTol_ * minEdgeLen(
e.start());
315 localLoop.
append(vertToEVert(
e.start()));
316 localLoopWeights.
append(-GREAT);
321 if (!checkedPoints.
found(
e.end()))
325 scalar typEndLen = pointEqualTol_ * minEdgeLen(
e.end());
331 localLoop.
append(vertToEVert(
e.end()));
332 localLoopWeights.
append(-GREAT);
342 if (!useEnd && !useStart)
348 if (cutEdge(cutPlane, edgeI, cutWeight))
351 label cutVertI = snapToVert(snapTol_, edgeI, cutWeight);
356 localLoop.
append(edgeToEVert(edgeI));
357 localLoopWeights.
append(cutWeight);
368 localLoop.
append(vertToEVert(cutVertI));
369 localLoopWeights.
append(-GREAT);
376 if (localLoop.size() <= 2)
382 localLoopWeights.
shrink();
391 loopPoints[i] = coord(localLoop[i], localLoopWeights[i]);
392 ctr += loopPoints[i];
394 ctr /= localLoop.size();
399 getBase(cutPlane.
normal(), e0, e1);
407 vector toCtr(loopPoints[i] - ctr);
414 loop.
setSize(localLoop.size());
415 loopWeights.setSize(loop.
size());
424 loop[i] = localLoop[indices[i]];
425 loopWeights[i] = localLoopWeights[indices[i]];
430 bool filterLoop =
false;
436 if (isEdge(
cut) && edgeEndsCut(loop, i))
448 scalarField filteredLoopWeights(loopWeights.size());
455 if (isEdge(
cut) && edgeEndsCut(loop, i))
461 filteredLoop[filterI] = loop[i];
462 filteredLoopWeights[filterI] = loopWeights[i];
467 filteredLoopWeights.setSize(filterI);
470 loopWeights.transfer(filteredLoopWeights);
478 Pout<<
"At angle:" << sortedAngles[i] <<
endl
481 writeCut(
Pout, loop[i], loopWeights[i]);
483 Pout<<
" coord:" << coord(loop[i], loopWeights[i]);
scalar distance(const point &p) const
Return distance from the given point to the plane.
virtual const pointField & points() const
Return raw points.
const vector & normal() const
Return plane normal.
void sort()
(stable) sort the list (if changed after construction time)
#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,.
static scalar snapTol_
Tolerance for cut through edges to get snapped to edge end point.
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.
label snapToVert(const scalar tol, const label edgeI, const scalar weight) const
Snaps cut through edge by cut through vertex (if weight closer than.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
dimensioned< scalar > mag(const dimensioned< Type > &)
const labelListList & pointEdges() const
Mesh consisting of general polyhedral cells.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
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 labelListList & cellEdges() const
void getBase(const vector &n, vector &e0, vector &e1) const
Gets two (random) vectors perpendicular to n and each other to be.
Abstract base class. Concrete implementations know how to cut a cell (i.e. determine a loop around th...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
bool cutEdge(const plane &cutPlane, const label edgeI, scalar &weight) const
Return true and set weight if edge is cut.
Patchify triangles based on orientation w.r.t other (triangulated or triangulatable) surfaces.
geomCellLooper(const geomCellLooper &)
Disallow default bitwise copy construct.
A list that is sorted upon construction or when explicitly requested with the sort() method.
Macros for easy insertion into run-time selection tables.
static const scalar pointEqualTol_
Tolerance for point equal test. Fraction of edge length.
bool found(const Key &) const
Return true if hashedEntry is found in table.
scalar pseudoAngle(const vector &e0, const vector &e1, const vector &vec)
Estimate angle of vec in coordinate system (e0, e1, e0^e1).
const double e
Elementary charge.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
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.
virtual ~geomCellLooper()
Destructor.
scalar minEdgeLen(const label vertI) const
Min length of attached edges.
prefixOSstream Pout(cout, "Pout")
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.
bool insert(const Key &key)
Insert a new entry.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
Various functions to operate on Lists.
bool edgeEndsCut(const labelList &, const label index) const
Return true if the cut edge at loop[index] is inbetween the cuts.
void size(const label)
Override size to be inconsistent with allocated storage.
scalar normalIntersect(const point &pnt0, const vector &dir) const
Return cut coefficient for plane and line defined by.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const polyMesh & mesh() const
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.