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 &, 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 labelPairList &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... | |
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... | |
const polyMesh & | mesh () 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... | |
Static Public Member Functions | |
static scalar | propagationTol () |
Access to tolerance. More... | |
static void | setPropagationTol (const scalar tol) |
Change tolerance. 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 | 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 | transform (const vectorTensorTransform &trans, 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 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... | |
PackedBoolList | changedFace_ |
Has face changed. More... | |
DynamicList< label > | changedFaces_ |
List of changed faces. More... | |
PackedBoolList | changedCell_ |
Has cell changed. More... | |
DynamicList< label > | changedCells_ |
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 |
Used as default trackdata value to satisfy default template. 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 76 of file FaceCellWave.H.
FaceCellWave | ( | const polyMesh & | mesh, |
UList< Type > & | allFaceInfo, | ||
UList< Type > & | allCellInfo, | ||
TrackingData & | td = dummyTrackData_ |
||
) |
Definition at line 946 of file FaceCellWave.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and UList< T >::size().
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 991 of file FaceCellWave.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and UList< T >::size().
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 = 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 1055 of file FaceCellWave.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and UList< T >::size().
|
inlinevirtual |
Destructor.
Definition at line 325 of file FaceCellWave.H.
|
protected |
Updates cellInfo with information from neighbour. Updates all.
statistics.
Definition at line 111 of file FaceCellWave.C.
References FaceCellWave< Type, TrackingData >::updateFace().
Referenced by combine< Type, TrackingData >::operator()().
|
protected |
Updates faceInfo with information from neighbour. Updates all.
statistics.
Definition at line 160 of file FaceCellWave.C.
Referenced by FaceCellWave< Type, TrackingData >::updateCell().
|
protected |
Updates faceInfo with information from same face. Updates all.
statistics.
Definition at line 209 of file FaceCellWave.C.
References FaceCellWave< Type, TrackingData >::checkCyclic().
|
protected |
Debugging: check info on both sides of cyclic.
Definition at line 256 of file FaceCellWave.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and polyPatch::start().
Referenced by FaceCellWave< Type, TrackingData >::updateFace().
|
protected |
Has cyclic patch?
Definition at line 302 of file FaceCellWave.C.
References forAll, patchi, and FaceCellWave< Type, TrackingData >::setFaceInfo().
|
protected |
Merge received patch data into global data.
Definition at line 347 of file FaceCellWave.C.
References FaceCellWave< Type, TrackingData >::getChangedPatchFaces(), and polyPatch::start().
Referenced by FaceCellWave< Type, TrackingData >::setFaceInfo().
|
protected |
Extract info for single patch only.
Definition at line 381 of file FaceCellWave.C.
References FaceCellWave< Type, TrackingData >::leaveDomain(), and polyPatch::start().
Referenced by FaceCellWave< Type, TrackingData >::mergeFaceInfo().
|
protected |
Handle leaving domain. Implementation referred to Type.
Definition at line 413 of file FaceCellWave.C.
References FaceCellWave< Type, TrackingData >::enterDomain(), and polyPatch::start().
Referenced by FaceCellWave< Type, TrackingData >::getChangedPatchFaces().
|
protected |
Handle leaving domain. Implementation referred to Type.
Definition at line 436 of file FaceCellWave.C.
References polyPatch::start(), and FaceCellWave< Type, TrackingData >::transform().
Referenced by FaceCellWave< Type, TrackingData >::leaveDomain().
|
staticprotected |
Offset face labels by constant value.
Definition at line 508 of file FaceCellWave.C.
Referenced by FaceCellWave< Type, TrackingData >::transform().
|
protected |
Apply transformation to Type.
Definition at line 459 of file FaceCellWave.C.
References List< T >::size(), and Foam::T().
Referenced by FaceCellWave< Type, TrackingData >::enterDomain().
|
protected |
Apply transformation to Type.
Definition at line 488 of file FaceCellWave.C.
References vectorTensorTransform::hasR(), FaceCellWave< Type, TrackingData >::offset(), and vectorTensorTransform::R().
|
protected |
Merge data from across processor boundaries.
Definition at line 526 of file FaceCellWave.C.
References Foam::endl(), PstreamBuffers::finishedSends(), forAll, coupledPolyPatch::forwardT(), patchIdentifier::name(), processorPolyPatch::neighbProcNo(), UPstream::nonBlocking, coupledPolyPatch::parallel(), patchi, Foam::Pout, globalMeshData::processorPatches(), List< T >::size(), and Foam::transform().
|
protected |
Merge data from across cyclics.
Definition at line 646 of file FaceCellWave.C.
References polyPatch::boundaryMesh(), Foam::endl(), forAll, coupledPolyPatch::forwardT(), patchIdentifier::name(), coupledPolyPatch::parallel(), patchi, Foam::Pout, and Foam::transform().
|
protected |
Merge data from across AMI cyclics.
Definition at line 732 of file FaceCellWave.C.
References cyclicAMIPolyPatch::AMIs(), cyclicAMIPolyPatch::AMITransforms(), cyclicAMIPolyPatch::applyLowWeightCorrection(), polyPatch::boundaryMesh(), polyPatch::faceCentres(), forAll, coupledPolyPatch::forwardT(), cyclicAMIPolyPatch::neighbPatch(), cyclicAMIPolyPatch::owner(), coupledPolyPatch::parallel(), patchi, polyPatch::patchInternalList(), polyPatch::patchSlice(), coupledPolyPatch::separated(), List< T >::size(), polyPatch::start(), and Foam::transform().
|
protected |
Merge data across explicitly provided local connections (usually.
baffles)
Definition at line 870 of file FaceCellWave.C.
|
inlinestatic |
Access to tolerance.
Definition at line 268 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::propagationTol_.
Referenced by combine< Type, TrackingData >::operator()().
|
inlinestatic |
Change tolerance.
Definition at line 274 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::allCellInfo(), and FaceCellWave< Type, TrackingData >::allFaceInfo().
|
inline |
Access allFaceInfo.
Definition at line 334 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::allFaceInfo_.
Referenced by FaceCellWave< Type, TrackingData >::setPropagationTol().
|
inline |
Access allCellInfo.
Definition at line 340 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::allCellInfo_.
Referenced by FaceCellWave< Type, TrackingData >::setPropagationTol().
|
inline |
Additional data to be passed into container.
Definition at line 346 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::td_.
Referenced by MeshWave< Type, TrackingData >::data(), structuredDecomp::decompose(), combine< Type, TrackingData >::operator()(), and Foam::fvc::sweep().
|
inline |
Access mesh.
Definition at line 352 of file FaceCellWave.H.
References FaceCellWave< Type, TrackingData >::cellToFace(), FaceCellWave< Type, TrackingData >::faceToCell(), FaceCellWave< Type, TrackingData >::getUnsetCells(), FaceCellWave< Type, TrackingData >::getUnsetFaces(), FaceCellWave< Type, TrackingData >::iterate(), FaceCellWave< Type, TrackingData >::mesh_, and FaceCellWave< Type, TrackingData >::setFaceInfo().
Referenced by combine< Type, TrackingData >::operator()().
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
Definition at line 1123 of file FaceCellWave.C.
Referenced by MeshWave< Type, TrackingData >::data(), and FaceCellWave< Type, TrackingData >::mesh().
Foam::label getUnsetFaces | ( | ) | const |
Get number of unvisited faces.
Definition at line 1130 of file FaceCellWave.C.
Referenced by MeshWave< Type, TrackingData >::getUnsetFaces(), and FaceCellWave< Type, TrackingData >::mesh().
Set initial changed faces.
Definition at line 317 of file FaceCellWave.C.
References List< T >::append(), forAll, and FaceCellWave< Type, TrackingData >::mergeFaceInfo().
Referenced by hexRef8::consistentSlowRefinement(), FaceCellWave< Type, TrackingData >::hasPatch(), FaceCellWave< Type, TrackingData >::mesh(), Foam::fvc::spread(), and Foam::fvc::sweep().
|
virtual |
Propagate from face to cell. Returns total number of cells.
(over all processors) changed.
Reimplemented in OppositeFaceCellWave< Type, TrackingData >.
Definition at line 1137 of file FaceCellWave.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Pout, and Foam::reduce().
Referenced by FaceCellWave< Type, TrackingData >::mesh().
|
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 1218 of file FaceCellWave.C.
References Foam::abort(), cells, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::parRun(), Foam::Pout, and Foam::reduce().
Referenced by FaceCellWave< Type, TrackingData >::mesh().
|
virtual |
Iterate until no changes or maxIter reached. Returns actual.
number of iterations.
Definition at line 1301 of file FaceCellWave.C.
References Foam::endl(), Foam::Info, Foam::nl, and UPstream::parRun().
Referenced by hexRef8::consistentSlowRefinement(), MeshWave< Type, TrackingData >::data(), FaceCellWave< Type, TrackingData >::mesh(), Foam::fvc::spread(), and Foam::fvc::sweep().
|
protected |
Reference to mesh.
Definition at line 94 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::mesh().
|
protected |
Optional boundary faces that information should travel through.
Definition at line 97 of file FaceCellWave.H.
|
protected |
Information for all faces.
Definition at line 100 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::allFaceInfo().
|
protected |
Information for all cells.
Definition at line 103 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::allCellInfo().
|
protected |
Additional data to be passed into container.
Definition at line 106 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::data().
|
protected |
Has face changed.
Definition at line 109 of file FaceCellWave.H.
|
protected |
List of changed faces.
Definition at line 112 of file FaceCellWave.H.
|
protected |
Has cell changed.
Definition at line 115 of file FaceCellWave.H.
|
protected |
Definition at line 118 of file FaceCellWave.H.
|
protected |
Contains cyclics.
Definition at line 122 of file FaceCellWave.H.
|
protected |
Contains cyclicAMI.
Definition at line 125 of file FaceCellWave.H.
|
protected |
Number of evaluations.
Definition at line 128 of file FaceCellWave.H.
|
protected |
Number of unvisited cells/faces.
Definition at line 131 of file FaceCellWave.H.
|
protected |
Definition at line 132 of file FaceCellWave.H.
|
staticprotected |
Definition at line 255 of file FaceCellWave.H.
|
staticprotected |
Definition at line 256 of file FaceCellWave.H.
Referenced by FaceCellWave< Type, TrackingData >::propagationTol().
|
staticprotected |
Used as default trackdata value to satisfy default template.
argument.
Definition at line 260 of file FaceCellWave.H.