box Class Referenceabstract

Creates the parallel distribution map by describing the source and target objects using box shapes. More...

Inheritance diagram for box:
[legend]
Collaboration diagram for box:
[legend]

Public Member Functions

 TypeName ("box")
 Runtime type information. More...
 
 box (const UList< point > &srcPoints, const UList< point > &tgtPoints, const label maxObjectsPerLeaf, const label nObjectsOfType, const label nRefineIterMax=100)
 Construct from list of points. More...
 
virtual ~box ()=default
 Destructor. More...
 
- Public Member Functions inherited from processorLOD
 TypeName ("processorLOD")
 Runtime type information. More...
 
 processorLOD (const label maxObjectsPerLeaf, const label nObjectsOfType)
 Construct from components. More...
 
virtual ~processorLOD ()=default
 Destructor. More...
 
virtual autoPtr< mapDistributemap ()=0
 Return the parallel distribution map. More...
 

Protected Member Functions

void writeBoxes (const List< DynamicList< treeBoundBox > > &fixedBoxes, const label iter) const
 Helper function to write the boxes in OBJ format. More...
 
virtual boundBox calcSrcBox (const label srcObji) const =0
 
virtual boundBox calcTgtBox (const label tgtObji) const =0
 
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. More...
 
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. More...
 
autoPtr< mapDistributecreateMap (const label nSrcElems, const label nTgtElems)
 
autoPtr< mapDistributecreateLODMap (List< labelList > &sendElems) const
 Use the current list of send elements to create the mapDistribute. More...
 

Protected Attributes

const UList< point > & srcPoints_
 Reference to the source points. More...
 
const UList< point > & tgtPoints_
 Reference to the target points. More...
 
List< List< treeBoundBox > > boxes_
 Per processor, the list of src bound boxes. More...
 
label nRefineIterMax_
 Maximum number of refinement iterations. More...
 
List< labelListnewToOld_
 Addressing per proc of new to old bound boxes. More...
 
List< List< labelList > > boxSrcElems_
 Indices of elements in the src boxes. More...
 
- Protected Attributes inherited from processorLOD
label maxObjectsPerLeaf_
 Maximum number of objects per leaf. More...
 
label nObjectsOfType_
 

Static Protected Attributes

static const label DROP = 0
 Drop/discard. More...
 
static const label REFINE = 1
 Refine. More...
 
static const label FIXED = 2
 Fixed - do not touch. More...
 
static const label nStartUpIter = 2
 Number of iterations before element indices are cached. More...
 

Detailed Description

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.

Definition at line 59 of file box.H.

Constructor & Destructor Documentation

◆ box()

box ( const UList< point > &  srcPoints,
const UList< point > &  tgtPoints,
const label  maxObjectsPerLeaf,
const label  nObjectsOfType,
const label  nRefineIterMax = 100 
)

Construct from list of points.

Definition at line 594 of file box.C.

References DynamicList< T, SizeMin >::append(), box::boxes_, forAll, boundBox::inflate(), UList< T >::size(), box::srcPoints_, and List< T >::transfer().

Here is the call graph for this function:

◆ ~box()

virtual ~box ( )
virtualdefault

Destructor.

Member Function Documentation

◆ writeBoxes()

void writeBoxes ( const List< DynamicList< treeBoundBox > > &  fixedBoxes,
const label  iter 
) const
protected

Helper function to write the boxes in OBJ format.

Definition at line 48 of file box.C.

References PstreamBuffers::allProcs(), f(), treeBoundBox::faces, forAll, processorFaPatch::myProcNo(), Foam::name(), Foam::nl, os(), p, treeBoundBox::points(), UList< T >::size(), and Foam::meshTools::writeOBJ().

Here is the call graph for this function:

◆ calcSrcBox()

virtual boundBox calcSrcBox ( const label  srcObji) const
protectedpure virtual

Implemented in faceBox.

◆ calcTgtBox()

virtual boundBox calcTgtBox ( const label  tgtObji) const
protectedpure virtual

Implemented in faceBox.

◆ setRefineFlags()

void setRefineFlags ( const label  refineIter,
const label  nTgtObjects,
List< labelHashSet > &  fixedSendElems,
List< List< labelList > > &  localTgtElems,
List< labelList > &  refineFlags,
labelList nElems 
) const
protected

Set the box refinement flags.

Definition at line 101 of file box.C.

References PstreamBuffers::allProcs(), DynamicList< T, SizeMin >::append(), UList< T >::empty(), PstreamBuffers::finishedSends(), forAll, Foam::identity(), processorFaPatch::myProcNo(), UPstream::nonBlocking, Foam::readLabel(), List< T >::setSize(), UList< T >::size(), and List< T >::transfer().

