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 &, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, TrackingData &td=defaultTrackingData_)
 
 FaceCellWave (const polyMesh &, const labelList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=defaultTrackingData_)
 Construct from mesh and list of changed faces with the Type. More...
 
 FaceCellWave (const polyMesh &, const labelPairList &explicitConnections, const bool handleCyclicAMI, const labelList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=defaultTrackingData_)
 Construct from mesh and explicitly connected boundary faces. More...
 
 FaceCellWave (const FaceCellWave &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~FaceCellWave ()
 Destructor. More...
 
UList< Type > & allFaceInfo ()
 Access allFaceInfo. More...
 
UList< Type > & allCellInfo ()
 Access allCellInfo. More...
 
const TrackingData & data () const
 Additional data to be passed into container. More...
 
TrackingData & data ()
 Additional data to be passed into container. More...
 
const polyMeshmesh () const
 Access mesh. More...
 
label getUnsetCells () const
 Get number of unvisited cells, i.e. cells that were not (yet) More...
 
label getUnsetFaces () const
 Get number of unvisited faces. More...
 
void setFaceInfo (const labelList &changedFaces, const List< Type > &changedFacesInfo)
 Set initial changed faces. More...
 
virtual label faceToCell ()
 Propagate from face to cell. Returns total number of cells. More...
 
virtual label cellToFace ()
 Propagate from cell to face. Returns total number of faces. More...
 
virtual label iterate (const label maxIter)
 Iterate until no changes or maxIter reached. Returns actual. More...
 
void operator= (const FaceCellWave &)=delete
 Disallow default bitwise assignment. More...
 

Static Public Member Functions

static scalar propagationTol ()
 Access to tolerance. More...
 
static void setPropagationTol (const scalar tol)
 Change tolerance. More...
 

Static Public Attributes

static int defaultTrackingData_ = -1
 Default tracking data to go with default template argument. 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. Updates all. More...
 
bool updateFace (const label facei, const label neighbourCelli, const Type &neighbourInfo, const scalar tol, Type &faceInfo)
 Updates faceInfo with information from neighbour. Updates all. More...
 
bool updateFace (const label facei, const Type &neighbourInfo, const scalar tol, Type &faceInfo)
 Updates faceInfo with information from same face. Updates all. 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 labelList &, const List< Type > &)
 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 transform (const polyPatch &patch, const label nFaces, const labelList &faceLabels, const transformer &transform, List< Type > &faceInfo)
 Transform across an interface. Implementation referred 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 (usually. More...
 

Protected Attributes

const polyMeshmesh_
 Reference to mesh. More...
 
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...
 
PackedBoolList changedFace_
 Has face changed. More...
 
DynamicList< labelchangedFaces_
 List of changed faces. More...
 
PackedBoolList changedCell_
 Has cell changed. More...
 
DynamicList< labelchangedCells_
 
const bool hasCyclicPatches_
 Contains cyclics. More...
 
const bool hasCyclicAMIPatches_
 Contains cyclicAMI. More...
 
label nEvals_
 Number of evaluations. More...
 
label nUnvisitedCells_
 Number of unvisited cells. More...
 
label nUnvisitedFaces_
 Number of unvisited faces. More...
 

Static Protected Attributes

static const scalar geomTol_ = 1e-6
 ... More...
 
static scalar propagationTol_ = 0.01
 ... More...
 

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 76 of file FaceCellWave.H.

Constructor & Destructor Documentation

◆ FaceCellWave() [1/4]

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

◆ FaceCellWave() [2/4]

FaceCellWave ( const polyMesh mesh,
const labelList initialChangedFaces,
const List< Type > &  changedFacesInfo,
UList< Type > &  allFaceInfo,
UList< Type > &  allCellInfo,
const label  maxIter,
TrackingData &  td = defaultTrackingData_ 
)

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)

Definition at line 858 of file FaceCellWave.C.

References Foam::endl(), Foam::exit(), FaceCellWave< Type, TrackingData >::FaceCellWave(), Foam::FatalError, FatalErrorInFunction, and UList< T >::size().

Here is the call graph for this function:

◆ FaceCellWave() [3/4]

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

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)

Definition at line 922 of file FaceCellWave.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and UList< T >::size().

Here is the call graph for this function:

◆ FaceCellWave() [4/4]

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

Disallow default bitwise copy construction.

◆ ~FaceCellWave()

virtual ~FaceCellWave ( )
inlinevirtual

Destructor.

Definition at line 294 of file FaceCellWave.H.

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 55 of file FaceCellWave.C.

References FvWallInfoBase< WallInfo, Derived >::updateCell(), and FaceCellWave< Type, TrackingData >::updateFace().

Here is the call graph for this function:

◆ 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 104 of file FaceCellWave.C.

References FvWallInfoBase< WallInfo, Derived >::updateFace().

Referenced by FaceCellWave< Type, TrackingData >::updateCell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 153 of file FaceCellWave.C.

References FaceCellWave< Type, TrackingData >::checkCyclic(), and FvWallInfoBase< WallInfo, Derived >::updateFace().

Here is the call graph for this function:

◆ checkCyclic()

void checkCyclic ( const polyPatch pPatch) const
protected

Debugging: check info on both sides of cyclic.

Definition at line 200 of file FaceCellWave.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and polyPatch::start().

Referenced by FaceCellWave< Type, TrackingData >::updateFace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasPatch()

bool hasPatch ( ) const
protected

Has cyclic patch?

Definition at line 246 of file FaceCellWave.C.

References forAll, patchi, and FaceCellWave< Type, TrackingData >::setFaceInfo().

Here is the call graph for this function:

◆ mergeFaceInfo()

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

Merge received patch data into global data.

Definition at line 291 of file FaceCellWave.C.

References FaceCellWave< Type, TrackingData >::getChangedPatchFaces(), and polyPatch::start().

Referenced by FaceCellWave< Type, TrackingData >::setFaceInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 325 of file FaceCellWave.C.

References polyPatch::start(), and FaceCellWave< Type, TrackingData >::transform().

Referenced by FaceCellWave< Type, TrackingData >::mergeFaceInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transform()

void transform ( const polyPatch patch,
const label  nFaces,
const labelList faceLabels,
const transformer transform,
List< Type > &  faceInfo 
)
protected

Transform across an interface. Implementation referred to Type.

Definition at line 357 of file FaceCellWave.C.

Referenced by FaceCellWave< Type, TrackingData >::getChangedPatchFaces().

Here is the caller graph for this function:

◆ handleProcPatches()

void handleProcPatches ( )
protected

Merge data from across processor boundaries.

Definition at line 373 of file FaceCellWave.C.

References Foam::endl(), PstreamBuffers::finishedSends(), forAll, patchIdentifier::name(), processorPolyPatch::neighbProcNo(), patchi, Foam::Pout, globalMeshData::processorPatches(), Foam::transform(), and processorPolyPatch::transform().

Here is the call graph for this function:

◆ handleCyclicPatches()

void handleCyclicPatches ( )
protected

Merge data from across cyclics.

Definition at line 475 of file FaceCellWave.C.

References polyPatch::boundaryMesh(), Foam::endl(), forAll, patchIdentifier::name(), cyclicPolyPatch::nbrPatch(), patchi, Foam::Pout, Foam::transform(), and cyclicPolyPatch::transform().

Here is the call graph for this function:

◆ handleAMICyclicPatches()

◆ handleExplicitConnections()

void handleExplicitConnections ( )
protected

Merge data across explicitly provided local connections (usually.

baffles)

Definition at line 737 of file FaceCellWave.C.

References f1, FaceCellWave< Type, TrackingData >::FaceCellWave(), and forAll.

Here is the call graph for this function:

◆ propagationTol()

static scalar propagationTol ( )
inlinestatic

Access to tolerance.

Definition at line 234 of file FaceCellWave.H.

References FaceCellWave< Type, TrackingData >::propagationTol_.

Referenced by FaceCellWave< Type, TrackingData >::handleAMICyclicPatches().

Here is the caller graph for this function:

◆ setPropagationTol()

static void setPropagationTol ( const scalar  tol)
inlinestatic

Change tolerance.

Definition at line 240 of file FaceCellWave.H.

References FaceCellWave< Type, TrackingData >::allCellInfo(), FaceCellWave< Type, TrackingData >::allFaceInfo(), and FaceCellWave< Type, TrackingData >::FaceCellWave().

Here is the call graph for this function:

◆ allFaceInfo()

UList<Type>& allFaceInfo ( )
inline

Access allFaceInfo.

Definition at line 303 of file FaceCellWave.H.

References FaceCellWave< Type, TrackingData >::allFaceInfo_.

Referenced by FaceCellWave< Type, TrackingData >::setPropagationTol().

Here is the caller graph for this function:

◆ allCellInfo()

UList<Type>& allCellInfo ( )
inline

Access allCellInfo.

Definition at line 309 of file FaceCellWave.H.

References FaceCellWave< Type, TrackingData >::allCellInfo_.

Referenced by FaceCellWave< Type, TrackingData >::setPropagationTol().

Here is the caller graph for this function:

◆ data() [1/2]

const TrackingData& data ( ) const
inline

Additional data to be passed into container.

Definition at line 315 of file FaceCellWave.H.

References FaceCellWave< Type, TrackingData >::td_.

Referenced by structuredDecomp::decompose(), and FaceCellWave< Type, TrackingData >::handleAMICyclicPatches().

Here is the caller graph for this function:

◆ data() [2/2]

TrackingData& data ( )
inline

Additional data to be passed into container.

Definition at line 321 of file FaceCellWave.H.

References FaceCellWave< Type, TrackingData >::td_.

◆ mesh()

◆ getUnsetCells()

Foam::label getUnsetCells ( ) const

