Wave propagation of information through grid. Every iteration information goes through one layer of cells. Templated on information that is transferred. More...
Public Member Functions | |
FaceCellWave (const polyMesh &mesh, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, TrackingData &td=dummyTrackData_) | |
FaceCellWave (const polyMesh &mesh, const labelUList &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 &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=dummyTrackData_) | |
Construct from mesh and explicitly connected boundary faces. More... | |
virtual | ~FaceCellWave ()=default |
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... | |
const polyMesh & | mesh () const |
Access mesh. More... | |
label | nUnvisitedCells () const |
label | nUnvisitedFaces () const |
Get number of unvisited faces. 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... | |
Static Public Member Functions | |
static scalar | propagationTol () |
Access to tolerance. More... | |
static void | setPropagationTol (const scalar tol) |
Change tolerance. 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 polyMesh & | mesh_ |
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... | |
bitSet | changedFace_ |
Has face changed. More... | |
bitSet | changedCell_ |
Has cell changed. More... | |
DynamicList< label > | changedFaces_ |
List of changed faces. More... | |
DynamicList< label > | changedCells_ |
DynamicList< taggedInfoType > | changedBaffles_ |
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 Protected Attributes | |
static const scalar | geomTol_ = 1e-6 |
static scalar | propagationTol_ = 0.01 |
static int | dummyTrackData_ = 12345 |
Default trackdata value to satisfy default template argument. More... | |
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.
Definition at line 78 of file FaceCellWave.H.
|
protected |
Information tagged with a source or destination id.
With std::pair as lightweight, movable container.
Definition at line 86 of file FaceCellWave.H.
|
protecteddelete |
No copy construct.
FaceCellWave | ( | const polyMesh & | mesh, |
UList< Type > & | allFaceInfo, | ||
UList< Type > & | allCellInfo, | ||
TrackingData & | td = dummyTrackData_ |
||
) |
Construct from mesh. Use setFaceInfo and iterate() to do actual calculation.
Definition at line 882 of file FaceCellWave.C.
References FaceCellWave< Type, TrackingData >::allCellInfo(), FaceCellWave< Type, TrackingData >::allFaceInfo(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, FaceCellWave< Type, TrackingData >::mesh_, primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, Foam::returnReduce(), and UList< T >::size().
FaceCellWave | ( | const polyMesh & | mesh, |
const labelUList & | 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 or negative). 0 initializes, -1 does not
Definition at line 927 of file FaceCellWave.C.
References FaceCellWave< Type, TrackingData >::allCellInfo(), FaceCellWave< Type, TrackingData >::allFaceInfo(), FaceCellWave< Type, TrackingData >::changedCells_, FaceCellWave< Type, TrackingData >::changedFaces_, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, FaceCellWave< Type, TrackingData >::iterate(), FaceCellWave< Type, TrackingData >::mesh_, primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, FaceCellWave< Type, TrackingData >::setFaceInfo(), and UList< T >::size().
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 = 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 991 of file FaceCellWave.C.
References FaceCellWave< Type, TrackingData >::allCellInfo(), FaceCellWave< Type, TrackingData >::allFaceInfo(), FaceCellWave< Type, TrackingData >::changedCells_, FaceCellWave< Type, TrackingData >::changedFaces_, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, FaceCellWave< Type, TrackingData >::iterate(), FaceCellWave< Type, TrackingData >::mesh_, primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, FaceCellWave< Type, TrackingData >::setFaceInfo(), and UList< T >::size().
|
virtualdefault |
Destructor.
|
protected |
Updates cellInfo with information from neighbour.
Updates all statistics.
Definition at line 114 of file FaceCellWave.C.
References cellInfo::updateCell(), and cellInfo::valid().
|
protected |
Updates faceInfo with information from neighbour.
Updates all statistics.
Definition at line 162 of file FaceCellWave.C.
|
protected |
Updates faceInfo with information from same face.
Updates all statistics.
Definition at line 210 of file FaceCellWave.C.
|
protected |
Debugging: check info on both sides of cyclic.
Definition at line 256 of file FaceCellWave.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, cyclicPolyPatch::neighbPatch(), and polyPatch::start().
|
protected |
|
protected |
Merge received patch data into global data.
Definition at line 370 of file FaceCellWave.C.
|
protected |
Extract info for single patch only.
Definition at line 404 of file FaceCellWave.C.
References nFaces().
|
protected |
Handle leaving domain. Implementation referred to Type.
Definition at line 436 of file FaceCellWave.C.
References nFaces().
|
protected |
Handle leaving domain. Implementation referred to Type.
Definition at line 459 of file FaceCellWave.C.
References nFaces().
|
staticprotected |
Offset face labels by constant value.
Definition at line 511 of file FaceCellWave.C.
References nFaces().
|
protected |
Apply transformation to Type.
Definition at line 482 of file FaceCellWave.C.
References nFaces(), UList< T >::size(), and T.
|
protected |
Merge data from across processor boundaries.
Transfer changed faces from neighbouring processors.
Definition at line 530 of file FaceCellWave.C.
References Foam::endl(), PstreamBuffers::finishedSends(), coupledPolyPatch::forwardT(), patchIdentifier::name(), processorPolyPatch::neighbProcNo(), coupledPolyPatch::parallel(), Foam::Pout, globalMeshData::processorPatches(), UList< T >::size(), and Foam::transform().
|
protected |
Merge data from across cyclics.
Transfer changed faces across cyclic halves
Definition at line 646 of file FaceCellWave.C.
References Foam::endl(), OSstream::name(), cyclicPolyPatch::neighbPatch(), Foam::Pout, and Foam::transform().
|
protected |
Merge data from across AMI cyclics.
Definition at line 730 of file FaceCellWave.C.
References polyPatch::faceCentres(), forAll, cyclicPolyPatch::neighbPatch(), coupledPolyPatch::parallel(), polyPatch::patchSlice(), coupledPolyPatch::separated(), UList< T >::size(), and Foam::transform().
|
protected |
Merge data across explicitly provided local connections.
These are usually baffles
Definition at line 830 of file FaceCellWave.C.
|
protecteddelete |
No copy assignment.
|
inlinestatic |
Access to tolerance.
Definition at line 271 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::propagationTol_.
Referenced by hexRef8::consistentSlowRefinement2(), and combine< Type, TrackingData >::operator()().
|
inlinestatic |
Change tolerance.
Definition at line 277 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::propagationTol_.
|
inline |
Access allFaceInfo.
Definition at line 336 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::allFaceInfo_.
Referenced by FaceCellWave< Type, TrackingData >::FaceCellWave().
|
inline |
Access allCellInfo.
Definition at line 342 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::allCellInfo_.
Referenced by FaceCellWave< Type, TrackingData >::FaceCellWave().
|
inline |
Additional data to be passed into container.
Definition at line 348 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::td_.
Referenced by MeshWave< Type, TrackingData >::data(), structuredDecomp::decompose(), decompositionMethod::decompose(), and combine< Type, TrackingData >::operator()().
|
inline |
Access mesh.
Definition at line 354 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::mesh_.
Referenced by combine< Type, TrackingData >::operator()().
Foam::label nUnvisitedCells |
Get number of unvisited cells, i.e. cells that were not (yet) reached from walking across mesh.
This can happen from
Definition at line 1060 of file FaceCellWave.C.
Referenced by structuredRenumber::renumber().
Foam::label nUnvisitedFaces |
Get number of unvisited faces.
Definition at line 1067 of file FaceCellWave.C.
Referenced by MeshWave< Type, TrackingData >::nUnvisitedFaces().
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 317 of file FaceCellWave.C.
Referenced by hexRef8::consistentSlowRefinement(), and FaceCellWave< Type, TrackingData >::FaceCellWave().
void setFaceInfo | ( | const labelUList & | changedFaces, |
const List< Type > & | changedFacesInfo | ||
) |
Set initial changed faces.
Definition at line 341 of file FaceCellWave.C.
References forAll, and List< T >::set().
|
virtual |
Propagate from face to cell.
Reimplemented in OppositeFaceCellWave< Type, TrackingData >.
Definition at line 1074 of file FaceCellWave.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::Pout, and Foam::returnReduce().
|
virtual |
Propagate from cell to face.
Reimplemented in OppositeFaceCellWave< Type, TrackingData >.
Definition at line 1151 of file FaceCellWave.C.
References Foam::abort(), cells, Foam::endl(), Foam::FatalError, FatalErrorInFunction, UPstream::parRun(), Foam::Pout, and Foam::returnReduce().
|
virtual |
Iterate until no changes or maxIter reached.
Definition at line 1227 of file FaceCellWave.C.
References Foam::endl(), Foam::Info, nFaces(), Foam::nl, and UPstream::parRun().
Referenced by hexRef8::consistentSlowRefinement(), FaceCellWave< Type, TrackingData >::FaceCellWave(), OppositeFaceCellWave< Type, TrackingData >::OppositeFaceCellWave(), and structuredRenumber::renumber().
|
staticprotected |
Definition at line 91 of file FaceCellWave.H.
|
staticprotected |
Definition at line 92 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::propagationTol(), and FaceCellWave< Type, TrackingData >::setPropagationTol().
|
staticprotected |
Default trackdata value to satisfy default template argument.
Definition at line 95 of file FaceCellWave.H.
|
protected |
Reference to mesh.
Definition at line 101 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::FaceCellWave(), and FaceCellWave< Type, TrackingData >::mesh().
|
protected |
Optional boundary faces that information should travel through.
Definition at line 104 of file FaceCellWave.H.
|
protected |
Information for all faces.
Definition at line 107 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::allFaceInfo().
|
protected |
Information for all cells.
Definition at line 110 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::allCellInfo().
|
protected |
Additional data to be passed into container.
Definition at line 113 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::data().
|
protected |
Has face changed.
Definition at line 116 of file FaceCellWave.H.
|
protected |
Has cell changed.
Definition at line 119 of file FaceCellWave.H.
|
protected |
List of changed faces.
Definition at line 122 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::FaceCellWave(), and OppositeFaceCellWave< Type, TrackingData >::OppositeFaceCellWave().
|
protected |
Definition at line 125 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::FaceCellWave(), and OppositeFaceCellWave< Type, TrackingData >::OppositeFaceCellWave().
|
protected |
Definition at line 129 of file FaceCellWave.H.
|
protected |
Contains cyclics.
Definition at line 132 of file FaceCellWave.H.
|
protected |
Contains cyclicAMI.
Definition at line 135 of file FaceCellWave.H.
|
protected |
Number of evaluations.
Definition at line 138 of file FaceCellWave.H.
|
protected |
Number of unvisited cells/faces.
Definition at line 141 of file FaceCellWave.H.
|
protected |
Definition at line 142 of file FaceCellWave.H.