wallBoundedParticle Class Reference

Particle class that tracks on triangles of boundary faces. Use trackToEdge similar to trackToFace on particle. More...

Inheritance diagram for wallBoundedParticle:
Collaboration diagram for wallBoundedParticle:

Classes

class  iNew
 Factory class to read-construct particles used for. More...
 
class  trackingData
 Class used to pass tracking data to the trackToFace function. More...
 

Public Member Functions

 wallBoundedParticle (const polyMesh &c, const point &position, const label celli, const label tetFacei, const label tetPti, const label meshEdgeStart, const label diagEdge)
 Construct from components. More...
 
 wallBoundedParticle (const polyMesh &c, Istream &is, bool readFields=true, bool newFormat=true)
 Construct from Istream. More...
 
 wallBoundedParticle (const wallBoundedParticle &p)
 Construct copy. More...
 
autoPtr< particleclone () const
 Construct and return a clone. More...
 
label meshEdgeStart () const noexcept
 The mesh edge label or -1. More...
 
label diagEdge () const noexcept
 The diagonal edge label or -1. More...
 
template<class TrackCloudType >
scalar trackToEdge (TrackCloudType &cloud, trackingData &td, const vector &endPosition)
 Equivalent of trackToFace. More...
 
template<class TrackCloudType >
void patchInteraction (TrackCloudType &cloud, trackingData &td, const scalar trackFraction)
 Do all patch interaction. More...
 
template<class TrackCloudType >
void hitProcessorPatch (TrackCloudType &cloud, trackingData &td)
 Overridable function to handle the particle hitting a processorPatch. More...
 
template<class TrackCloudType >
void hitWallPatch (TrackCloudType &cloud, trackingData &td)
 Overridable function to handle the particle hitting a wallPatch. More...
 
InfoProxy< wallBoundedParticleinfo () const noexcept
 Return info proxy, used to print particle information to a stream. More...
 
template<class TrackCloudType >
Foam::scalar trackToEdge (TrackCloudType &cloud, trackingData &td, const vector &endPosition)
 
template<class TrackCloudType >
void readFields (TrackCloudType &c)
 
template<class TrackCloudType >
void writeFields (const TrackCloudType &c)
 
- Public Member Functions inherited from particle< Type >
 TypeName ("particle")
 Runtime type information. More...
 
 particle (const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
 Construct from components. More...
 
 particle (const polyMesh &mesh, const vector &position, const label celli=-1)
 Construct from a position and a cell. More...
 
 particle (const polyMesh &mesh, const vector &position, const label celli, const label tetFacei, const label tetPti, const bool doLocate=true)
 Construct from position components. More...
 
 particle (const polyMesh &mesh, Istream &, const bool readFields=true, const bool newFormat=true, const bool doLocate=true)
 Construct from Istream. More...
 
 particle (const particle &p)
 Construct as a copy. More...
 
 particle (const particle &p, const polyMesh &mesh)
 Construct as a copy with reference to a new mesh. More...
 
virtual ~particle ()=default
 Destructor. More...
 
label getNewParticleID () const
 Get unique particle creation id. More...
 
const polyMeshmesh () const noexcept
 Return the mesh database. More...
 
const barycentriccoordinates () const noexcept
 Return current particle coordinates. More...
 
label cell () const noexcept
 Return current cell particle is in. More...
 
label & cell () noexcept
 Return current cell particle is in for manipulation. More...
 
label tetFace () const noexcept
 Return current tet face particle is in. More...
 
label & tetFace () noexcept
 Return current tet face particle is in for manipulation. More...
 
label tetPt () const noexcept
 Return current tet face particle is in. More...
 
label & tetPt () noexcept
 Return current tet face particle is in for manipulation. More...
 
label face () const noexcept
 Return current face particle is on otherwise -1. More...
 
label & face () noexcept
 Return current face particle is on for manipulation. More...
 
scalar stepFraction () const noexcept
 Return the fraction of time-step completed. More...
 
scalar & stepFraction () noexcept
 Return the fraction of time-step completed. More...
 
label origProc () const noexcept
 Return the originating processor ID. More...
 
label & origProc () noexcept
 Return the originating processor ID. More...
 
label origId () const noexcept
 Return the particle ID on the originating processor. More...
 
label & origId () noexcept
 Return the particle ID on the originating processor. More...
 
Pair< scalar > stepFractionSpan () const
 Return the step fraction change within the overall time-step. More...
 
scalar currentTimeFraction () const
 Return the current fraction within the timestep. This differs. More...
 
tetIndices currentTetIndices () const noexcept
 Return indices of the current tet that the particle occupies. More...
 
barycentricTensor currentTetTransform () const
 Return the current tet transformation tensor. More...
 
vector normal () const
 The (unit) normal of the tri on tetFacei_ for the current tet. More...
 
bool onFace () const noexcept
 Is the particle on a face? More...
 
bool onInternalFace () const noexcept
 Is the particle on an internal face? More...
 
bool onBoundaryFace () const noexcept
 Is the particle on a boundary face? More...
 
label patch () const
 Return the index of patch that the particle is on. More...
 
vector position () const
 Return current particle position. More...
 
void reset ()
 Reset particle data. More...
 
scalar track (const vector &displacement, const scalar fraction)
 Track along the displacement for a given fraction of the overall. More...
 
scalar trackToFace (const vector &displacement, const scalar fraction)
 As particle::track, but also stops on internal faces. More...
 
scalar trackToTri (const vector &displacement, const scalar fraction, label &tetTriI)
 As particle::trackToFace, but also stops on tet triangles. On. More...
 
scalar trackToStationaryTri (const vector &displacement, const scalar fraction, label &tetTriI)
 As particle::trackToTri, but for stationary meshes. More...
 
scalar trackToMovingTri (const vector &displacement, const scalar fraction, label &tetTriI)
 As particle::trackToTri, but for moving meshes. More...
 
template<class TrackCloudType >
void hitFace (const vector &direction, TrackCloudType &cloud, trackingData &td)
 Hit the current face. If the current face is internal than this. More...
 
template<class TrackCloudType >
void trackToAndHitFace (const vector &direction, const scalar fraction, TrackCloudType &cloud, trackingData &td)
 Convenience function. Combines trackToFace and hitFace. More...
 
vector deviationFromMeshCentre () const
 Get the displacement from the mesh centre. Used to correct the. More...
 
void patchData (vector &n, vector &U) const
 Get the normal and velocity of the current patch location. More...
 
virtual void transformProperties (const tensor &T)
 Transform the physical properties of the particle. More...
 
virtual void transformProperties (const vector &separation)
 Transform the physical properties of the particle. More...
 
void prepareForParallelTransfer ()
 Convert global addressing to the processor patch local equivalents. More...
 
void correctAfterParallelTransfer (const label patchi, trackingData &td)
 Convert processor patch addressing to the global equivalents. More...
 
void prepareForInteractionListReferral (const vectorTensorTransform &transform)
 Break the topology and store the particle position so that the. More...
 
void correctAfterInteractionListReferral (const label celli)
 Correct the topology after referral. The particle may still be. More...
 
label procTetPt (const polyMesh &procMesh, const label procCell, const label procTetFace) const
 Return the tet point appropriate for decomposition or reconstruction. More...
 
void autoMap (const vector &position, const mapPolyMesh &mapper)
 Map after a topology change. More...
 
void relocate (const point &position, const label celli=-1)
 Set the addressing based on the provided position. More...
 
void writeProperties (Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
 Write individual particle properties to stream. More...
 
void writeCoordinates (Ostream &os) const
 Write the particle barycentric coordinates and cell info. More...
 
virtual void writePosition (Ostream &os) const
 Write the particle position and cell id. More...
 

Static Public Member Functions

template<class CloudType >
static void readFields (CloudType &)
 Read. More...
 
template<class CloudType >
static void writeFields (const CloudType &)
 Write. More...
 
- Static Public Member Functions inherited from particle< Type >
static string propertyList ()
 
template<class Type >
static void writePropertyName (Ostream &os, const word &name, const word &delim)
 Write the name representation to stream. More...
 
template<class Type >
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. More...
 
template<class Type >
static void writeProperty (Ostream &os, const word &name, const Field< Type > &values, const bool nameOnly, const word &delim, const wordRes &filters=wordRes::null())
 Write a named particle property list to stream, optionally filtered based on its name. More...
 
template<class TrackCloudType >
static void readFields (TrackCloudType &c)
 Read the fields associated with the owner cloud. More...
 
template<class TrackCloudType >
static void writeFields (const TrackCloudType &c)
 Write the fields associated with the owner cloud. More...
 
template<class CloudType >
static void readObjects (CloudType &c, const objectRegistry &obr)
 Read particle fields as objects from the obr registry. More...
 
template<class CloudType >
static void writeObjects (const CloudType &c, objectRegistry &obr)
 Write particle fields as objects into the obr registry. More...
 

Static Public Attributes

static const std::size_t sizeofFields_
 Size in bytes of the fields. More...
 
- Static Public Attributes inherited from particle< Type >
static string propertyList_ = Foam::particle::propertyList()
 String representation of properties. More...
 
static label particleCount_ = 0
 Cumulative particle counter - used to provide unique ID. More...
 
static bool writeLagrangianCoordinates = true
 Write particle coordinates file (v1712 and later) Default is true. More...
 
static bool writeLagrangianPositions
 Write particle positions file (v1706 format and earlier) Default is true (disable in etc/controlDict) More...
 

Protected Member Functions

edge currentEdge () const
 Construct current edge. More...
 
void crossEdgeConnectedFace (const label &celli, label &tetFacei, label &tetPti, const edge &e)
 Replacement for particle::crossEdgeConnectedFace that avoids bombing. More...
 
void crossEdgeConnectedFace (const edge &meshEdge)
 Cross mesh edge into different face on same cell. More...
 
void crossDiagonalEdge ()
 Cross diagonal edge into different triangle on same face,cell. More...
 
scalar trackFaceTri (const vector &n, const vector &endPosition, label &)
 Track through single triangle. More...
 
bool isTriAlongTrack (const vector &n, const point &endPosition) const
 Is current triangle in the track direction. More...
 
- Protected Member Functions inherited from particle< Type >
void readData (Istream &is, point &position, const bool readFields, const bool newFormat, const bool doLocate)
 Read particle from stream. Optionally (for old format) return. More...
 
template<class TrackCloudType >
bool hitPatch (TrackCloudType &, trackingData &)
 Overridable function to handle the particle hitting a patch. More...
 
template<class TrackCloudType >
void hitWedgePatch (TrackCloudType &, trackingData &)
 Overridable function to handle the particle hitting a wedgePatch. More...
 
template<class TrackCloudType >
void hitSymmetryPlanePatch (TrackCloudType &, trackingData &)
 Overridable function to handle the particle hitting a. More...
 
template<class TrackCloudType >
void hitSymmetryPatch (TrackCloudType &, trackingData &)
 Overridable function to handle the particle hitting a symmetryPatch. More...
 
template<class TrackCloudType >
void hitCyclicPatch (TrackCloudType &, trackingData &)
 Overridable function to handle the particle hitting a cyclicPatch. More...
 
template<class TrackCloudType >
void hitCyclicAMIPatch (TrackCloudType &, trackingData &, const vector &)
 Overridable function to handle the particle hitting a cyclicAMIPatch. More...
 
template<class TrackCloudType >
void hitCyclicACMIPatch (TrackCloudType &, trackingData &, const vector &)
 Overridable function to handle the particle hitting a. More...
 
template<class TrackCloudType >
void hitProcessorPatch (TrackCloudType &, trackingData &)
 Overridable function to handle the particle hitting a processorPatch. More...
 
template<class TrackCloudType >
void hitWallPatch (TrackCloudType &, trackingData &)
 Overridable function to handle the particle hitting a wallPatch. More...
 
template<class TrackCloudType >
void hitBoundaryFace (const vector &direction, TrackCloudType &cloud, trackingData &td)
 Dispatch function for boundary face interaction. Calls one of. More...
 

Protected Attributes

point localPosition_
 Particle position is updated locally as opposed to via track. More...
 
label meshEdgeStart_
 Particle is on mesh edge: More...
 
label diagEdge_
 Particle is on diagonal edge: More...
 

Friends

Ostreamoperator<< (Ostream &, const wallBoundedParticle &)
 
Ostreamoperator<< (Ostream &, const InfoProxy< wallBoundedParticle > &)
 

Detailed Description

Particle class that tracks on triangles of boundary faces. Use trackToEdge similar to trackToFace on particle.

Source files

Definition at line 58 of file wallBoundedParticle.H.

Constructor & Destructor Documentation

◆ wallBoundedParticle() [1/3]

wallBoundedParticle ( const polyMesh c,
const point position,
const label  celli,
const label  tetFacei,
const label  tetPti,
const label  meshEdgeStart,
const label  diagEdge 
)

Construct from components.

Definition at line 405 of file wallBoundedParticle.C.

Referenced by wallBoundedParticle::clone(), and wallBoundedParticle::iNew::operator()().

Here is the caller graph for this function:

◆ wallBoundedParticle() [2/3]

◆ wallBoundedParticle() [3/3]

Construct copy.

Definition at line 461 of file wallBoundedParticle.C.

Member Function Documentation

◆ currentEdge()

◆ crossEdgeConnectedFace() [1/2]

void crossEdgeConnectedFace ( const label &  celli,
label &  tetFacei,
label &  tetPti,
const edge e 
)
protected

Replacement for particle::crossEdgeConnectedFace that avoids bombing.

out on invalid tet decomposition (tetBasePtIs = -1)

Definition at line 76 of file wallBoundedParticle.C.

References primitiveMesh::cells(), Foam::constant::electromagnetic::e, f(), polyMesh::faces(), mesh, Foam::neg(), Foam::meshTools::otherFace(), pFaces, and polyMesh::tetBasePtIs().

Here is the call graph for this function:

◆ crossEdgeConnectedFace() [2/2]

void crossEdgeConnectedFace ( const edge meshEdge)
protected

Cross mesh edge into different face on same cell.

Definition at line 183 of file wallBoundedParticle.C.

References Foam::abort(), f(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, UList< T >::find(), mesh, and UList< T >::rcIndex().

Here is the call graph for this function:

◆ crossDiagonalEdge()

void crossDiagonalEdge ( )
protected

Cross diagonal edge into different triangle on same face,cell.

Definition at line 232 of file wallBoundedParticle.C.

References Foam::abort(), f(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, UList< T >::fcIndex(), mesh, and UList< T >::rcIndex().

Here is the call graph for this function:

◆ trackFaceTri()

Foam::scalar trackFaceTri ( const vector n,
const vector endPosition,
label &  minEdgei 
)
protected

Track through single triangle.

Definition at line 279 of file wallBoundedParticle.C.

References FixedList< T, N >::fcIndex(), forAll, Foam::mag(), mesh, n, polyMesh::points(), and s.

Here is the call graph for this function:

◆ isTriAlongTrack()

bool isTriAlongTrack ( const vector n,
const point endPosition 
) const
protected

Is current triangle in the track direction.

Definition at line 358 of file wallBoundedParticle.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, FixedList< T, N >::fcIndex(), forAll, FixedList< T, N >::found(), mesh, n, and polyMesh::points().

Here is the call graph for this function:

◆ clone()

autoPtr<particle> clone ( ) const
inlinevirtual

Construct and return a clone.

Reimplemented from particle< Type >.

Reimplemented in wallBoundedStreamLineParticle.

Definition at line 209 of file wallBoundedParticle.H.

References wallBoundedParticle::wallBoundedParticle().

Here is the call graph for this function:

◆ meshEdgeStart()

label meshEdgeStart ( ) const
inlinenoexcept

The mesh edge label or -1.

Definition at line 250 of file wallBoundedParticle.H.

References wallBoundedParticle::meshEdgeStart_.

Referenced by wallBoundedParticle::readFields().

Here is the caller graph for this function:

◆ diagEdge()

label diagEdge ( ) const
inlinenoexcept

The diagonal edge label or -1.

Definition at line 255 of file wallBoundedParticle.H.

References wallBoundedParticle::diagEdge_.

Referenced by wallBoundedParticle::readFields().

Here is the caller graph for this function:

◆ trackToEdge() [1/2]

scalar trackToEdge ( TrackCloudType &  cloud,
trackingData td,
const vector endPosition 
)

Equivalent of trackToFace.

◆ patchInteraction()

void patchInteraction ( TrackCloudType &  cloud,
trackingData td,
const scalar  trackFraction 
)

Do all patch interaction.

Definition at line 28 of file wallBoundedParticleTemplates.C.

References particle< Type >::trackingData::keepParticle, mesh, p, and Foam::foamVersion::patch.

◆ hitProcessorPatch()

void hitProcessorPatch ( TrackCloudType &  cloud,
trackingData td 
)

Overridable function to handle the particle hitting a processorPatch.

Definition at line 375 of file wallBoundedParticleTemplates.C.

References f(), mesh, and particle< Type >::trackingData::switchProcessor.

Here is the call graph for this function:

◆ hitWallPatch()

void hitWallPatch ( TrackCloudType &  cloud,
trackingData td 
)

Overridable function to handle the particle hitting a wallPatch.

Definition at line 404 of file wallBoundedParticleTemplates.C.

◆ info()

InfoProxy<wallBoundedParticle> info ( ) const
inlinenoexcept

Return info proxy, used to print particle information to a stream.

Definition at line 313 of file wallBoundedParticle.H.

Referenced by wallBoundedParticle::currentEdge().

Here is the caller graph for this function:

◆ readFields() [1/2]

static void readFields ( CloudType )
static

Read.

◆ writeFields() [1/2]

static void writeFields ( const CloudType )
static

Write.

◆ trackToEdge() [2/2]

◆ readFields() [2/2]

void readFields ( TrackCloudType &  c)

◆ writeFields() [2/2]

void writeFields ( const TrackCloudType &  c)

Definition at line 452 of file wallBoundedParticleTemplates.C.

References Foam::constant::universal::c, IOobjectOption::NO_READ, p, regIOobject::write(), and particle< Type >::writeFields().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<< [1/2]

Ostream& operator<< ( Ostream ,
const wallBoundedParticle  
)
friend

◆ operator<< [2/2]

Ostream& operator<< ( Ostream ,
const InfoProxy< wallBoundedParticle > &   
)
friend

Member Data Documentation

◆ localPosition_

point localPosition_
protected

Particle position is updated locally as opposed to via track.

functions of the base Foam::particle class

Definition at line 99 of file wallBoundedParticle.H.

◆ meshEdgeStart_

label meshEdgeStart_
protected

Particle is on mesh edge:

const face& f = mesh.faces()[tetFace()] const edge e(f[meshEdgeStart_], f.nextLabel(meshEdgeStart_)); Note that this real edge is also one of the edges of the face-triangle (from tetFace()+tetPt()).

Definition at line 110 of file wallBoundedParticle.H.

Referenced by wallBoundedParticle::currentEdge(), and wallBoundedParticle::meshEdgeStart().

◆ diagEdge_

label diagEdge_
protected

Particle is on diagonal edge:

const face& f = mesh.faces()[tetFace()] label faceBasePti = mesh.tetBasePtIs()[facei]; label diagPti = (faceBasePti+diagEdge_)f.size(); const edge e(f[faceBasePti], f[diagPti]);

Definition at line 120 of file wallBoundedParticle.H.

Referenced by wallBoundedParticle::currentEdge(), and wallBoundedParticle::diagEdge().

◆ sizeofFields_

const std::size_t sizeofFields_
static

Size in bytes of the fields.

Definition at line 171 of file wallBoundedParticle.H.

Referenced by Foam::operator<<().


The documentation for this class was generated from the following files: