Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
hierarchGeomDecomp Class Reference

Does hierarchical decomposition of points. Works by first sorting the points in x direction into equal sized bins, then in y direction and finally in z direction. More...

Inheritance diagram for hierarchGeomDecomp:
Inheritance graph
[legend]
Collaboration diagram for hierarchGeomDecomp:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("hierarchical")
 Runtime type information. More...
 
 hierarchGeomDecomp (const dictionary &decompositionDict)
 Construct given the decomposition dictionary. More...
 
virtual ~hierarchGeomDecomp ()
 Destructor. More...
 
virtual bool parallelAware () const
 Hierarchgeom is aware of processor boundaries. More...
 
virtual labelList decompose (const pointField &, const scalarField &weights)
 Return for every coordinate the wanted processor number. More...
 
virtual labelList decompose (const pointField &)
 Without weights. Code for weighted decomposition is a bit complex. More...
 
virtual labelList decompose (const polyMesh &mesh, const pointField &cc, const scalarField &cWeights)
 Return for every coordinate the wanted processor number. Use the. More...
 
virtual labelList decompose (const polyMesh &mesh, const pointField &cc)
 Without weights. Code for weighted decomposition is a bit complex. More...
 
virtual labelList decompose (const labelListList &globalCellCells, const pointField &cc, const scalarField &cWeights)
 Return for every coordinate the wanted processor number. Explicitly. More...
 
virtual labelList decompose (const labelListList &globalCellCells, const pointField &cc)
 Like decompose but with uniform weights on the cells. More...
 
- Public Member Functions inherited from geomDecomp
 geomDecomp (const dictionary &decompositionDict, const word &derivedType)
 Construct given the decomposition dictionary. More...
 
