Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
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 >:
Inheritance graph
[legend]
Collaboration diagram for FaceCellWave< Type, TrackingData >:
Collaboration graph
[legend]

Public Member Functions

 FaceCellWave (const polyMesh &, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, TrackingData &td=dummyTrackData_)
 
 FaceCellWave (const polyMesh &, const labelList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=dummyTrackData_)
 Construct from mesh and list of changed faces with the Type. More...
 
 FaceCellWave (const polyMesh &, const List< labelPair > &explicitConnections, const bool handleCyclicAMI, const labelList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=dummyTrackData_)
 Construct from mesh and explicitly connected boundary faces. 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...
 
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...
 
label faceToCell ()
 Propagate from face to cell. Returns total number of cells. More...
 
label cellToFace ()
 Propagate from cell to face. Returns total number of faces. More...
 
label iterate (const label maxIter)
 Iterate until no changes or maxIter reached. Returns actual. More...
 

Static Public Member Functions

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

Private Member Functions

 FaceCellWave (const FaceCellWave &)
 Disallow default bitwise copy construct. More...
 
void operator= (const FaceCellWave &)
 Disallow default bitwise assignment. More...
 
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 leaveDomain (const polyPatch &patch, const label nFaces, const labelList &faceLabels, List< Type > &faceInfo) const
 Handle leaving domain. Implementation referred to Type. More...
 
