FvFaceCellWave< 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 FvFaceCellWave< Type, TrackingData >:
Collaboration diagram for FvFaceCellWave< Type, TrackingData >:

Public Member Functions

 FvFaceCellWave (const fvMesh &mesh, List< Type > &internalFaceInfo, List< List< Type >> &patchFaceInfo, List< Type > &cellInfo, TrackingData &td=defaultTrackingData_)
 
 FvFaceCellWave (const fvMesh &mesh, const List< labelPair > &initialChangedPatchAndFaces, const List< Type > &initialChangedFacesInfo, List< Type > &internalFaceInfo, List< List< Type >> &patchFaceInfo, List< Type > &cellInfo, const label maxIter, TrackingData &td=defaultTrackingData_)
 Construct from mesh and list of changed faces with the Type. More...
 
 FvFaceCellWave (const FvFaceCellWave &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~FvFaceCellWave ()
 Destructor. More...
 
List< Type > & internalFaceInfo ()
 Access internalFaceInfo. More...
 
List< List< Type > > & patchFaceInfo ()
 Access patchFaceInfo. More...
 
List< Type > & cellInfo ()
 Access cellInfo. More...
 
const TrackingData & data () const
 Additional data to be passed into container. More...
 
TrackingData & data ()
 Additional data to be passed into container. More...
 
const fvMeshmesh () const
 Access mesh. More...
 
void setFaceInfo (const List< labelPair > &changedPatchAndFaces, 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 FvFaceCellWave &)=delete
 Disallow default bitwise assignment. More...
 
template<class ListList >
Foam::labelList listListSizes (const ListList &ll)
 

Static Public Member Functions

static scalar propagationTol ()
 Access to tolerance. More...
 
static void setPropagationTol (const scalar tol)
 Change tolerance. More...
 
template<class ListList >
static labelList listListSizes (const ListList &ll)
 ... More...
 
template<class ListList , class Value >
static ListList sizesListList (const labelList &s, const Value &value)
 ... More...
 

Static Public Attributes

static int defaultTrackingData_ = -1
 Default tracking data to go with default template argument. More...
 

Protected Member Functions

const Type & faceInfo (const labelPair &patchAndFacei) const
 ... More...
 
Type & faceInfo (const labelPair &patchAndFacei)
 ... More...
 
bool faceChanged (const labelPair &patchAndFacei) const
 ... More...
 
PackedBoolList::iteratorBase faceChanged (const labelPair &)
 ... More...
 
bool updateCell (const label celli, const labelPair &neighbourPatchAndFacei, const Type &neighbourInfo, const scalar tol, Type &cellInfo)
 Updates cellInfo with information from neighbour. Updates all. More...
 
bool updateFace (const labelPair &patchAndFacei, const label neighbourCelli, const Type &neighbourInfo, const scalar tol, Type &faceInfo)
 Updates faceInfo with information from neighbour. Updates all. More...
 
bool updateFace (const labelPair &patchAndFacei, const Type &neighbourInfo, const scalar tol, Type &faceInfo)
 Updates faceInfo with information from same face. Updates all. More...
 
void checkCyclic (const fvPatch &patch) const
 Debugging: check info on both sides of cyclic. More...
 
template<class PatchType >
bool hasPatch () const
 Has cyclic patch? More...
 
void mergeFaceInfo (const fvPatch &patch, const label nFaces, const labelList &, const List< Type > &)
 Merge received patch data into global data. More...
 
label getChangedPatchFaces (const fvPatch &patch, labelList &changedPatchFaces, List< Type > &changedPatchFacesInfo) const
 Extract info for single patch only. More...
 
void transform (const fvPatch &patch, const label nFaces, const labelList &patchFaces, const transformer &transform, List< Type > &faceInfo)
 Transform across an interface. More...
 
void handleProcPatches ()
 Merge data from across processor boundaries. More...
 
void handleCyclicPatches ()
 Merge data from across cyclics. More...
 

Protected Attributes

const fvMeshmesh_
 Reference to mesh. More...
 
List< Type > & internalFaceInfo_
 Information for internal faces. More...
 
List< List< Type > > & patchFaceInfo_
 Information for patch faces. More...
 
List< Type > & cellInfo_
 Information for all cells. More...
 
TrackingData & td_
 Additional data to be passed into container. More...
 
PackedBoolList internalFaceChanged_
 Has internal face changed? More...
 
List< PackedBoolListpatchFaceChanged_
 Has patch face changed? More...
 
PackedBoolList cellChanged_
 Has cell changed? More...
 
DynamicList< labelPairchangedPatchAndFaces_
 List of changed patch and faces. More...
 
DynamicList< labelchangedCells_
 List of changed cells. More...
 
const bool hasCyclicPatches_
 Contains cyclics. More...
 

Static Protected Attributes

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

Detailed Description

template<class Type, class TrackingData = int>
class Foam::FvFaceCellWave< 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 74 of file FvFaceCellWave.H.

Constructor & Destructor Documentation

◆ FvFaceCellWave() [1/3]

◆ FvFaceCellWave() [2/3]

FvFaceCellWave ( const fvMesh mesh,
const List< labelPair > &  initialChangedPatchAndFaces,
const List< Type > &  initialChangedFacesInfo,
List< Type > &  internalFaceInfo,
List< List< Type >> &  patchFaceInfo,
List< Type > &  cellInfo,
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 592 of file FvFaceCellWave.C.

References FvFaceCellWave< Type, TrackingData >::changedCells_, FvFaceCellWave< Type, TrackingData >::changedPatchAndFaces_, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, FvFaceCellWave< Type, TrackingData >::iterate(), FvFaceCellWave< Type, TrackingData >::setFaceInfo(), and List< T >::size().

Here is the call graph for this function:

◆ FvFaceCellWave() [3/3]

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

Disallow default bitwise copy construction.

◆ ~FvFaceCellWave()

virtual ~FvFaceCellWave ( )
inlinevirtual

Destructor.

Definition at line 279 of file FvFaceCellWave.H.

Member Function Documentation

◆ faceInfo() [1/2]

const Type & faceInfo ( const labelPair patchAndFacei) const
protected

...

Definition at line 85 of file FvFaceCellWave.C.

References Pair< Type >::first(), and Pair< Type >::second().

Here is the call graph for this function:

◆ faceInfo() [2/2]

Type & faceInfo ( const labelPair patchAndFacei)
protected

...

Definition at line 98 of file FvFaceCellWave.C.

References Pair< Type >::first(), and Pair< Type >::second().

Here is the call graph for this function:

◆ faceChanged() [1/2]

bool faceChanged ( const labelPair patchAndFacei) const
protected

...

Definition at line 111 of file FvFaceCellWave.C.

References Pair< Type >::first(), and Pair< Type >::second().

Here is the call graph for this function:

◆ faceChanged() [2/2]

Foam::PackedBoolList::iteratorBase faceChanged ( const labelPair patchAndFacei)
protected

...

Definition at line 126 of file FvFaceCellWave.C.

References Pair< Type >::first(), and Pair< Type >::second().

Here is the call graph for this function:

◆ updateCell()

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

Updates cellInfo with information from neighbour. Updates all.

statistics.

Definition at line 139 of file FvFaceCellWave.C.

References cellInfo::updateCell().

Here is the call graph for this function:

◆ updateFace() [1/2]

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

Updates faceInfo with information from neighbour. Updates all.

statistics.

Definition at line 173 of file FvFaceCellWave.C.

◆ updateFace() [2/2]

bool updateFace ( const labelPair patchAndFacei,
const Type &  neighbourInfo,
const scalar  tol,
Type &  faceInfo 
)
protected

Updates faceInfo with information from same face. Updates all.

statistics.

Definition at line 209 of file FvFaceCellWave.C.

◆ checkCyclic()

void checkCyclic ( const fvPatch patch) const
protected

Debugging: check info on both sides of cyclic.

Definition at line 243 of file FvFaceCellWave.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, fvPatch::index(), and cyclicFvPatch::nbrPatch().

Here is the call graph for this function:

◆ hasPatch()

bool hasPatch
protected

Has cyclic patch?

Definition at line 282 of file FvFaceCellWave.C.

References forAll, and patchi.

◆ mergeFaceInfo()

void mergeFaceInfo ( const fvPatch patch,
const label  nFaces,
const labelList changedPatchFaces,
const List< Type > &  changedPatchFacesInfo 
)
protected

Merge received patch data into global data.

Definition at line 297 of file FvFaceCellWave.C.

References fvPatch::index().

Here is the call graph for this function:

◆ getChangedPatchFaces()

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

Extract info for single patch only.

Definition at line 328 of file FvFaceCellWave.C.

References forAll, and fvPatch::index().

Here is the call graph for this function:

◆ transform()

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

Transform across an interface.

Definition at line 355 of file FvFaceCellWave.C.

References Foam::transform().

Here is the call graph for this function:

◆ handleProcPatches()

void handleProcPatches
protected

Merge data from across processor boundaries.

Definition at line 372 of file FvFaceCellWave.C.

References Foam::endl(), PstreamBuffers::finishedSends(), forAll, fvPatch::name(), processorFvPatch::neighbProcNo(), patchi, Foam::Pout, fvPatch::size(), List< T >::size(), processorFvPatch::transform(), and Foam::transform().

Here is the call graph for this function:

◆ handleCyclicPatches()

void handleCyclicPatches
protected

Merge data from across cyclics.

Definition at line 469 of file FvFaceCellWave.C.

References Foam::endl(), forAll, fvPatch::name(), cyclicFvPatch::nbrPatch(), patchi, Foam::Pout, fvPatch::size(), cyclicFvPatch::transform(), and Foam::transform().

Here is the call graph for this function:

◆ propagationTol()

static scalar propagationTol ( )
inlinestatic

Access to tolerance.

Definition at line 226 of file FvFaceCellWave.H.

References FvFaceCellWave< Type, TrackingData >::propagationTol_.

◆ setPropagationTol()

static void setPropagationTol ( const scalar  tol)
inlinestatic

Change tolerance.

Definition at line 232 of file FvFaceCellWave.H.

References FvFaceCellWave< Type, TrackingData >::propagationTol_.

◆ listListSizes() [1/2]

static labelList listListSizes ( const ListList &  ll)
static

...

Referenced by FvFaceCellWave< Type, TrackingData >::FvFaceCellWave().

Here is the caller graph for this function:

◆ sizesListList()

ListList sizesListList ( const labelList s,
const Value &  value 
)
static

...

Definition at line 67 of file FvFaceCellWave.C.

References forAll, and s().

Here is the call graph for this function:

◆ internalFaceInfo()

List<Type>& internalFaceInfo ( )
inline

Access internalFaceInfo.

Definition at line 288 of file FvFaceCellWave.H.

References FvFaceCellWave< Type, TrackingData >::internalFaceInfo_.

Referenced by FvFaceCellWave< Type, TrackingData >::FvFaceCellWave().

Here is the caller graph for this function:

◆ patchFaceInfo()

List<List<Type> >& patchFaceInfo ( )
inline

Access patchFaceInfo.

Definition at line 294 of file FvFaceCellWave.H.

References FvFaceCellWave< Type, TrackingData >::patchFaceInfo_.

Referenced by FvFaceCellWave< Type, TrackingData >::FvFaceCellWave().

Here is the caller graph for this function:

◆ cellInfo()

List<Type>& cellInfo ( )
inline

Access cellInfo.

Definition at line 300 of file FvFaceCellWave.H.

References FvFaceCellWave< Type, TrackingData >::cellInfo_.

◆ data() [1/2]

const TrackingData& data ( ) const
inline

Additional data to be passed into container.

Definition at line 306 of file FvFaceCellWave.H.

References FvFaceCellWave< Type, TrackingData >::td_.

◆ data() [2/2]

TrackingData& data ( )
inline

Additional data to be passed into container.

Definition at line 312 of file FvFaceCellWave.H.

References FvFaceCellWave< Type, TrackingData >::td_.

◆ mesh()

const fvMesh& mesh ( ) const
inline

Access mesh.

Definition at line 318 of file FvFaceCellWave.H.

References FvFaceCellWave< Type, TrackingData >::mesh_.

◆ setFaceInfo()

void setFaceInfo ( const List< labelPair > &  changedPatchAndFaces,
const List< Type > &  changedFacesInfo 
)

Set initial changed faces.

Definition at line 635 of file FvFaceCellWave.C.

References List< T >::append(), and forAll.

Referenced by FvFaceCellWave< Type, TrackingData >::FvFaceCellWave().

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

◆ faceToCell()

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

(over all processors) changed.

Definition at line 659 of file FvFaceCellWave.C.

References Foam::abort(), List< T >::clear(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Pair< Type >::first(), forAll, patchi, Foam::Pout, Foam::returnReduce(), and Pair< Type >::second().

Here is the call graph for this function:

◆ cellToFace()

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

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

Definition at line 739 of file FvFaceCellWave.C.

References Foam::abort(), cells, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::parRun(), patches, Foam::Pout, Foam::returnReduce(), and UList< T >::shallowCopy().

Here is the call 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 826 of file FvFaceCellWave.C.

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

Referenced by FvFaceCellWave< Type, TrackingData >::FvFaceCellWave().

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

◆ operator=()

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

Disallow default bitwise assignment.

◆ listListSizes() [2/2]

Foam::labelList listListSizes ( const ListList &  ll)

Definition at line 51 of file FvFaceCellWave.C.

References forAll, and s().

Here is the call graph for this function:

Member Data Documentation

◆ geomTol_

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

...

Definition at line 83 of file FvFaceCellWave.H.

◆ propagationTol_

Foam::scalar propagationTol_ = 1e-2
staticprotected

◆ mesh_

const fvMesh& mesh_
protected

◆ internalFaceInfo_

List<Type>& internalFaceInfo_
protected

Information for internal faces.

Definition at line 95 of file FvFaceCellWave.H.

Referenced by FvFaceCellWave< Type, TrackingData >::internalFaceInfo().

◆ patchFaceInfo_

List<List<Type> >& patchFaceInfo_
protected

Information for patch faces.

Definition at line 98 of file FvFaceCellWave.H.

Referenced by FvFaceCellWave< Type, TrackingData >::patchFaceInfo().

◆ cellInfo_

List<Type>& cellInfo_
protected

Information for all cells.

Definition at line 101 of file FvFaceCellWave.H.

Referenced by FvFaceCellWave< Type, TrackingData >::cellInfo().

◆ td_

TrackingData& td_
protected

Additional data to be passed into container.

Definition at line 104 of file FvFaceCellWave.H.

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

◆ internalFaceChanged_

PackedBoolList internalFaceChanged_
protected

Has internal face changed?

Definition at line 107 of file FvFaceCellWave.H.

◆ patchFaceChanged_

List<PackedBoolList> patchFaceChanged_
protected

Has patch face changed?

Definition at line 110 of file FvFaceCellWave.H.

◆ cellChanged_

PackedBoolList cellChanged_
protected

Has cell changed?

Definition at line 113 of file FvFaceCellWave.H.

◆ changedPatchAndFaces_

DynamicList<labelPair> changedPatchAndFaces_
protected

List of changed patch and faces.

Definition at line 116 of file FvFaceCellWave.H.

Referenced by FvFaceCellWave< Type, TrackingData >::FvFaceCellWave().

◆ changedCells_

DynamicList<label> changedCells_
protected

List of changed cells.

Definition at line 119 of file FvFaceCellWave.H.

Referenced by FvFaceCellWave< Type, TrackingData >::FvFaceCellWave().

◆ hasCyclicPatches_

const bool hasCyclicPatches_
protected

Contains cyclics.

Definition at line 122 of file FvFaceCellWave.H.

◆ defaultTrackingData_

int defaultTrackingData_ = -1
static

Default tracking data to go with default template argument.

Definition at line 220 of file FvFaceCellWave.H.


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