FaceCellWave< Type, TrackingData > Class Template Reference

Wave propagation of information through grid. Every iteration information goes through one layer of cells. Templated on information that is transferred. More...

Inheritance diagram for FaceCellWave< Type, TrackingData >:
Collaboration diagram for FaceCellWave< Type, TrackingData >:

Public Member Functions

 FaceCellWave (const polyMesh &mesh, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, TrackingData &td=FaceCellWaveBase::dummyTrackData_)
 Construct from mesh. Use setFaceInfo and iterate() to do actual calculation. More...
 
 FaceCellWave (const polyMesh &mesh, const labelUList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=FaceCellWaveBase::dummyTrackData_)
 Construct from mesh and list of changed faces with the Type. More...
 
 FaceCellWave (const polyMesh &mesh, const labelPairList &explicitConnections, const bool handleCyclicAMI, const labelUList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=FaceCellWaveBase::dummyTrackData_)
 Construct from mesh and explicitly connected boundary faces. More...
 
virtual ~FaceCellWave ()=default
 Destructor. More...
 
UList< Type > & allFaceInfo () noexcept
 Access allFaceInfo. More...
 
UList< Type > & allCellInfo () noexcept
 Access allCellInfo. More...
 
const TrackingData & data () const noexcept
 Additional data to be passed into container. More...
 
void setFaceInfo (const label facei, const Type &faceInfo)
 Set single initial changed face. More...
 
void setFaceInfo (const labelUList &changedFaces, const List< Type > &changedFacesInfo)
 Set initial changed faces. More...
 
virtual label faceToCell ()
 Propagate from face to cell. More...
 
virtual label cellToFace ()
 Propagate from cell to face. More...
 
virtual label iterate (const label maxIter)
 Iterate until no changes or maxIter reached. More...
 
- Public Member Functions inherited from FaceCellWaveBase
 ClassName ("FaceCellWave")
 Runtime type information. More...
 
 FaceCellWaveBase (const polyMesh &mesh)
 Construct with mesh reference and set initial sizes. More...
 
const polyMeshmesh () const noexcept
 Return access to the mesh. More...
 
label nChangedCells () const noexcept
 Current number of changed cells. More...
 
label nChangedFaces () const noexcept
 Current number of changed faces. More...
 
label nUnvisitedCells () const noexcept
 Get number of unvisited cells, i.e. cells that were not (yet) reached from walking across mesh. More...
 
label nUnvisitedFaces () const noexcept
 Get number of unvisited faces. More...
 

Protected Types

typedef std::pair< label, Type > taggedInfoType
 Information tagged with a source or destination id. More...
 

Protected Member Functions

bool updateCell (const label celli, const label neighbourFacei, const Type &neighbourInfo, const scalar tol, Type &cellInfo)
 Updates cellInfo with information from neighbour. More...
 
bool updateFace (const label facei, const label neighbourCelli, const Type &neighbourInfo, const scalar tol, Type &faceInfo)
 Updates faceInfo with information from neighbour. More...
 
bool updateFace (const label facei, const Type &neighbourInfo, const scalar tol, Type &faceInfo)
 Updates faceInfo with information from same face. More...
 
void checkCyclic (const polyPatch &pPatch) const
 Debugging: check info on both sides of cyclic. More...
 
template<class PatchType >
bool hasPatch () const
 Has cyclic patch? More...
 
void mergeFaceInfo (const polyPatch &patch, const label nFaces, const labelUList &changedFaces, const List< Type > &changedFacesInfo)
 Merge received patch data into global data. More...
 
label getChangedPatchFaces (const polyPatch &patch, const label startFacei, const label nFaces, labelList &changedPatchFaces, List< Type > &changedPatchFacesInfo) const
 Extract info for single patch only. More...
 
void leaveDomain (const polyPatch &patch, const label nFaces, const labelUList &faceLabels, List< Type > &faceInfo) const
 Handle leaving domain. Implementation referred to Type. More...
 
void enterDomain (const polyPatch &patch, const label nFaces, const labelUList &faceLabels, List< Type > &faceInfo) const
 Handle leaving domain. Implementation referred to Type. More...
 
void transform (const tensorField &rotTensor, const label nFaces, List< Type > &faceInfo)
 Apply transformation to Type. More...
 
