Go to the documentation of this file.
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]);
82 if (
f.nextLabel(fp) == meshEdge[1])
88 label fpMin1 =
f.rcIndex(fp);
90 if (
f[fpMin1] == meshEdge[1])
92 meshEdgeStart_ = fpMin1;
100 <<
"face:" << tetFace()
102 <<
" meshEdge:" << meshEdge
110 const edge eNew(
f[meshEdgeStart_],
f.nextLabel(meshEdgeStart_));
111 if (eNew != meshEdge)
128 if (meshEdgeStart_ != -1)
140 if (tetPt() == diagEdge_)
142 tetPt() =
f.rcIndex(tetPt());
146 label nextTetPt =
f.fcIndex(tetPt());
147 if (diagEdge_ == nextTetPt)
156 <<
"tetPt:" << tetPt()
167 const vector& endPosition,
172 const triFace tri(currentTetIndices().faceTriIs(mesh_));
181 edge currentE(-1, -1);
182 if (meshEdgeStart_ != -1 || diagEdge_ != -1)
184 currentE = currentEdge();
192 const point& pt0 = mesh_.points()[tri[i]];
193 const point& pt1 = mesh_.points()[tri[j]];
195 if (
edge(tri[i], tri[j]) == currentE)
202 vector edgeNormal = (pt1-pt0)^
n;
204 edgeNormal /=
mag(edgeNormal)+VSMALL;
207 scalar sEnd = (endPosition-pt0)&edgeNormal;
212 scalar sStart = (position()-pt0)&edgeNormal;
213 if (
mag(sEnd-sStart) > VSMALL)
215 scalar
s = sStart/(sStart-sEnd);
217 if (
s >= 0 &&
s < minS)
228 position() += minS*(endPosition-position());
234 position() = endPosition;
239 const point& triPt = mesh_.points()[tri[0]];
240 position() -= ((position()-triPt)&
n)*
n;
248 const point& endPosition
251 const triFace triVerts(currentTetIndices().faceTriIs(mesh_));
252 const edge currentE = currentEdge();
256 currentE[0] == currentE[1]
257 ||
findIndex(triVerts, currentE[0]) == -1
258 ||
findIndex(triVerts, currentE[1]) == -1
262 <<
"Edge " << currentE <<
" not on triangle " << triVerts
268 const vector dir = endPosition-position();
277 const point& pt0 = mesh_.points()[triVerts[i]];
278 const point& pt1 = mesh_.points()[triVerts[j]];
280 if (
edge(triVerts[i], triVerts[j]) == currentE)
282 vector edgeNormal = (pt1-pt0)^
n;
283 return (dir&edgeNormal) < 0;
301 const label tetFaceI,
303 const label meshEdgeStart,
308 meshEdgeStart_(meshEdgeStart),
326 is >> meshEdgeStart_ >> diagEdge_;
330 is.
read(
reinterpret_cast<char*
>(&meshEdgeStart_), sizeofFields_);
337 "wallBoundedParticle::wallBoundedParticle"
338 "(const Cloud<wallBoundedParticle>&, Istream&, bool)"
349 meshEdgeStart_(
p.meshEdgeStart_),
350 diagEdge_(
p.diagEdge_)
364 os << static_cast<const particle&>(
p)
370 os << static_cast<const particle&>(
p);
373 reinterpret_cast<const char*
>(&
p.meshEdgeStart_),
385 const InfoProxy<wallBoundedParticle>& ip
388 const wallBoundedParticle&
p = ip.t_;
392 os <<
" " <<
static_cast<const particle&
>(
p) <<
nl
vector normal(const pointField &) const
Vector normal; magnitude is equal to area of face.
streamFormat format() const
Return current stream format.
static const std::size_t sizeofFields_
Size in bytes of the fields.
#define forAll(list, i)
Loop across all elements in list.
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 findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
const labelList & tetBasePtIs() const
Return the tetBasePtIs.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
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.
label meshEdgeStart_
Particle is on mesh edge:
void crossDiagonalEdge()
Cross diagonal edge into different triangle on same face,cell.
InfoProxy< wallBoundedParticle > info() const
Return info proxy.
dimensioned< scalar > mag(const dimensioned< Type > &)
This function object reads fields from the time directories and adds them to the mesh database for fu...
scalar trackFaceTri(const vector &endPosition, label &minEdgeI)
Track through single triangle.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
Mesh consisting of general polyhedral cells.
void crossEdgeConnectedFace(const edge &meshEdge)
Cross mesh edge into different face on same cell.
label & tetFace()
Return current tet face particle is in.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Particle class that tracks on triangles of boundary faces. Use trackToEdge similar to trackToFace on ...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
tetrahedron< point, const point & > tetPointRef
errorManip< error > abort(error &err)
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))
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A triangular face using a FixedList of labels corresponding to mesh vertices.
edge currentEdge() const
Construct current edge.
A face is a list of labels corresponding to mesh vertices.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A cell is defined as a list of faces with extra functionality.
bool isTriAlongTrack(const point &endPosition) const
Is current triangle in the track direction.
const polyMesh & mesh_
Reference to the polyMesh database.
label diagEdge_
Particle is on diagonal edge:
virtual Istream & read(token &)=0
Return next token from stream.