30 const std::size_t Foam::wallBoundedParticle::sizeofFields_
32 sizeof(wallBoundedParticle) -
sizeof(particle)
45 <<
"cannot both be on a mesh edge and a face-diagonal edge." 62 return edge(f[faceBasePtI], f[diagPtI]);
90 if (f[fpMin1] == meshEdge[1])
98 "wallBoundedParticle::crossEdgeConnectedFace" 105 <<
" meshEdge:" << meshEdge
114 if (eNew != meshEdge)
118 "wallBoundedParticle::crossEdgeConnectedFace" 129 FatalErrorIn(
"wallBoundedParticle::crossDiagonalEdge()")
136 FatalErrorIn(
"wallBoundedParticle::crossDiagonalEdge()")
159 FatalErrorIn(
"wallBoundedParticle::crossDiagonalEdge()")
162 <<
"tetPt:" <<
tetPt()
173 const vector& endPosition,
187 edge currentE(-1, -1);
203 if (
edge(tri[i], tri[j]) == currentE)
210 vector edgeNormal = (pt1-pt0)^n;
212 edgeNormal /=
mag(edgeNormal)+VSMALL;
215 scalar sEnd = (endPosition-pt0)&edgeNormal;
220 scalar sStart = (
position()-pt0)&edgeNormal;
221 if (
mag(sEnd-sStart) > VSMALL)
223 scalar
s = sStart/(sStart-sEnd);
225 if (s >= 0 && s < minS)
256 const point& endPosition
266 currentE[0] == currentE[1]
267 ||
findIndex(triVerts, currentE[0]) == -1
268 ||
findIndex(triVerts, currentE[1]) == -1
273 "wallBoundedParticle::isTriAlongTrack" 275 ) <<
"Edge " << currentE <<
" not on triangle " << triVerts
294 if (
edge(triVerts[i], triVerts[j]) == currentE)
296 vector edgeNormal = (pt1-pt0)^n;
297 return (dir&edgeNormal) < 0;
303 "wallBoundedParticle::isTriAlongTrack" 318 const label tetFaceI,
320 const label meshEdgeStart,
324 particle(mesh, position, cellI, tetFaceI, tetPtI),
359 "wallBoundedParticle::wallBoundedParticle" 360 "(const Cloud<wallBoundedParticle>&, Istream&, bool)" 386 os << static_cast<const particle&>(
p)
392 os << static_cast<const particle&>(
p);
396 wallBoundedParticle::sizeofFields_
label & cell()
Return current cell particle is in.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
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 ))
label & face()
Return current face particle is on otherwise -1.
dimensioned< scalar > mag(const dimensioned< Type > &)
const labelList & tetBasePtIs() const
Return the tetBasePtIs.
vector normal(const pointField &) const
Vector normal; magnitude is equal to area of face.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
virtual Istream & read(token &)=0
Return next token from stream.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
label nextLabel(const label i) const
Next vertex on face.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void crossDiagonalEdge()
Cross diagonal edge into different triangle on same face,cell.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A face is a list of labels corresponding to mesh vertices.
virtual const pointField & points() const
Return raw points.
A helper class for outputting values to Ostream.
const vector & position() const
Return current particle position.
tetPointRef currentTet() const
Return the geometry of the current tet that the.
scalar trackFaceTri(const vector &endPosition, label &minEdgeI)
Track through single triangle.
streamFormat format() const
Return current stream format.
label diagEdge_
Particle is on diagonal edge:
const polyMesh & mesh_
Reference to the polyMesh database.
label & tetFace()
Return current tet face particle is in.
errorManip< error > abort(error &err)
InfoProxy< wallBoundedParticle > info() const
Return info proxy.
label & tetPt()
Return current tet face particle is in.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
edge currentEdge() const
Construct current edge.
void crossEdgeConnectedFace(const edge &meshEdge)
Check if inside current tet.
Mesh consisting of general polyhedral cells.
bool isTriAlongTrack(const point &endPosition) const
Is current triangle in the track direction.
particle(const polyMesh &mesh, const vector &position, const label cellI, const label tetFaceI, const label tetPtI)
Construct from components.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A triangular face using a FixedList of labels corresponding to mesh vertices.
void crossEdgeConnectedFace(const label &cellI, label &tetFaceI, label &tetPtI, const edge &e)
Cross the from the given face across the given edge of the.
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
wallBoundedParticle(const polyMesh &c, const vector &position, const label cellI, const label tetFaceI, const label tetPtI, const label meshEdgeStart, const label diagEdge)
Construct from components.
Particle class that tracks on triangles of boundary faces. Use trackToEdge similar to trackToFace on ...
virtual const faceList & faces() const
Return raw faces.
void writeOBJ(Ostream &os, const point &pt)
Write obj representation of point.
tetIndices currentTetIndices() const
Return the indices of the current tet that the.
label meshEdgeStart_
Particle is on mesh edge: