31 void Foam::particle::stationaryTetGeometry
45 vertex1 = pts[triIs[1]];
46 vertex2 = pts[triIs[2]];
52 vector centre, base, vertex1, vertex2;
53 stationaryTetGeometry(centre, base, vertex1, vertex2);
59 inline void Foam::particle::movingTetGeometry
61 const scalar fraction,
64 Pair<vector>& vertex1,
78 const scalar f0 = s[0] + stepFraction_*s[1],
f1 = fraction*s[1];
80 centre[0] = ccOld + f0*(ccNew - ccOld);
81 base[0] = ptsOld[triIs[0]] + f0*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
82 vertex1[0] = ptsOld[triIs[1]] + f0*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
83 vertex2[0] = ptsOld[triIs[2]] + f0*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
85 centre[1] = f1*(ccNew - ccOld);
86 base[1] = f1*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
87 vertex1[1] = f1*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
88 vertex2[1] = f1*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
97 Pair<vector> centre, base, vertex1, vertex2;
98 movingTetGeometry(fraction, centre, base, vertex1, vertex2);
101 Pair<barycentricTensor>
118 <<
"Particle counter has overflowed. This might cause problems" 119 <<
" when reconstructing particle tracks." <<
endl;
163 return stepFraction_;
169 return stepFraction_;
225 return s[0] + stepFraction_*s[1];
231 return tetIndices(celli_, tetFacei_, tetPti_);
237 if (mesh_.
moving() && stepFraction_ != 1)
239 return movingTetTransform(0)[0];
243 return stationaryTetTransform();
287 stepFractionBehind_ = 0;
297 <<
"Patch data was requested for a particle that isn't on a patch" 301 if (mesh_.
moving() && stepFraction_ != 1)
304 movingTetGeometry(1, centre, base, vertex1, vertex2);
306 normal =
triPointRef(base[0], vertex1[0], vertex2[0]).normal();
311 coordinates_.
b()*base[1]
312 + coordinates_.
c()*vertex1[1]
313 + coordinates_.
d()*vertex2[1];
317 vector centre, base, vertex1, vertex2;
318 stationaryTetGeometry(centre, base, vertex1, vertex2);
320 normal =
triPointRef(base, vertex1, vertex2).normal();
void reset(const scalar stepFraction)
Set the step fraction and clear the behind data in preparation for.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
label origProc() const
Return the originating processor ID.
const polyMesh & mesh() const
Return the mesh database.
bool moving() const
Is mesh moving.
errorManipArg< error, int > exit(error &err, const int errNo=1)
The time value with time-stepping information, user-defined remapping, etc.
bool onBoundaryFace() const
Is the particle on a boundary face?
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
triPointRef faceTri(const polyMesh &mesh) const
Return the geometry corresponding to the tri on the face for.
bool subCycling() const
Return true if time currently being sub-cycled, otherwise false.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Pair< scalar > stepFractionSpan() const
Return the step fraction change within the overall time-step.
Vector< scalar > vector
A scalar version of the templated Vector.
const TimeState & prevTimeState() const
Return previous TimeState if time is being sub-cycled.
label tetPt() const
Return current tet face particle is in.
virtual const pointField & points() const
Return raw points.
vector normal() const
Return the normal of the tri on tetFacei_ for the.
void patchData(vector &normal, vector &displacement) const
Get the normal and displacement of the current patch location.
label cell() const
Return current cell particle is in.
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))
vectorField pointField
pointField is a vectorField.
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.
scalar deltaTValue() const
Return time step value.
virtual const pointField & oldPoints() const
Return old points for mesh motion.
const Type & value() const
Return const reference to value.
static const label labelMax
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
barycentricTensor currentTetTransform() const
Return the current tet transformation tensor.
const vectorField & cellCentres() const
vector normal() const
Return unit normal.
label origId() const
Return the particle ID on the originating processor.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
bool onFace() const
Is the particle on a face?
label tetFace() const
Return current tet face particle is in.
label getNewParticleID() const
Get unique particle creation id.
const Time & time() const
Return time.
BarycentricTensor< scalar > barycentricTensor
A scalar version of the templated BarycentricTensor.
scalar stepFraction() const
Return the fraction of time-step completed.
tetIndices currentTetIndices() const
Return the indices of the current tet that the.
virtual const pointField & oldCellCentres() const
Return old cell centres for mesh motion.
#define WarningInFunction
Report a warning using Foam::Warning.
triangle< point, const point & > triPointRef
Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transfo...
const barycentric & coordinates() const
Return current particle coordinates.
static label particleCount_
Cumulative particle counter - used to provide unique ID.
Field< vector > vectorField
Specialisation of Field<T> for vector.
bool onInternalFace() const
Is the particle on an internal face?
Mesh consisting of general polyhedral cells.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
vector position() const
Return current particle position.
label patch() const
Return the index of patch that the particle is on.
scalar currentTimeFraction() const
Return the current fraction within the timestep. This differs.