void handleProcPatches ()
 Merge data from across processor boundaries. More...
 
void handleCyclicPatches ()
 Merge data from across cyclics. More...
 
void handleAMICyclicPatches ()
 Merge data from across AMI cyclics. More...
 
void handleExplicitConnections ()
 Merge data across explicitly provided local connections. More...
 
 FaceCellWave (const FaceCellWave &)=delete
 No copy construct. More...
 
void operator= (const FaceCellWave &)=delete
 No copy assignment. More...
 

Static Protected Member Functions

static void offset (const polyPatch &patch, const label off, const label nFaces, labelList &faces)
 Offset face labels by constant value. More...
 

Protected Attributes

const labelPairList explicitConnections_
 Optional boundary faces that information should travel through. More...
 
UList< Type > & allFaceInfo_
 Information for all faces. More...
 
UList< Type > & allCellInfo_
 Information for all cells. More...
 
TrackingData & td_
 Additional data to be passed into container. More...
 
DynamicList< taggedInfoTypechangedBaffles_
 
const bool hasCyclicPatches_
 Contains cyclics. More...
 
const bool hasCyclicAMIPatches_
 Contains cyclicAMI. More...
 
label nEvals_
 Number of evaluations. More...
 
- Protected Attributes inherited from FaceCellWaveBase
const polyMeshmesh_
 Reference to mesh. More...
 
PstreamBuffers pBufs_
 Buffers when updating processor patches. More...
 
bitSet changedFace_
 Track if face has changed. More...
 
bitSet changedCell_
 Track if cell has changed. More...
 
DynamicList< label > changedFaces_
 List of changed faces. More...
 
DynamicList< label > changedCells_
 List of changed cells. More...
 
label nUnvisitedFaces_
 Current count of unvisited faces. More...
 
label nUnvisitedCells_
 Current count of unvisited cells. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from FaceCellWaveBase
static scalar propagationTol () noexcept
 Access to propagation tolerance. More...
 
static scalar setPropagationTol (const scalar tol) noexcept
 Change propagation tolerance, return previous value. More...
 
- Static Public Attributes inherited from FaceCellWaveBase
static int dummyTrackData_ = 12345
 Default trackData value (for default template argument) More...
 
- Static Protected Attributes inherited from FaceCellWaveBase
static const scalar geomTol_ = 1e-6
 
static scalar propagationTol_ = 0.01
 

Detailed Description

template<class Type, class TrackingData = int>
class Foam::FaceCellWave< Type, TrackingData >

Wave propagation of information through grid. Every iteration information goes through one layer of cells. Templated on information that is transferred.

Handles parallel and cyclics and non-parallel cyclics.

Note: whether to propagate depends on the return value of Type::update which returns true (i.e. propagate) if the value changes by more than a certain tolerance. This tolerance can be very strict for normal face-cell and parallel cyclics (we use a value of 0.01 just to limit propagation of small changes) but for non-parallel cyclics this tolerance can be critical and if chosen too small can lead to non-convergence.

Source files

Definition at line 206 of file FaceCellWave.H.

Member Typedef Documentation

◆ taggedInfoType

typedef std::pair<label,Type> taggedInfoType
protected

Information tagged with a source or destination id.

With std::pair as lightweight, movable container.

Definition at line 217 of file FaceCellWave.H.

Constructor & Destructor Documentation

◆ FaceCellWave() [1/4]

FaceCellWave ( const FaceCellWave< Type, TrackingData > &  )
protecteddelete

No copy construct.

◆ FaceCellWave() [2/4]

FaceCellWave ( const polyMesh mesh,
UList< Type > &  allFaceInfo,
UList< Type > &  allCellInfo,
TrackingData &  td = FaceCellWaveBase::dummyTrackData_ 
)

Construct from mesh. Use setFaceInfo and iterate() to do actual calculation.

Definition at line 897 of file FaceCellWave.C.

◆ FaceCellWave() [3/4]

FaceCellWave ( const polyMesh mesh,
const labelUList initialChangedFaces,
const List< Type > &  changedFacesInfo,
UList< Type > &  allFaceInfo,
UList< Type > &  allCellInfo,
const label  maxIter,
TrackingData &  td = FaceCellWaveBase::dummyTrackData_ 
)

Construct from mesh and list of changed faces with the Type.

for these faces. Iterates until nothing changes or maxIter reached. (maxIter can be 0 or negative). 0 initializes, -1 does not

Definition at line 937 of file FaceCellWave.C.

◆ FaceCellWave() [4/4]

FaceCellWave ( const polyMesh mesh,
const labelPairList explicitConnections,
const bool  handleCyclicAMI,
const labelUList initialChangedFaces,
const List< Type > &  changedFacesInfo,
UList< Type > &  allFaceInfo,
UList< Type > &  allCellInfo,
const label  maxIter,
TrackingData &  td = FaceCellWaveBase::dummyTrackData_ 
)

Construct from mesh and explicitly connected boundary faces.

and list of changed faces with the Type for these faces. Iterates until nothing changes or maxIter reached. (maxIter can be 0 or negative). 0 initializes, -1 does not

Definition at line 996 of file FaceCellWave.C.

◆ ~FaceCellWave()

virtual ~FaceCellWave ( )
virtualdefault

Destructor.

Member Function Documentation

◆ updateCell()

bool updateCell ( const label  celli,
const label  neighbourFacei,
const Type &  neighbourInfo,
const scalar  tol,
Type &  cellInfo 
)
protected

Updates cellInfo with information from neighbour.

Updates all statistics.

Definition at line 100 of file FaceCellWave.C.

◆ updateFace() [1/2]

bool updateFace ( const label  facei,
const label  neighbourCelli,
const Type &  neighbourInfo,
const scalar  tol,
Type &  faceInfo 
)
protected

Updates faceInfo with information from neighbour.

Updates all statistics.

Definition at line 148 of file FaceCellWave.C.

◆ updateFace() [2/2]

bool updateFace ( const label  facei,
const Type &  neighbourInfo,
const scalar  tol,
Type &  faceInfo 
)
protected

Updates faceInfo with information from same face.

Updates all statistics.

Definition at line 196 of file FaceCellWave.C.

◆ checkCyclic()

void checkCyclic ( const polyPatch pPatch) const
protected

Debugging: check info on both sides of cyclic.

Definition at line 242 of file FaceCellWave.C.

◆ hasPatch()

bool hasPatch ( ) const
protected

Has cyclic patch?

Definition at line 288 of file FaceCellWave.C.

◆ mergeFaceInfo()

void mergeFaceInfo ( const polyPatch patch,
const label  nFaces,
const labelUList changedFaces,
const List< Type > &  changedFacesInfo 
)
protected

Merge received patch data into global data.

Definition at line 356 of file FaceCellWave.C.

◆ getChangedPatchFaces()

Foam::label getChangedPatchFaces ( const polyPatch patch,
const label  startFacei,
const label  nFaces,
labelList changedPatchFaces,
List< Type > &  changedPatchFacesInfo 
) const
protected

Extract info for single patch only.

Definition at line 390 of file FaceCellWave.C.

◆ leaveDomain()

void leaveDomain ( const polyPatch patch,
const label  nFaces,
const labelUList faceLabels,
List< Type > &  faceInfo 
) const
protected

Handle leaving domain. Implementation referred to Type.

Definition at line 422 of file FaceCellWave.C.

◆ enterDomain()

void enterDomain ( const polyPatch patch,
const label  nFaces,
const labelUList faceLabels,
List< Type > &  faceInfo 
) const
protected

Handle leaving domain. Implementation referred to Type.

Definition at line 445 of file FaceCellWave.C.

◆ offset()

void offset ( const polyPatch patch,
const label  off,
const label  nFaces,
labelList faces 
)
staticprotected

Offset face labels by constant value.

Definition at line 497 of file FaceCellWave.C.

◆ transform()

void transform ( const tensorField rotTensor,
const label  nFaces,
List< Type > &  faceInfo 
)
protected

Apply transformation to Type.

Definition at line 468 of file FaceCellWave.C.

◆ handleProcPatches()

void handleProcPatches ( )
protected

Merge data from across processor boundaries.

Transfer changed faces from neighbouring processors.

Definition at line 515 of file FaceCellWave.C.

◆ handleCyclicPatches()

void handleCyclicPatches ( )
protected

Merge data from across cyclics.

Transfer changed faces across cyclic halves

Definition at line 660 of file FaceCellWave.C.

◆ handleAMICyclicPatches()

void handleAMICyclicPatches ( )
protected

Merge data from across AMI cyclics.

Definition at line 743 of file FaceCellWave.C.

◆ handleExplicitConnections()

void handleExplicitConnections ( )
protected

Merge data across explicitly provided local connections.

These are usually baffles

Definition at line 844 of file FaceCellWave.C.

◆ operator=()

void operator= ( const FaceCellWave< Type, TrackingData > &  )
protecteddelete

No copy assignment.

◆ allFaceInfo()

UList<Type>& allFaceInfo ( )
inlinenoexcept

Access allFaceInfo.

Definition at line 490 of file FaceCellWave.H.

◆ allCellInfo()

UList<Type>& allCellInfo ( )
inlinenoexcept

Access allCellInfo.

Definition at line 498 of file FaceCellWave.H.

◆ data()

const TrackingData& data ( ) const
inlinenoexcept

Additional data to be passed into container.

Definition at line 506 of file FaceCellWave.H.

Referenced by wallDistAddressing::correct(), MeshWave< Type, TrackingData >::data(), structuredDecomp::decompose(), wallDistAddressing::getValues(), and combine< Type, TrackingData >::operator()().

Here is the caller graph for this function:

◆ setFaceInfo() [1/2]

void setFaceInfo ( const label  facei,
const Type &  faceInfo 
)

Set single initial changed face.

This is a noop if the face had already been visited

Definition at line 303 of file FaceCellWave.C.

Referenced by hexRef8::consistentSlowRefinement().

Here is the caller graph for this function:

◆ setFaceInfo() [2/2]

void setFaceInfo ( const labelUList changedFaces,
const List< Type > &  changedFacesInfo 
)

Set initial changed faces.

Definition at line 327 of file FaceCellWave.C.

◆ faceToCell()

Foam::label faceToCell ( )
virtual

Propagate from face to cell.

Returns
total number of cells (over all processors) changed.

Reimplemented in OppositeFaceCellWave< Type, TrackingData >.

Definition at line 1059 of file FaceCellWave.C.

◆ cellToFace()

Foam::label cellToFace ( )
virtual

Propagate from cell to face.

Returns
total number of faces (over all processors) changed. Note that faces on processor patches are counted twice.

Reimplemented in OppositeFaceCellWave< Type, TrackingData >.

Definition at line 1136 of file FaceCellWave.C.

◆ iterate()

Foam::label iterate ( const label  maxIter)
virtual

Iterate until no changes or maxIter reached.

Returns
the number of iterations taken.

Definition at line 1212 of file FaceCellWave.C.

Referenced by hexRef8::consistentSlowRefinement(), and MeshWave< Type, TrackingData >::iterate().

Here is the caller graph for this function:

Member Data Documentation

◆ explicitConnections_

const labelPairList explicitConnections_
protected

Optional boundary faces that information should travel through.

Definition at line 225 of file FaceCellWave.H.

◆ allFaceInfo_

UList<Type>& allFaceInfo_
protected

Information for all faces.

Definition at line 230 of file FaceCellWave.H.

Referenced by FaceCellWave< Foam::wallPointData< bool > >::allFaceInfo().

◆ allCellInfo_

UList<Type>& allCellInfo_
protected

Information for all cells.

Definition at line 235 of file FaceCellWave.H.

Referenced by FaceCellWave< Foam::wallPointData< bool > >::allCellInfo().

◆ td_

TrackingData& td_
protected

Additional data to be passed into container.

Definition at line 240 of file FaceCellWave.H.

Referenced by FaceCellWave< Foam::wallPointData< bool > >::data().

◆ changedBaffles_

DynamicList<taggedInfoType> changedBaffles_
protected

Definition at line 244 of file FaceCellWave.H.

◆ hasCyclicPatches_

const bool hasCyclicPatches_
protected

Contains cyclics.

Definition at line 249 of file FaceCellWave.H.

◆ hasCyclicAMIPatches_

const bool hasCyclicAMIPatches_
protected

Contains cyclicAMI.

Definition at line 254 of file FaceCellWave.H.

◆ nEvals_

label nEvals_
protected

Number of evaluations.

Definition at line 259 of file FaceCellWave.H.


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