- Public Member Functions inherited from decompositionMethod
 TypeName ("decompositionMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, decompositionMethod, dictionary,(const dictionary &decompositionDict),(decompositionDict))
 
 decompositionMethod (const dictionary &decompositionDict)
 Construct given the decomposition dictionary. More...
 
virtual ~decompositionMethod ()
 Destructor. More...
 
label nDomains () const
 
virtual labelList decompose (const polyMesh &mesh, const labelList &cellToRegion, const pointField &regionPoints, const scalarField &regionWeights)
 Return for every coordinate the wanted processor number. Gets. More...
 
virtual labelList decompose (const polyMesh &mesh, const labelList &cellToRegion, const pointField &regionPoints)
 Like decompose but with uniform weights on the regions. More...
 
void setConstraints (const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections)
 Helper: extract constraints: More...
 
void applyConstraints (const polyMesh &mesh, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections, labelList &finalDecomp)
 Helper: apply constraints to a decomposition. This gives. More...
 
virtual labelList decompose (const polyMesh &mesh, const scalarField &cellWeights, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections)
 
labelList decompose (const polyMesh &mesh, const scalarField &cWeights)
 Decompose a mesh. Apply all constraints from decomposeParDict. More...
 

Private Member Functions

void setDecompOrder ()
 Convert ordering string ("xyz") into list of components. More...
 
void sortComponent (const label sizeTol, const pointField &, const labelList &slice, const direction componentIndex, const label prevMult, labelList &finalDecomp)
 Recursively sort in x,y,z (or rather acc. to decompOrder_) More...
 
void sortComponent (const label sizeTol, const scalarField &weights, const pointField &, const labelList &slice, const direction componentIndex, const label prevMult, labelList &finalDecomp)
 
void operator= (const hierarchGeomDecomp &)
 Disallow default bitwise copy construct and assignment. More...
 
 hierarchGeomDecomp (const hierarchGeomDecomp &)
 

Static Private Member Functions

static void calculateSortedWeightedSizes (const labelList &current, const labelList &indices, const scalarField &weights, const label globalCurrentSize, scalarField &sortedWeightedSizes)
 Evaluates the weighted sizes for each sorted point. More...
 
static label findLower (const List< scalar > &, const scalar t, const label left, const label right)
 Find index of t in list inbetween indices left and right. More...
 
static void findBinary (const label sizeTol, const List< scalar > &, const label leftIndex, const scalar leftValue, const scalar maxValue, const scalar wantedSize, label &mid, scalar &midValue)
 Find midValue (at local index mid) such that the number of. More...
 
static void findBinary (const label sizeTol, const List< scalar > &sortedWeightedSizes, const List< scalar > &, const label leftIndex, const scalar leftValue, const scalar maxValue, const scalar wantedSize, label &mid, scalar &midValue)
 Find midValue (at local index mid) such that the number of. More...
 

Private Attributes

FixedList< direction, 3 > decompOrder_
 Decomposition order in terms of components. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from decompositionMethod
static autoPtr< decompositionMethodNew (const dictionary &decompositionDict)
 Return a reference to the selected decomposition method. More...
 
static void calcCellCells (const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool global, CompactListList< label > &cellCells)
 Helper: determine (local or global) cellCells from mesh. More...
 
static void calcCellCells (const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool parallel, CompactListList< label > &cellCells, CompactListList< scalar > &cellCellWeights)
 Helper: determine (local or global) cellCells and face weights. More...
 
- Protected Attributes inherited from geomDecomp
const dictionarygeomDecomDict_
 
Vector< labeln_
 
scalar delta_
 
tensor rotDelta_
 
- Protected Attributes inherited from decompositionMethod
const dictionarydecompositionDict_
 
label nProcessors_
 
PtrList< decompositionConstraintconstraints_
 Optional constraints. More...
 

Detailed Description

Does hierarchical decomposition of points. Works by first sorting the points in x direction into equal sized bins, then in y direction and finally in z direction.

Uses single array to hold decomposition which is indexed as if it is a 3 dimensional array:

finalDecomp[i,j,k] is indexed as

i*n[0]*n[1] + j*n[1] + k

E.g. if we're sorting 'xyz': the first sort (over the x-component) determines in which x-domain the point goes. Then for each of the x-domains the points are sorted in y direction and each individual x-domain gets split into three y-domains. And similar for the z-direction.

Since the domains are of equal size the maximum difference in size is n[0]*n[1] (or n[1]*n[2]?) (small anyway)

Source files

Definition at line 66 of file hierarchGeomDecomp.H.

Constructor & Destructor Documentation

◆ hierarchGeomDecomp() [1/2]

hierarchGeomDecomp ( const hierarchGeomDecomp )
private

◆ hierarchGeomDecomp() [2/2]

hierarchGeomDecomp ( const dictionary decompositionDict)

Construct given the decomposition dictionary.

Definition at line 769 of file hierarchGeomDecomp.C.

◆ ~hierarchGeomDecomp()

virtual ~hierarchGeomDecomp ( )
inlinevirtual

Destructor.

Definition at line 174 of file hierarchGeomDecomp.H.

Member Function Documentation

◆ setDecompOrder()

void setDecompOrder ( )
private

Convert ordering string ("xyz") into list of components.

Definition at line 47 of file hierarchGeomDecomp.C.

References hierarchGeomDecomp::decompOrder_, decompositionMethod::decompositionDict_, Foam::endl(), Foam::exit(), Foam::FatalError, Foam::FatalIOError, FatalIOErrorInFunction, geomDecomp::geomDecomDict_, and dictionary::lookup().

Here is the call graph for this function:

◆ calculateSortedWeightedSizes()

void calculateSortedWeightedSizes ( const labelList current,
const labelList indices,
const scalarField weights,
const label  globalCurrentSize,
scalarField sortedWeightedSizes 
)
staticprivate

Evaluates the weighted sizes for each sorted point.

Definition at line 137 of file hierarchGeomDecomp.C.

References forAll, Foam::returnReduce(), and List::size().

Here is the call graph for this function:

◆ findLower()

Foam::label findLower ( const List< scalar > &  l,
const scalar  t,
const label  left,
const label  right 
)
staticprivate

Find index of t in list inbetween indices left and right.

Definition at line 87 of file hierarchGeomDecomp.C.

◆ findBinary() [1/2]

void findBinary ( const label  sizeTol,
const List< scalar > &  values,
const label  leftIndex,
const scalar  leftValue,
const scalar  maxValue,
const scalar  wantedSize,
label mid,
scalar &  midValue 
)
staticprivate

Find midValue (at local index mid) such that the number of.

elements between mid and leftIndex are (globally summed) the wantedSize. Binary search.

Definition at line 168 of file hierarchGeomDecomp.C.

References Foam::endl(), Foam::findLower(), Foam::mag(), maxValue, minValue, Foam::Pout, Foam::returnReduce(), List::size(), and WarningInFunction.

Here is the call graph for this function:

◆ findBinary() [2/2]

void findBinary ( const label  sizeTol,
const List< scalar > &  sortedWeightedSizes,
const List< scalar > &  values,
const label  leftIndex,
const scalar  leftValue,
const scalar  maxValue,
const scalar  wantedSize,
label mid,
scalar &  midValue 
)
staticprivate

Find midValue (at local index mid) such that the number of.

elements between mid and leftIndex are (globally summed) the wantedSize. Binary search.

Definition at line 242 of file hierarchGeomDecomp.C.

References Foam::endl(), Foam::findLower(), Foam::mag(), maxValue, minValue, Foam::Pout, Foam::returnReduce(), List::size(), and WarningInFunction.

Here is the call graph for this function:

◆ sortComponent() [1/2]

void sortComponent ( const label  sizeTol,
const pointField points,
const labelList slice,
const direction  componentIndex,
const label  prevMult,
labelList finalDecomp 
)
private

Recursively sort in x,y,z (or rather acc. to decompOrder_)

Definition at line 321 of file hierarchGeomDecomp.C.

References Foam::endl(), forAll, SortableList::indices(), UPstream::nProcs(), points, Foam::Pout, prefixOSstream::prefix(), Foam::returnReduce(), List::size(), and SortableList::sort().

Here is the call graph for this function:

◆ sortComponent() [2/2]

void sortComponent ( const label  sizeTol,
const scalarField weights,
const pointField points,
const labelList slice,
const direction  componentIndex,
const label  prevMult,
labelList finalDecomp 
)
private

Recursively sort in x,y,z (or rather acc. to decompOrder_) Using weighted points.

Definition at line 502 of file hierarchGeomDecomp.C.

References Foam::endl(), forAll, SortableList::indices(), points, Foam::Pout, prefixOSstream::prefix(), Foam::returnReduce(), List::size(), and SortableList::sort().

Here is the call graph for this function:

◆ operator=()

void operator= ( const hierarchGeomDecomp )
private

Disallow default bitwise copy construct and assignment.

◆ TypeName()

TypeName ( "hierarchical"  )

Runtime type information.

◆ parallelAware()

virtual bool parallelAware ( ) const
inlinevirtual

Hierarchgeom is aware of processor boundaries.

Implements decompositionMethod.

Definition at line 181 of file hierarchGeomDecomp.H.

◆ decompose() [1/6]

Foam::labelList decompose ( const pointField points,
const scalarField weights 
)
virtual

Return for every coordinate the wanted processor number.

Implements geomDecomp.

Definition at line 725 of file hierarchGeomDecomp.C.

References Foam::e, forAll, Foam::max(), points, and Foam::reduce().

Referenced by hierarchGeomDecomp::decompose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decompose() [2/6]

Foam::labelList decompose ( const pointField points)
virtual

Without weights. Code for weighted decomposition is a bit complex.

so kept separate for now.

Implements geomDecomp.

Definition at line 685 of file hierarchGeomDecomp.C.

References Foam::e, forAll, Foam::max(), points, and Foam::reduce().

Here is the call graph for this function:

◆ decompose() [3/6]

virtual labelList decompose ( const polyMesh mesh,
const pointField cc,
const scalarField cWeights 
)
inlinevirtual

Return for every coordinate the wanted processor number. Use the.

mesh connectivity (if needed)

Implements decompositionMethod.

Definition at line 201 of file hierarchGeomDecomp.H.

References hierarchGeomDecomp::decompose().

Here is the call graph for this function:

◆ decompose() [4/6]

virtual labelList decompose ( const polyMesh mesh,
const pointField cc 
)
inlinevirtual

Without weights. Code for weighted decomposition is a bit complex.

so kept separate for now.

Reimplemented from decompositionMethod.

Definition at line 212 of file hierarchGeomDecomp.H.

◆ decompose() [5/6]

virtual labelList decompose ( const labelListList globalCellCells,
const pointField cc,
const scalarField cWeights 
)
inlinevirtual

Return for every coordinate the wanted processor number. Explicitly.

provided connectivity - does not use mesh_. The connectivity is equal to mesh.cellCells() except for

  • in parallel the cell numbers are global cell numbers (starting from 0 at processor0 and then incrementing all through the processors)
  • the connections are across coupled patches

Implements decompositionMethod.

Definition at line 225 of file hierarchGeomDecomp.H.

References hierarchGeomDecomp::decompose().

Here is the call graph for this function:

◆ decompose() [6/6]

virtual labelList decompose ( const labelListList globalCellCells,
const pointField cc 
)
inlinevirtual

Like decompose but with uniform weights on the cells.

Reimplemented from decompositionMethod.

Definition at line 235 of file hierarchGeomDecomp.H.

References hierarchGeomDecomp::decompose().

Here is the call graph for this function:

Field Documentation

◆ decompOrder_

FixedList<direction, 3> decompOrder_
private

Decomposition order in terms of components.

Definition at line 73 of file hierarchGeomDecomp.H.

Referenced by hierarchGeomDecomp::setDecompOrder().


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