35 #ifndef Foam_particle_H 36 #define Foam_particle_H 59 class cyclicPolyPatch;
60 class cyclicAMIPolyPatch;
61 class cyclicACMIPolyPatch;
62 class processorPolyPatch;
63 class symmetryPlanePolyPatch;
64 class symmetryPolyPatch;
68 Ostream&
operator<<(Ostream&,
const particle&);
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" 385 const label tetFacei,
395 const label celli = -1
404 const label tetFacei,
406 const bool doLocate =
true 416 const bool newFormat =
true,
417 const bool doLocate =
true 436 template<
class Derived>
443 template<
class Derived>
452 const polyMesh& mesh_;
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
745 template<class TrackCloudType>
749 template<class TrackCloudType>
793 #include "particleI.H" Template class for intrusive linked lists.
autoPtr< particle > operator()(Istream &is) const
virtual void writePosition(Ostream &os) const
Write the particle position and cell id.
void hitCyclicACMIPatch(TrackCloudType &, trackingData &, const vector &)
Overridable function to handle the particle hitting a.
void correctAfterParallelTransfer(const label patchi, trackingData &td)
Convert processor patch addressing to the global equivalents.
trackingData(const TrackCloudType &cloud)
label tetFace() const noexcept
Return current tet face particle is in.
vector deviationFromMeshCentre() const
Get the displacement from the mesh centre. Used to correct the.
label tetPt() const noexcept
Return current tet face particle is in.
A face is a list of labels corresponding to mesh vertices.
virtual autoPtr< particle > clone() const
Construct a clone.
A 1D vector of objects of type <T> with a fixed length <N>.
const barycentric & coordinates() const noexcept
Return current particle coordinates.
Macros for adding to particle property lists.
label procTetPt(const polyMesh &procMesh, const label procCell, const label procTetFace) const
Return the tet point appropriate for decomposition or reconstruction.
label origId() const noexcept
Return the particle ID on the originating processor.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
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. ...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
scalar trackToFace(const vector &displacement, const scalar fraction)
As particle::track, but also stops on internal faces.
scalar trackToTri(const vector &displacement, const scalar fraction, label &tetTriI)
As particle::trackToFace, but also stops on tet triangles. On.
bool onFace() const noexcept
Is the particle on a face?
static bool writeLagrangianCoordinates
Write particle coordinates file (v1712 and later) Default is true.
void hitWallPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
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.
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
static void writePropertyName(Ostream &os, const word &name, const word &delim)
Write the name representation to stream.
void hitSymmetryPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a symmetryPatch.
void prepareForInteractionListReferral(const vectorTensorTransform &transform)
Break the topology and store the particle position so that the.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Old particle positions content for OpenFOAM-1706 and earlier.
vector normal() const
The (unit) normal of the tri on tetFacei_ for the current tet.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
void hitBoundaryFace(const vector &direction, TrackCloudType &cloud, trackingData &td)
Dispatch function for boundary face interaction. Calls one of.
void readData(Istream &is, point &position, const bool readFields, const bool newFormat, const bool doLocate)
Read particle from stream. Optionally (for old format) return.
An ordered pair of two objects of type <T> with first() and second() elements.
void patchData(vector &n, vector &U) const
Get the normal and velocity of the current patch location.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
TypeName("particle")
Runtime type information.
void hitFace(const vector &direction, TrackCloudType &cloud, trackingData &td)
Hit the current face. If the current face is internal than this.
void reset()
Reset particle data.
Generic templated field type.
Intrusive doubly-linked list.
void hitProcessorPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a processorPatch.
bool onInternalFace() const noexcept
Is the particle on an internal face?
A class for handling words, derived from Foam::string.
bool switchProcessor
Flag to switch processor.
particle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
A cloud is a registry collection of lagrangian particles.
tetIndices currentTetIndices() const noexcept
Return indices of the current tet that the particle occupies.
void writeCoordinates(Ostream &os) const
Write the particle barycentric coordinates and cell info.
void correctAfterInteractionListReferral(const label celli)
Correct the topology after referral. The particle may still be.
virtual ~particle()=default
Destructor.
A List of wordRe with additional matching capabilities.
void prepareForParallelTransfer()
Convert global addressing to the processor patch local equivalents.
void hitCyclicPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a cyclicPatch.
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.
void hitCyclicAMIPatch(TrackCloudType &, trackingData &, const vector &)
Overridable function to handle the particle hitting a cyclicAMIPatch.
scalar stepFraction() const noexcept
Return the fraction of time-step completed.
void autoMap(const vector &position, const mapPolyMesh &mapper)
Map after a topology change.
static autoPtr< particle > Clone(const Derived &p)
Clone a particle.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
label getNewParticleID() const
Get unique particle creation id.
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void hitWedgePatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wedgePatch.
label origProc() const noexcept
Return the originating processor ID.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
scalar trackToMovingTri(const vector &displacement, const scalar fraction, label &tetTriI)
As particle::trackToTri, but for moving meshes.
const polyMesh & mesh() const noexcept
Return the mesh database.
static bool writeLagrangianPositions
Write particle positions file (v1706 format and earlier) Default is true (disable in etc/controlDict)...
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
A cell is defined as a list of faces with extra functionality.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
iNew(const polyMesh &mesh)
const dimensionedScalar c
Speed of light in a vacuum.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
void relocate(const point &position, const label celli=-1)
Set the addressing based on the provided position.
Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transfo...
bool hitPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a patch.
static label particleCount_
Cumulative particle counter - used to provide unique ID.
bool operator!=(const eddy &a, const eddy &b)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
void trackToAndHitFace(const vector &direction, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Convenience function. Combines trackToFace and hitFace.
scalar trackToStationaryTri(const vector &displacement, const scalar fraction, label &tetTriI)
As particle::trackToTri, but for stationary meshes.
bool onBoundaryFace() const noexcept
Is the particle on a boundary face?
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Registry of regIOobjects.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
#define DefinePropertyList(str)
Define a static 'propertyList' for particle properties.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
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.
Tensor of scalars, i.e. Tensor<scalar>.
Templated base class for dsmc cloud.
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.