35#ifndef Foam_particle_H
36#define Foam_particle_H
83 static const std::size_t sizeofPosition;
86 static const std::size_t sizeofFields;
90 static const label maxNBehind_;
109 template<
class TrackCloudType>
155 scalar stepFraction_;
194 void stationaryTetReverseTransform
204 inline void movingTetGeometry
206 const scalar endStepFraction,
219 const scalar endStepFraction
228 void movingTetReverseTransform
230 const scalar endStepFraction,
255 void changeTet(
const label tetTriI);
258 void changeFace(
const label tetTriI);
268 void changeToMasterPatch();
279 const bool boundaryFail,
280 const string& boundaryMsg
295 const bool newFormat,
301 template<
class TrackCloudType>
305 template<
class TrackCloudType>
310 template<
class TrackCloudType>
314 template<
class TrackCloudType>
318 template<
class TrackCloudType>
322 template<
class TrackCloudType>
327 template<
class TrackCloudType>
331 template<
class TrackCloudType>
335 template<
class TrackCloudType>
342 template<
class TrackCloudType>
346 TrackCloudType&
cloud,
361 "(coordinatesa coordinatesb coordinatesc coordinatesd) "
362 "celli tetFacei tetPti facei stepFraction origProc origId"
395 const label
celli = -1
406 const bool doLocate =
true
416 const bool newFormat =
true,
417 const bool doLocate =
true
436 template<
class Derived>
443 template<
class Derived>
560 inline label
patch() const;
581 const scalar fraction
587 const
vector& displacement,
588 const scalar fraction
596 const
vector& displacement,
597 const scalar fraction,
604 const
vector& displacement,
605 const scalar fraction,
612 const
vector& displacement,
613 const scalar fraction,
620 template<class TrackCloudType>
624 TrackCloudType&
cloud,
629 template<class TrackCloudType>
633 const scalar fraction,
634 TrackCloudType&
cloud,
692 const label procCell,
693 const label procTetFace
738 const
Field<Type>& values,
745 template<class TrackCloudType>
749 template<class TrackCloudType>
793#include "particleI.H"
Intrusive doubly-linked list.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A 1D vector of objects of type <T> with a fixed length <N>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
An ordered pair of two objects of type <T> with first() and second() elements.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
A cloud is a registry collection of lagrangian particles.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI).
Cyclic patch for Arbitrary Mesh Interface (AMI).
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Registry of regIOobjects.
iNew(const polyMesh &mesh)
autoPtr< particle > operator()(Istream &is) const
bool switchProcessor
Flag to switch processor.
trackingData(const TrackCloudType &cloud)
bool keepParticle
Flag to indicate whether to keep particle (false = delete).
void correctAfterInteractionListReferral(const label celli)
Correct the topology after referral. The particle may still be.
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
label procTetPt(const polyMesh &procMesh, const label procCell, const label procTetFace) const
Return the tet point appropriate for decomposition or reconstruction.
tetIndices currentTetIndices() const noexcept
Return indices of the current tet that the particle occupies.
vector deviationFromMeshCentre() const
Get the displacement from the mesh centre. Used to correct the.
static void writeProperty(Ostream &os, const word &name, const Type &value, const bool nameOnly, const word &delim, const wordRes &filters=wordRes::null())
Write a named particle property to stream, optionally filtered based on its name.
barycentricTensor currentTetTransform() const
Return the current tet transformation tensor.
scalar trackToStationaryTri(const vector &displacement, const scalar fraction, label &tetTriI)
As particle::trackToTri, but for stationary meshes.
void correctAfterParallelTransfer(const label patchi, trackingData &td)
Convert processor patch addressing to the global equivalents.
scalar trackToFace(const vector &displacement, const scalar fraction)
As particle::track, but also stops on internal faces.
void hitCyclicACMIPatch(TrackCloudType &, trackingData &, const vector &)
Overridable function to handle the particle hitting a.
vector position() const
Return current particle position.
label face() const noexcept
Return current face particle is on otherwise -1.
static autoPtr< particle > Clone(const Derived &p, const polyMesh &mesh)
Clone a particle with a mesh reference.
label tetPt() const noexcept
Return current tet face particle is in.
void hitFace(const vector &direction, TrackCloudType &cloud, trackingData &td)
Hit the current face. If the current face is internal than this.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
void prepareForInteractionListReferral(const vectorTensorTransform &transform)
Break the topology and store the particle position so that the.
void hitBoundaryFace(const vector &direction, TrackCloudType &cloud, trackingData &td)
Dispatch function for boundary face interaction. Calls one of.
bool onFace() const noexcept
Is the particle on a face?
static autoPtr< particle > Clone(const Derived &p)
Clone a particle.
const polyMesh & mesh() const noexcept
Return the mesh database.
void hitCyclicPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a cyclicPatch.
void hitProcessorPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a processorPatch.
label tetFace() const noexcept
Return current tet face particle is in.
void autoMap(const vector &position, const mapPolyMesh &mapper)
Map after a topology change.
const barycentric & coordinates() const noexcept
Return current particle coordinates.
scalar trackToMovingTri(const vector &displacement, const scalar fraction, label &tetTriI)
As particle::trackToTri, but for moving meshes.
virtual autoPtr< particle > clone() const
Construct a clone.
bool onBoundaryFace() const noexcept
Is the particle on a boundary face?
label patch() const
Return the index of patch that the particle is on.
scalar stepFraction() const noexcept
Return the fraction of time-step completed.
bool hitPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a patch.
void readData(Istream &is, point &position, const bool readFields, const bool newFormat, const bool doLocate)
Read particle from stream. Optionally (for old format) return.
void patchData(vector &n, vector &U) const
Get the normal and velocity of the current patch location.
void prepareForParallelTransfer()
Convert global addressing to the processor patch local equivalents.
void hitCyclicAMIPatch(TrackCloudType &, trackingData &, const vector &)
Overridable function to handle the particle hitting a cyclicAMIPatch.
void hitSymmetryPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a symmetryPatch.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
void hitSymmetryPlanePatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a.
Pair< scalar > stepFractionSpan() const
Return the step fraction change within the overall time-step.
static label particleCount_
Cumulative particle counter - used to provide unique ID.
static bool writeLagrangianPositions
Write particle positions file (v1706 format and earlier) Default is true (disable in etc/controlDict)...
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual particle properties to stream.
scalar track(const vector &displacement, const scalar fraction)
Track along the displacement for a given fraction of the overall.
TypeName("particle")
Runtime type information.
bool onInternalFace() const noexcept
Is the particle on an internal face?
void hitWedgePatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wedgePatch.
label getNewParticleID() const
Get unique particle creation id.
void trackToAndHitFace(const vector &direction, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Convenience function. Combines trackToFace and hitFace.
label origId() const noexcept
Return the particle ID on the originating processor.
label cell() const noexcept
Return current cell particle is in.
particle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
void reset()
Reset particle data.
vector normal() const
The (unit) normal of the tri on tetFacei_ for the current tet.
virtual void writePosition(Ostream &os) const
Write the particle position and cell id.
void relocate(const point &position, const label celli=-1)
Set the addressing based on the provided position.
scalar currentTimeFraction() const
Return the current fraction within the timestep. This differs.
void hitWallPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
scalar trackToTri(const vector &displacement, const scalar fraction, label &tetTriI)
As particle::trackToFace, but also stops on tet triangles. On.
static void writePropertyName(Ostream &os, const word &name, const word &delim)
Write the name representation to stream.
static bool writeLagrangianCoordinates
Write particle coordinates file (v1712 and later) Default is true.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
label origProc() const noexcept
Return the originating processor ID.
void writeCoordinates(Ostream &os) const
Write the particle barycentric coordinates and cell info.
virtual ~particle()=default
Destructor.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
Neighbour processor patch.
Symmetry patch for non-planar or multi-plane patches.
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Wedge front and back plane patch.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
bool operator!=(const eddy &a, const eddy &b)
ILList< DLListBase, T > IDLList
DSMCCloud< dsmcParcel > CloudType
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
vector point
Point is a vector.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
BarycentricTensor< scalar > barycentricTensor
A scalar version of the templated BarycentricTensor.
Macros for adding to particle property lists.
#define DefinePropertyList(str)
Define a static 'propertyList' for particle properties.
link() noexcept=default
Default construct.
Old particle positions content for OpenFOAM-1706 and earlier.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.