Here is the call graph for this function:

◆ refineBox() [1/2]

void refineBox ( const label  boxi,
const label  refineIter,
const label  nSrcElem,
const treeBoundBox origBox,
DynamicList< treeBoundBox > &  procBoxes,
DynamicList< labelList > &  procBoxElems,
DynamicList< label > &  procNewToOld 
) const
protected

Definition at line 223 of file box.C.

References DynamicList< T, SizeMin >::append(), treeBoundBox::overlaps(), UList< T >::size(), and treeBoundBox::subBbox().

Here is the call graph for this function:

◆ refineBox() [2/2]

void refineBox ( const label  boxi,
const labelList srcAddr,
const treeBoundBox origBox,
DynamicList< treeBoundBox > &  procBoxes,
DynamicList< labelList > &  procBoxElems,
DynamicList< label > &  procNewToOld 
) const
protected

Definition at line 281 of file box.C.

References DynamicList< T, SizeMin >::append(), treeBoundBox::overlaps(), UList< T >::size(), and treeBoundBox::subBbox().

Here is the call graph for this function:

◆ doRefineBoxes()

bool doRefineBoxes ( const label  refineIter,
const label  nSrcFaces,
const List< labelList > &  refineFlags,
List< DynamicList< treeBoundBox > > &  fixedBoxes 
)
protected

Apply the box refinements.

Returns
true if still refining

Definition at line 318 of file box.C.

References Foam::abort(), PstreamBuffers::allProcs(), Foam::FatalError, FatalErrorInFunction, PstreamBuffers::finishedSends(), forAll, processorFaPatch::myProcNo(), UPstream::nonBlocking, PstreamBuffers::nProcs(), Foam::returnReduce(), and UList< T >::size().

Here is the call graph for this function:

◆ createMap()

Foam::autoPtr< Foam::mapDistribute > createMap ( const label  nSrcElems,
const label  nTgtElems 
)
protected

Definition at line 423 of file box.C.

References List< T >::append(), List< T >::clear(), Foam::endl(), forAll, Foam::identity(), HashSet< Key, Hash >::insert(), processorFaPatch::myProcNo(), Foam::nl, PstreamBuffers::nProcs(), Foam::Pout, UList< T >::size(), Foam::tab, HashTable< T, Key, Hash >::toc(), and Foam::Zero.

Here is the call graph for this function:

◆ createLODMap()

Foam::autoPtr< Foam::mapDistribute > createLODMap ( List< labelList > &  sendElems) const
protected

Use the current list of send elements to create the mapDistribute.

Definition at line 540 of file box.C.

References Pstream::allGatherList(), forAll, Foam::identity(), processorFaPatch::myProcNo(), PstreamBuffers::nProcs(), List< T >::setSize(), and UList< T >::size().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "box"  )

Runtime type information.

Member Data Documentation

◆ DROP

const Foam::label DROP = 0
staticprotected

Drop/discard.

Definition at line 70 of file box.H.

◆ REFINE

const Foam::label REFINE = 1
staticprotected

Refine.

Definition at line 73 of file box.H.

◆ FIXED

const Foam::label FIXED = 2
staticprotected

Fixed - do not touch.

Definition at line 76 of file box.H.

◆ srcPoints_

const UList<point>& srcPoints_
protected

Reference to the source points.

Definition at line 80 of file box.H.

Referenced by box::box(), and faceBox::calcSrcBox().

◆ tgtPoints_

const UList<point>& tgtPoints_
protected

Reference to the target points.

Definition at line 83 of file box.H.

◆ boxes_

List<List<treeBoundBox> > boxes_
protected

Per processor, the list of src bound boxes.

Note: using treeBoundBox to take advantage of subBbox() method

Definition at line 87 of file box.H.

Referenced by box::box().

◆ nRefineIterMax_

label nRefineIterMax_
protected

Maximum number of refinement iterations.

Definition at line 90 of file box.H.

◆ nStartUpIter

const Foam::label nStartUpIter = 2
staticprotected

Number of iterations before element indices are cached.

Definition at line 96 of file box.H.

◆ newToOld_

List<labelList> newToOld_
protected

Addressing per proc of new to old bound boxes.

Definition at line 99 of file box.H.

◆ boxSrcElems_

List<List<labelList> > boxSrcElems_
protected

Indices of elements in the src boxes.

Definition at line 102 of file box.H.


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