Creates the parallel distribution map by describing the source and target objects using box shapes. More...
#include <box.H>


Public Member Functions | |
| TypeName ("box") | |
| Runtime type information. | |
| box (const UList< point > &srcPoints, const UList< point > &tgtPoints, const label maxObjectsPerLeaf, const label nObjectsOfType, const label nRefineIterMax=100) | |
| Construct from list of points for source and target. | |
| virtual | ~box ()=default |
| Destructor. | |
| Public Member Functions inherited from processorLOD | |
| TypeName ("processorLOD") | |
| Runtime type information. | |
| processorLOD (const label maxObjectsPerLeaf, const label nObjectsOfType) noexcept | |
| Construct from components. | |
| virtual | ~processorLOD ()=default |
| Destructor. | |
| virtual autoPtr< mapDistribute > | map (const mapDistributeBase::layoutTypes constructLayout=mapDistributeBase::layoutTypes::linear)=0 |
| Return the parallel distribution map (usually linear construct order). | |
Protected Member Functions | |
| void | writeBoxes (const List< DynamicList< treeBoundBox > > &fixedBoxes, const label iter) const |
| Helper function to write the boxes in OBJ format. | |
| virtual treeBoundBox | calcSrcBox (const label srcObji) const =0 |
| The local boundBox associated with given source object. | |
| virtual treeBoundBox | calcTgtBox (const label tgtObji) const =0 |
| The local boundBox associated with given target object. | |
| void | setRefineFlags (const label refineIter, const label nTgtObjects, List< labelHashSet > &fixedSendElems, List< List< labelList > > &localTgtElems, List< labelList > &refineFlags, labelList &nElems) const |
| Set the box refinement flags. | |
| void | refineBox (const label boxi, const label refineIter, const label nSrcElem, const treeBoundBox &origBox, DynamicList< treeBoundBox > &procBoxes, DynamicList< labelList > &procBoxElems, DynamicList< label > &procNewToOld) const |
| void | refineBox (const label boxi, const labelList &srcAddr, const treeBoundBox &origBox, DynamicList< treeBoundBox > &procBoxes, DynamicList< labelList > &procBoxElems, DynamicList< label > &procNewToOld) const |
| bool | doRefineBoxes (const label refineIter, const label nSrcFaces, const List< labelList > &refineFlags, List< DynamicList< treeBoundBox > > &fixedBoxes) |
| Apply the box refinements. | |
| autoPtr< mapDistribute > | createMap (const label nSrcElems, const label nTgtElems, const mapDistributeBase::layoutTypes constructLayout) |
| Return the parallel distribution map (often linear construct order). | |
Protected Attributes | |
| const UList< point > & | srcPoints_ |
| Reference to the source points. | |
| const UList< point > & | tgtPoints_ |
| Reference to the target points. | |
| List< List< treeBoundBox > > | boxes_ |
| Per processor, the list of src bound boxes. | |
| label | nRefineIterMax_ |
| Maximum number of refinement iterations. | |
| List< labelList > | newToOld_ |
| Addressing per proc of new to old bound boxes. | |
| List< List< labelList > > | boxSrcElems_ |
| Indices of elements in the src boxes. | |
| Protected Attributes inherited from processorLOD | |
| label | maxObjectsPerLeaf_ |
| Maximum number of objects per leaf. | |
| label | nObjectsOfType_ |
| Number of objects of this type. e.g. number of faces/cells on this processor. | |
Static Protected Attributes | |
| static const label | DROP = 0 |
| Drop/discard. | |
| static const label | REFINE = 1 |
| Refine. | |
| static const label | FIXED = 2 |
| Fixed - do not touch. | |
| static const label | nStartUpIter = 2 |
| Number of iterations before element indices are cached. | |
Creates the parallel distribution map by describing the source and target objects using box shapes.
A single box is created for the source object, which is then split using 2x2x2 refinement based on the number of remote target objects that overlap. The refinement is local between communicating processor pairs, where the refinement continues until a threshold number of remote target objects per source box is achieved.
| box | ( | const UList< point > & | srcPoints, |
| const UList< point > & | tgtPoints, | ||
| const label | maxObjectsPerLeaf, | ||
| const label | nObjectsOfType, | ||
| const label | nRefineIterMax = 100 ) |
Construct from list of points for source and target.
Definition at line 532 of file box.C.
References boxes_, boxSrcElems_, newToOld_, nRefineIterMax_, processorLOD::processorLOD(), srcPoints_, and tgtPoints_.
Referenced by faceBox::faceBox().


