32 void Foam::particle::stationaryTetGeometry
47 vertex1 = pts[triIs[1]];
48 vertex2 = pts[triIs[2]];
57 vector centre, base, vertex1, vertex2;
58 stationaryTetGeometry(mesh, centre, base, vertex1, vertex2);
64 inline void Foam::particle::movingTetGeometry
67 const scalar fraction,
70 Pair<vector>& vertex1,
74 const triFace triIs(currentTetIndices(mesh).faceTriIs(mesh));
77 const vector ccOld = mesh.oldCellCentres()[celli_];
78 const vector ccNew = mesh.cellCentres()[celli_];
80 const scalar f0 = stepFraction_, f1 = fraction;
82 centre[0] = ccOld + f0*(ccNew - ccOld);
83 base[0] = ptsOld[triIs[0]] + f0*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
84 vertex1[0] = ptsOld[triIs[1]] + f0*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
85 vertex2[0] = ptsOld[triIs[2]] + f0*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
87 centre[1] = f1*(ccNew - ccOld);
88 base[1] = f1*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
89 vertex1[1] = f1*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
90 vertex2[1] = f1*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
100 Pair<vector> centre, base, vertex1, vertex2;
101 movingTetGeometry(mesh, fraction, centre, base, vertex1, vertex2);
104 Pair<barycentricTensor>
116 label id = particleCount_++;
121 <<
"Particle counter has overflowed. This might cause problems"
122 <<
" when reconstructing particle tracks." <<
endl;
166 return stepFraction_;
172 return stepFraction_;
205 return tetIndices(celli_, tetFacei_, tetPti_);
214 if (mesh.
moving() && stepFraction_ != 1)
216 return movingTetTransform(mesh, 0)[0];
220 return stationaryTetTransform(mesh);
227 return currentTetIndices(mesh).faceTri(mesh).normal();
257 return currentTetTransform(mesh) & coordinates_;
263 stepFraction_ = stepFraction;
264 stepFractionBehind_ = 0;
276 if (!onBoundaryFace(mesh))
279 <<
"Patch data was requested for a particle that isn't on a patch"
283 if (mesh.
moving() && stepFraction_ != 1)
286 movingTetGeometry(mesh, 1, centre, base, vertex1, vertex2);
288 normal =
triPointRef(base[0], vertex1[0], vertex2[0]).normal();
293 coordinates_.b()*base[1]
294 + coordinates_.c()*vertex1[1]
295 + coordinates_.d()*vertex2[1];
299 vector centre, base, vertex1, vertex2;
300 stationaryTetGeometry(mesh, centre, base, vertex1, vertex2);
302 normal =
triPointRef(base, vertex1, vertex2).normal();
Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transfo...
An ordered pair of two objects of type <T> with first() and second() elements.
label face() const
Return current face particle is on otherwise -1.
vector normal(const polyMesh &mesh) const
Return the normal of the tri on tetFacei_ for the.
label tetPt() const
Return current tet face particle is in.
label origProc() const
Return the originating processor ID.
const barycentric & coordinates() const
Return current particle coordinates.
label cell() const
Return current cell particle is in.
void reset(const scalar stepFraction)
Set the step fraction and clear the behind data in preparation.
label patch(const polyMesh &mesh) const
Return the index of patch that the particle is on.
scalar stepFraction() const
Return the fraction of time-step completed.
bool onFace() const
Is the particle on a face?
void patchData(const polyMesh &mesh, vector &normal, vector &displacement) const
Get the normal and displacement of the current patch location.
bool onBoundaryFace(const polyMesh &mesh) const
Is the particle on a boundary face?
label getNewParticleID() const
Get unique particle creation id.
tetIndices currentTetIndices(const polyMesh &mesh) const
Return the indices of the current tet that the.
bool onInternalFace(const polyMesh &mesh) const
Is the particle on an internal face?
vector position(const polyMesh &mesh) const
Return current particle position.
label origId() const
Return the particle ID on the originating processor.
barycentricTensor currentTetTransform(const polyMesh &mesh) const
Return the current tet transformation tensor.
label tetFace() const
Return current tet face particle is in.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
bool moving() const
Is mesh moving.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
Vector< scalar > vector
A scalar version of the templated Vector.
Field< vector > vectorField
Specialisation of Field<T> for vector.
triangle< point, const point & > triPointRef
BarycentricTensor< scalar > barycentricTensor
A scalar version of the templated BarycentricTensor.
static const label labelMax