Get number of unvisited cells, i.e. cells that were not (yet)

reached from walking across mesh. This can happen from

  • not enough iterations done
  • a disconnected mesh
  • a mesh without walls in it

Definition at line 990 of file FaceCellWave.C.

Referenced by FaceCellWave< Type, TrackingData >::mesh().

Here is the caller graph for this function:

◆ getUnsetFaces()

Foam::label getUnsetFaces ( ) const

Get number of unvisited faces.

Definition at line 997 of file FaceCellWave.C.

Referenced by FaceCellWave< Type, TrackingData >::mesh().

Here is the caller graph for this function:

◆ setFaceInfo()

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

Set initial changed faces.

Definition at line 261 of file FaceCellWave.C.

References List< T >::append(), forAll, and FaceCellWave< Type, TrackingData >::mergeFaceInfo().

Referenced by hexRef8::consistentSlowRefinement(), FaceCellWave< Type, TrackingData >::hasPatch(), and FaceCellWave< Type, TrackingData >::mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 1004 of file FaceCellWave.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Pout, and Foam::reduce().

Referenced by FaceCellWave< Type, TrackingData >::mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cellToFace()

Foam::label cellToFace ( )
virtual

Propagate from cell to face. Returns total number of faces.

(over all processors) changed. (Faces on processorpatches are counted double)

Reimplemented in OppositeFaceCellWave< Type, TrackingData >.

Definition at line 1085 of file FaceCellWave.C.

References Foam::abort(), cells, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Pout, and Foam::reduce().

Referenced by FaceCellWave< Type, TrackingData >::mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iterate()

Foam::label iterate ( const label  maxIter)
virtual

Iterate until no changes or maxIter reached. Returns actual.

number of iterations.

Definition at line 1168 of file FaceCellWave.C.

References Foam::endl(), Foam::Info, and Foam::nl.

Referenced by hexRef8::consistentSlowRefinement(), and FaceCellWave< Type, TrackingData >::mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

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

Disallow default bitwise assignment.

Referenced by FaceCellWave< Type, TrackingData >::mesh().

Here is the caller graph for this function:

Member Data Documentation

◆ geomTol_

const Foam::scalar geomTol_ = 1e-6
staticprotected

...

Definition at line 85 of file FaceCellWave.H.

◆ propagationTol_

Foam::scalar propagationTol_ = 0.01
staticprotected

...

Definition at line 88 of file FaceCellWave.H.

Referenced by FaceCellWave< Type, TrackingData >::propagationTol().

◆ mesh_

const polyMesh& mesh_
protected

Reference to mesh.

Definition at line 94 of file FaceCellWave.H.

Referenced by FaceCellWave< Type, TrackingData >::mesh().

◆ explicitConnections_

const labelPairList explicitConnections_
protected

Optional boundary faces that information should travel through.

Definition at line 97 of file FaceCellWave.H.

◆ allFaceInfo_

UList<Type>& allFaceInfo_
protected

Information for all faces.

Definition at line 100 of file FaceCellWave.H.

Referenced by FaceCellWave< Type, TrackingData >::allFaceInfo().

◆ allCellInfo_

UList<Type>& allCellInfo_
protected

Information for all cells.

Definition at line 103 of file FaceCellWave.H.

Referenced by FaceCellWave< Type, TrackingData >::allCellInfo().

◆ td_

TrackingData& td_
protected

Additional data to be passed into container.

Definition at line 106 of file FaceCellWave.H.

Referenced by FaceCellWave< Type, TrackingData >::data().

◆ changedFace_

PackedBoolList changedFace_
protected

Has face changed.

Definition at line 109 of file FaceCellWave.H.

◆ changedFaces_

DynamicList<label> changedFaces_
protected

List of changed faces.

Definition at line 112 of file FaceCellWave.H.

◆ changedCell_

PackedBoolList changedCell_
protected

Has cell changed.

Definition at line 115 of file FaceCellWave.H.

◆ changedCells_

DynamicList<label> changedCells_
protected

Definition at line 118 of file FaceCellWave.H.

◆ hasCyclicPatches_

const bool hasCyclicPatches_
protected

Contains cyclics.

Definition at line 121 of file FaceCellWave.H.

◆ hasCyclicAMIPatches_

const bool hasCyclicAMIPatches_
protected

Contains cyclicAMI.

Definition at line 124 of file FaceCellWave.H.

◆ nEvals_

label nEvals_
protected

Number of evaluations.

Definition at line 127 of file FaceCellWave.H.

◆ nUnvisitedCells_

label nUnvisitedCells_
protected

Number of unvisited cells.

Definition at line 130 of file FaceCellWave.H.

◆ nUnvisitedFaces_

label nUnvisitedFaces_
protected

Number of unvisited faces.

Definition at line 133 of file FaceCellWave.H.

◆ defaultTrackingData_

int defaultTrackingData_ = -1
static

Default tracking data to go with default template argument.

Definition at line 228 of file FaceCellWave.H.


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