|
virtualdefault |
Destructor.
|
protected |
Helper function to write the boxes in OBJ format.
Definition at line 41 of file box.C.
References UPstream::allProcs(), f(), treeBoundBox::faces, UPstream::myProcNo(), Foam::name(), Foam::nl, os(), pts, timeIndex, and Foam::meshTools::writeOBJ().
Referenced by createMap().


|
protectedpure virtual |
The local boundBox associated with given source object.
Implemented in cellBox, and faceBox.
Referenced by refineBox(), and refineBox().

|
protectedpure virtual |
The local boundBox associated with given target object.
Implemented in cellBox, and faceBox.
Referenced by setRefineFlags().

|
protected |
Set the box refinement flags.
Definition at line 88 of file box.C.
References UPstream::allProcs(), DynamicList< T, SizeMin >::append(), boxes_, calcTgtBox(), UList< T >::empty(), PstreamBuffers::finishedSends(), FIXED, forAll, Foam::identity(), processorLOD::maxObjectsPerLeaf_, UPstream::myProcNo(), newToOld_, processorLOD::nObjectsOfType_, nStartUpIter, Foam::readLabel(), PstreamBuffers::recvDataCount(), REFINE, List< T >::setSize(), UList< T >::size(), and List< T >::transfer().
Referenced by createMap().


|
protected |
Definition at line 208 of file box.C.
References DynamicList< T, SizeMin >::append(), calcSrcBox(), nStartUpIter, treeBoundBox::overlaps(), UList< T >::size(), and treeBoundBox::subBbox().
Referenced by doRefineBoxes().


|
protected |
Definition at line 266 of file box.C.
References DynamicList< T, SizeMin >::append(), calcSrcBox(), treeBoundBox::overlaps(), UList< T >::size(), and treeBoundBox::subBbox().

|
protected |
Apply the box refinements.
Definition at line 303 of file box.C.
References Foam::abort(), UPstream::allProcs(), boxes_, boxSrcElems_, DROP, Foam::FatalError, FatalErrorInFunction, PstreamBuffers::finishedSends(), FIXED, forAll, UPstream::myProcNo(), newToOld_, UPstream::nProcs(), nStartUpIter, REFINE, refineBox(), Foam::returnReduceOr(), and UList< T >::size().
Referenced by createMap().


|
protected |
Return the parallel distribution map (often linear construct order).
Definition at line 408 of file box.C.
References List< T >::append(), boxes_, List< T >::clear(), doRefineBoxes(), Foam::endl(), forAll, Foam::identity(), HashSet< Key, Hash >::insert(), UPstream::myProcNo(), autoPtr< T >::New(), Foam::nl, UPstream::nProcs(), nRefineIterMax_, Foam::Pout, setRefineFlags(), UList< T >::size(), HashTable< T, Key, Hash >::sortedToc(), Foam::tab, writeBoxes(), and Foam::Zero.
Referenced by cellBox::map(), and faceBox::map().


| TypeName | ( | "box" | ) |
Runtime type information.
|
staticprotected |
|
staticprotected |
|
staticprotected |
Fixed - do not touch.
Definition at line 75 of file box.H.
Referenced by doRefineBoxes(), and setRefineFlags().
Reference to the source points.
Definition at line 81 of file box.H.
Referenced by box(), cellBox::calcSrcBox(), and faceBox::calcSrcBox().
Reference to the target points.
Definition at line 86 of file box.H.
Referenced by box(), cellBox::calcTgtBox(), and faceBox::calcTgtBox().
|
protected |
Per processor, the list of src bound boxes.
Note: using treeBoundBox to take advantage of subBbox() method
Definition at line 93 of file box.H.
Referenced by box(), createMap(), doRefineBoxes(), and setRefineFlags().
|
protected |
Maximum number of refinement iterations.
Definition at line 98 of file box.H.
Referenced by box(), and createMap().
|
staticprotected |
Number of iterations before element indices are cached.
Definition at line 106 of file box.H.
Referenced by doRefineBoxes(), refineBox(), and setRefineFlags().
Addressing per proc of new to old bound boxes.
Definition at line 111 of file box.H.
Referenced by box(), doRefineBoxes(), and setRefineFlags().
Indices of elements in the src boxes.
Definition at line 116 of file box.H.
Referenced by box(), and doRefineBoxes().