void enterDomain (const polyPatch &patch, const label nFaces, const labelList &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 (usually. More...
 

Static Private Member Functions

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

Private Attributes

const polyMeshmesh_
 Reference to mesh. More...
 
const List< labelPairexplicitConnections_
 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...
 
boolList changedFace_
 Has face changed. More...
 
labelList changedFaces_
 List of changed faces. More...
 
label nChangedFaces_
 Number of changed faces. More...
 
boolList changedCell_
 
labelList changedCells_
 
label nChangedCells_
 
const bool hasCyclicPatches_
 Contains cyclics. More...
 
const bool hasCyclicAMIPatches_
 Contains cyclicAMI. More...
 
label nEvals_
 Number of evaluations. More...
 
label nUnvisitedCells_
 Number of unvisited cells/faces. More...
 
label nUnvisitedFaces_
 

Static Private Attributes

static const scalar geomTol_ = 1e-6
 
static scalar propagationTol_ = 0.01
 
static int dummyTrackData_ = 12345
 Used as default trackdata value to satisfy default template. 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 75 of file FaceCellWave.H.

Constructor & Destructor Documentation

◆ FaceCellWave() [1/4]

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

Disallow default bitwise copy construct.

◆ FaceCellWave() [2/4]

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

Definition at line 883 of file FaceCellWave.C.

◆ FaceCellWave() [3/4]

FaceCellWave ( const polyMesh mesh,
const labelList initialChangedFaces,
const List< Type > &  changedFacesInfo,
UList< Type > &  allFaceInfo,
UList< Type > &  allCellInfo,
const label  maxIter,
TrackingData &  td = 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)

Definition at line 932 of file FaceCellWave.C.

◆ FaceCellWave() [4/4]

FaceCellWave ( const polyMesh mesh,
const List< labelPair > &  explicitConnections,
const bool  handleCyclicAMI,
const labelList initialChangedFaces,
const List< Type > &  changedFacesInfo,
UList< Type > &  allFaceInfo,
UList< Type > &  allCellInfo,
const label  maxIter,
TrackingData &  td = 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)

Definition at line 1000 of file FaceCellWave.C.

Member Function Documentation

◆ operator=()

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

Disallow default bitwise assignment.

◆ updateCell()

bool updateCell ( const label  cellI,
const label  neighbourFaceI,
const Type &  neighbourInfo,
const scalar  tol,
Type &  cellInfo 
)
private

Updates cellInfo with information from neighbour. Updates all.

statistics.

Definition at line 116 of file FaceCellWave.C.

◆ updateFace() [1/2]

bool updateFace ( const label  faceI,
const label  neighbourCellI,
const Type &  neighbourInfo,
const scalar  tol,
Type &  faceInfo 
)
private

Updates faceInfo with information from neighbour. Updates all.

statistics.

Definition at line 164 of file FaceCellWave.C.

◆ updateFace() [2/2]

bool updateFace ( const label  faceI,
const Type &  neighbourInfo,
const scalar  tol,
Type &  faceInfo 
)
private

Updates faceInfo with information from same face. Updates all.

statistics.

Definition at line 212 of file FaceCellWave.C.

◆ checkCyclic()

void checkCyclic ( const polyPatch pPatch) const
private

Debugging: check info on both sides of cyclic.

Definition at line 254 of file FaceCellWave.C.

◆ hasPatch()

bool hasPatch
private

Has cyclic patch?

Definition at line 299 of file FaceCellWave.C.

◆ mergeFaceInfo()

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

Merge received patch data into global data.

Definition at line 346 of file FaceCellWave.C.

◆ getChangedPatchFaces()

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

Extract info for single patch only.

Definition at line 381 of file FaceCellWave.C.

◆ leaveDomain()

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

Handle leaving domain. Implementation referred to Type.

Definition at line 411 of file FaceCellWave.C.

◆ enterDomain()

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

Handle leaving domain. Implementation referred to Type.

Definition at line 433 of file FaceCellWave.C.

◆ offset()

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

Offset face labels by constant value.

Definition at line 483 of file FaceCellWave.C.

◆ transform()

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

Apply transformation to Type.

Definition at line 455 of file FaceCellWave.C.

◆ handleProcPatches()

void handleProcPatches
private

Merge data from across processor boundaries.

Definition at line 499 of file FaceCellWave.C.

◆ handleCyclicPatches()

void handleCyclicPatches
private

Merge data from across cyclics.

Definition at line 618 of file FaceCellWave.C.

◆ handleAMICyclicPatches()

void handleAMICyclicPatches
private

Merge data from across AMI cyclics.

Definition at line 703 of file FaceCellWave.C.

◆ handleExplicitConnections()

void handleExplicitConnections
private

Merge data across explicitly provided local connections (usually.

baffles)

Definition at line 806 of file FaceCellWave.C.

◆ propagationTol()

static scalar propagationTol ( )
inlinestatic

Access to tolerance.

Definition at line 258 of file FaceCellWave.H.

Referenced by hexRef8::consistentSlowRefinement2().

Here is the caller graph for this function:

◆ setPropagationTol()

static void setPropagationTol ( const scalar  tol)
inlinestatic

Change tolerance.

Definition at line 264 of file FaceCellWave.H.

◆ allFaceInfo()

UList<Type>& allFaceInfo ( )
inline

Access allFaceInfo.

Definition at line 319 of file FaceCellWave.H.

◆ allCellInfo()

UList<Type>& allCellInfo ( )
inline

Access allCellInfo.

Definition at line 325 of file FaceCellWave.H.

◆ data()

const TrackingData& data ( ) const
inline

◆ mesh()

const polyMesh& mesh ( ) const
inline

Access mesh.

Definition at line 337 of file FaceCellWave.H.

◆ getUnsetCells()

Foam::label getUnsetCells

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

◆ getUnsetFaces()

Foam::label getUnsetFaces

Get number of unvisited faces.

Definition at line 1078 of file FaceCellWave.C.

◆ setFaceInfo()

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

Set initial changed faces.

Definition at line 315 of file FaceCellWave.C.

Referenced by hexRef8::consistentSlowRefinement().

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

◆ cellToFace()

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

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

Definition at line 1172 of file FaceCellWave.C.

◆ iterate()

Foam::label iterate ( const label  maxIter)

Iterate until no changes or maxIter reached. Returns actual.

number of iterations.

Definition at line 1258 of file FaceCellWave.C.

Referenced by hexRef8::consistentSlowRefinement().

Here is the caller graph for this function:

Field Documentation

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 82 of file FaceCellWave.H.

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

◆ explicitConnections_

const List<labelPair> explicitConnections_
private

Optional boundary faces that information should travel through.

Definition at line 85 of file FaceCellWave.H.

◆ allFaceInfo_

UList<Type>& allFaceInfo_
private

Information for all faces.

Definition at line 88 of file FaceCellWave.H.

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

◆ allCellInfo_

UList<Type>& allCellInfo_
private

Information for all cells.

Definition at line 91 of file FaceCellWave.H.

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

◆ td_

TrackingData& td_
private

Additional data to be passed into container.

Definition at line 94 of file FaceCellWave.H.

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

◆ changedFace_

boolList changedFace_
private

Has face changed.

Definition at line 97 of file FaceCellWave.H.

◆ changedFaces_

labelList changedFaces_
private

List of changed faces.

Definition at line 100 of file FaceCellWave.H.

◆ nChangedFaces_

label nChangedFaces_
private

Number of changed faces.

Definition at line 103 of file FaceCellWave.H.

◆ changedCell_

boolList changedCell_
private

Definition at line 106 of file FaceCellWave.H.

◆ changedCells_

labelList changedCells_
private

Definition at line 107 of file FaceCellWave.H.

◆ nChangedCells_

label nChangedCells_
private

Definition at line 108 of file FaceCellWave.H.

◆ hasCyclicPatches_

const bool hasCyclicPatches_
private

Contains cyclics.

Definition at line 111 of file FaceCellWave.H.

◆ hasCyclicAMIPatches_

const bool hasCyclicAMIPatches_
private

Contains cyclicAMI.

Definition at line 114 of file FaceCellWave.H.

◆ nEvals_

label nEvals_
private

Number of evaluations.

Definition at line 117 of file FaceCellWave.H.

◆ nUnvisitedCells_

label nUnvisitedCells_
private

Number of unvisited cells/faces.

Definition at line 120 of file FaceCellWave.H.

◆ nUnvisitedFaces_

label nUnvisitedFaces_
private

Definition at line 121 of file FaceCellWave.H.

◆ geomTol_

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

Definition at line 245 of file FaceCellWave.H.

◆ propagationTol_

Foam::scalar propagationTol_ = 0.01
staticprivate

◆ dummyTrackData_

int dummyTrackData_ = 12345
staticprivate

Used as default trackdata value to satisfy default template.

argument.

Definition at line 250 of file FaceCellWave.H.


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