Public Member Functions | |
meshOctreeCube () | |
Default constructor. More... | |
meshOctreeCube (const meshOctreeCube &) | |
Copy construct. More... | |
meshOctreeCube (const meshOctreeCubeCoordinates &) | |
Construct from coordinates. More... | |
meshOctreeCube (const meshOctreeCubeCoordinates &cc, const label nElmts, meshOctreeSlot *slotPtr) | |
~meshOctreeCube () | |
void | refineCube2D (const triSurf &, const boundBox &, meshOctreeSlot *slotPtr=NULL) |
refine cube in two directions, it is used for generating quadtrees More... | |
void | refineCube (const triSurf &, const boundBox &, meshOctreeSlot *slotPtr=NULL) |
subdivide the octree cube More... | |
void | refineMissingCube (const triSurf &, const boundBox &, const label scI, meshOctreeSlot *slotPtr=NULL) |
void | refineMissingCube (const label scI, const label elementsRowI=-1, const label edgesRowI=-1, meshOctreeSlot *slotPtr=NULL) |
const meshOctreeSlot * | slotPtr () const |
return the pointer to the slot containing the cube More... | |
label | cubeLabel () const |
position of the cube in the list of leaves More... | |
bool | isLeaf () const |
check if the cube is a leaf More... | |
meshOctreeCube * | subCube (const label) const |
return a pointer to a child cubes at given position More... | |
FixedList< meshOctreeCube *, 8 > | subCubes () const |
return the pointers to the sons More... | |
bool | hasContainedTriangles (const triSurf &, const boundBox &, const VRWGraph &containedElements) const |
check if this box has some contained triangles More... | |
bool | hasContainedElements () const |
return true if the box contains some triangles More... | |
label | containedElements () const |
bool | hasContainedEdges () const |
returns true if the box contains some edges More... | |
label | containedEdges () const |
void | leavesInBox (const boundBox &rootBox, const boundBox &searchingBox, DynList< const meshOctreeCube *, 256 > &) const |
leaves contained in the given box More... | |
void | leavesInSphere (const boundBox &rootBox, const point &, const scalar, DynList< label > &) const |
find leaves within a sphere More... | |
void | markLeavesInSphere (const boundBox &rootBox, const point &, const scalar, labelList &, bool &) const |
mark leaves within a sphere More... | |
void | findLeaves (LongList< meshOctreeCube * > &leaves) const |
find leaves for a given cube More... | |
void | findCoordinatesOfMissingCubes (LongList< meshOctreeCubeCoordinates > &coordinates) const |
find coordinates of cubes which are located on other processors More... | |
void | countChildCubes (label &nCubes) const |
count number of originating from this cube More... | |
bool | purgeProcessorCubes (const short procNo) |
delete boxes which are not local to the given processor More... | |
void | operator= (const meshOctreeCube &) |
assignment More... | |
![]() | |
meshOctreeCubeBasic () | |
Null constructor. More... | |
meshOctreeCubeBasic (const meshOctreeCubeCoordinates &) | |
Construct from coordinates. More... | |
meshOctreeCubeBasic (const meshOctreeCubeCoordinates &cc, const direction cubeType, const short procNo=ALLPROCS) | |
Construct from coordinates and cube type. More... | |
~meshOctreeCubeBasic () | |
direction | cubeType () const |
return type More... | |
void | setCubeType (const direction) |
set cube type More... | |
short | procNo () const |
return processor number More... | |
void | setProcNo (const short) |
set processor number More... | |
const meshOctreeCubeCoordinates & | coordinates () const |
return coordinates in the octree More... | |
void | operator= (const meshOctreeCubeBasic &) |
![]() | |
meshOctreeCubeCoordinates () | |
Null constructor. More... | |
meshOctreeCubeCoordinates (const label posX, const label posY, const label posZ, const direction level) | |
Construct from coordinates and level. More... | |
meshOctreeCubeCoordinates (const meshOctreeCubeCoordinates &) | |
copy constructor More... | |
~meshOctreeCubeCoordinates () | |
direction | level () const |
return level More... | |
label | posX () const |
return x, y, z coordinates More... | |
label | posY () const |
label | posZ () const |
meshOctreeCubeCoordinates | refineForPosition (const label) const |
return the coordinates of child cube at the given position More... | |
meshOctreeCubeCoordinates | reduceLevelBy (const direction diff) const |
meshOctreeCubeCoordinates | reduceToLevel (const direction) const |
return the coordinates of the parent at the given level More... | |
meshOctreeCubeCoordinates | increaseToLevelMin (const direction l) const |
return the minimal coordinates of the child at the given level More... | |
meshOctreeCubeCoordinates | increaseToLevelMax (const direction l) const |
return the maximal coordinates of the child at the given level More... | |
void | cubeBox (const boundBox &, point &, point &) const |
return min and max points More... | |
void | vertices (const boundBox &, FixedList< point, 8 > &) const |
calculate vertices More... | |
point | centre (const boundBox &) const |
return centre More... | |
scalar | size (const boundBox &) const |
return size More... | |
void | edgeVertices (const boundBox &, FixedList< FixedList< point, 2 >, 12 > &) const |
edges of the cube More... | |
bool | intersectsTriangle (const triSurf &, const boundBox &, const label) const |
check if the surface triangle intersects the cube More... | |
bool | intersectsTriangleExact (const triSurf &, const boundBox &, const label) const |
bool | isVertexInside (const boundBox &, const point &) const |
is a vertex inside the cube More... | |
bool | isPositionInside (const meshOctreeCubeCoordinates &) const |
void | neighbourRange (meshOctreeCubeCoordinates &minCoord, meshOctreeCubeCoordinates &maxCoord) const |
bool | intersectsLine (const boundBox &, const point &, const point &) const |
check if the cube intersects a line More... | |
meshOctreeCubeCoordinates | operator+ (const meshOctreeCubeCoordinates &) const |
void | operator= (const meshOctreeCubeCoordinates &) |
bool | operator== (const meshOctreeCubeCoordinates &) const |
bool | operator!= (const meshOctreeCubeCoordinates &) const |
bool | operator<= (const meshOctreeCubeCoordinates &) const |
comparison of Morton codes More... | |
bool | operator>= (const meshOctreeCubeCoordinates &) const |
bool | operator< (const meshOctreeCubeCoordinates &) const |
bool | operator> (const meshOctreeCubeCoordinates &) const |
Private Member Functions | |
void | findContainedEdges (const triSurf &, const boundBox &) |
find edges contained in the cube More... | |
meshOctreeCube (const meshOctreeCubeBasic &) | |
Disallow copy construct from meshOctreeCubeBasic. More... | |
Private Attributes | |
meshOctreeSlot * | activeSlotPtr_ |
pointer the slot containing this cube More... | |
meshOctreeCube ** | subCubesPtr_ |
pointer to the first child element More... | |
label | cubeLabel_ |
position of the cube in the list of leaves More... | |
label | containedElementsLabel_ |
label of the row which contains elements contained in the cube More... | |
label | containedEdgesLabel_ |
labels of contained surface edges More... | |
Static Private Attributes | |
static const label | hOrder_ [24][8] |
static const label | hOrient_ [24][8] |
Friends | |
Ostream & | operator<< (Ostream &, const meshOctreeCube &) |
Additional Inherited Members | |
![]() | |
enum | typesOfCubes { UNKNOWN = 1, OUTSIDE = 2, DATA = 4, INSIDE = 8, ALLPROCS = -2, OTHERPROC = -3 } |
![]() | |
static const label | edgeNodes_ [12][2] |
edge nodes for an octree cube More... | |
static const label | faceNodes_ [6][4] |
cube nodes making each face More... | |
static const label | nodeFaces_ [8][3] |
node-faces addressing for the cube More... | |
static const label | faceEdges_ [6][4] |
face-edges addressing for the octree cube More... | |
static const label | edgeFaces_ [12][2] |
edge-faces addressing for the octree cube More... | |
static const label | oppositeFace_ [6] = {1, 0, 3, 2, 5, 4} |
return the opposite face of each cube face More... | |
Definition at line 56 of file meshOctreeCube.H.
|
private |
Disallow copy construct from meshOctreeCubeBasic.
store data which is contained in the child cube this is needed for parallel coarsening of the octree
inline void reclaimDataFromChild(const label scI);
|
inline |
Default constructor.
Definition at line 38 of file meshOctreeCubeI.H.
|
inline |
Copy construct.
Definition at line 48 of file meshOctreeCubeI.H.
meshOctreeCube | ( | const meshOctreeCubeCoordinates & | cc | ) |
Construct from coordinates.
Definition at line 105 of file meshOctreeCube.C.
meshOctreeCube | ( | const meshOctreeCubeCoordinates & | cc, |
const label | nElmts, | ||
meshOctreeSlot * | slotPtr | ||
) |
Construct from coordinates and the number of surface triangles this constructor is used for the initial cube, only
Definition at line 116 of file meshOctreeCube.C.
References meshOctreeSlot::containedEdges_, meshOctreeSlot::containedTriangles_, VRWGraph::setRowSize(), and VRWGraph::setSize().
~meshOctreeCube | ( | ) |
Definition at line 139 of file meshOctreeCube.C.
find edges contained in the cube
Definition at line 46 of file meshOctreeCubeRefine.C.
References DynList< T, staticSize >::append(), VRWGraph::appendList(), Foam::e, edge::end(), forAllRow, HashTable::found(), HashSet< Key, Hash >::insert(), points, s(), DynList< T, staticSize >::size(), VRWGraph::size(), VRWGraph::sizeOfRow(), and edge::start().
void refineCube2D | ( | const triSurf & | surface, |
const boundBox & | rootBox, | ||
meshOctreeSlot * | slotPtr = NULL |
||
) |
refine cube in two directions, it is used for generating quadtrees
set the cube label to -1
create subCubes
create new cubes in the Z-order fashion
check if the subCube contain the element
find surface edges within the cube
Definition at line 102 of file meshOctreeCubeRefine.C.
References VRWGraph::appendList(), meshOctreeSlot::childCubes_, meshOctreeSlot::containedTriangles_, meshOctreeSlot::cubes_, Foam::endl(), forAll, forAllRow, Foam::Info, DynList< T, staticSize >::size(), VRWGraph::size(), and Foam::Warning.
void refineCube | ( | const triSurf & | surface, |
const boundBox & | rootBox, | ||
meshOctreeSlot * | slotPtr = NULL |
||
) |
subdivide the octree cube
set the cube label to -1
create subCubes
create new cubes in the Z-order fashion
check if the subCube contain the element
find surface edges within the cube
Definition at line 223 of file meshOctreeCubeRefine.C.
References VRWGraph::appendList(), meshOctreeSlot::childCubes_, meshOctreeSlot::containedTriangles_, meshOctreeSlot::cubes_, Foam::endl(), forAll, forAllRow, Foam::Info, DynList< T, staticSize >::size(), VRWGraph::size(), and Foam::Warning.
Referenced by meshOctreeCreator::createOctreeWithRefinedBoundary().
void refineMissingCube | ( | const triSurf & | ts, |
const boundBox & | rootBox, | ||
const label | scI, | ||
meshOctreeSlot * | slotPtr = NULL |
||
) |
create missing child cubes and refine them until the required cube is reached (this function is used for parallel octree creation)
set the cube label to -1
refine the cube for the selected position
Definition at line 340 of file meshOctreeCubeRefine.C.
References DynList< T, staticSize >::append(), VRWGraph::appendList(), meshOctreeSlot::childCubes_, meshOctreeSlot::containedTriangles_, meshOctreeSlot::cubes_, forAll, forAllRow, DynList< T, staticSize >::size(), and VRWGraph::size().
Referenced by meshOctreeModifier::refineTreeForCoordinates().
void refineMissingCube | ( | const label | scI, |
const label | elementsRowI = -1 , |
||
const label | edgesRowI = -1 , |
||
meshOctreeSlot * | slotPtr = NULL |
||
) |
create missing child cubes and refine them until the required cube is reached (this function is used for parallel octree creation) contained elements and edges are provided as argument
set the cube label to -1
refine the cube for the selected position
set the contained elements and edges
Definition at line 412 of file meshOctreeCubeRefine.C.
References meshOctreeSlot::childCubes_, meshOctreeSlot::cubes_, and forAll.
|
inline |
return the pointer to the slot containing the cube
Definition at line 58 of file meshOctreeCubeI.H.
References meshOctreeCube::activeSlotPtr_.
Referenced by meshOctree::findEdgesInBox(), findCellsIntersectingSurface::findIntersectedCells(), meshOctree::findTrianglesInBox(), meshOctreeModifier::reduceMemoryConsumption(), meshOctreeCreator::refineBoundary(), and meshOctreeInsideOutside::reviseDataBoxes().
|
inline |
position of the cube in the list of leaves
Definition at line 76 of file meshOctreeCubeI.H.
References meshOctreeCube::cubeLabel_.
Referenced by meshOctree::findLeafContainingVertex(), meshOctree::findLeafLabelForPosition(), meshOctree::findNeighbourOverNode(), meshOctree::findNeighboursInDirection(), meshOctree::findNeighboursOverEdge(), meshOctreeCreator::refineBoxesNearDataBoxes(), and meshOctreeAutomaticRefinement::refineSelectedBoxes().
|
inline |
check if the cube is a leaf
Definition at line 63 of file meshOctreeCubeI.H.
References meshOctreeCube::subCubesPtr_.
Referenced by meshOctreeCube::countChildCubes(), meshOctree::findCubeForPosition(), meshOctree::findEdgesInBox(), meshOctree::findLeafContainingVertex(), meshOctree::findLeafLabelForPosition(), meshOctreeCube::findLeaves(), meshOctree::findNeighbourOverNode(), meshOctree::findNeighboursInDirection(), meshOctree::findNeighboursOverEdge(), meshOctree::findTrianglesInBox(), meshOctreeCube::purgeProcessorCubes(), meshOctreeAutomaticRefinement::refineSelectedBoxes(), and meshOctreeModifier::refineTreeForCoordinates().
|
inline |
return a pointer to a child cubes at given position
Definition at line 71 of file meshOctreeCubeI.H.
References meshOctreeCube::subCubesPtr_.
Referenced by meshOctree::findCubeForPosition(), meshOctree::findLeafContainingVertex(), meshOctree::findNeighbourOverNode(), meshOctree::findNeighboursInDirection(), meshOctree::findNeighboursOverEdge(), meshOctreeModifier::refineTreeForCoordinates(), and meshOctreeCube::subCubes().
FixedList< meshOctreeCube *, 8 > subCubes | ( | ) | const |
return the pointers to the sons
Definition at line 144 of file meshOctreeCube.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, meshOctreeCube::subCube(), and meshOctreeCube::subCubesPtr_.
bool hasContainedTriangles | ( | const triSurf & | surface, |
const boundBox & | rootBox, | ||
const VRWGraph & | containedElements | ||
) | const |
check if this box has some contained triangles
Definition at line 43 of file meshOctreeCubeIntersections.C.
References forAllRow.
|
inline |
return true if the box contains some triangles
Definition at line 81 of file meshOctreeCubeI.H.
References meshOctreeCube::containedElementsLabel_.
Referenced by findCellsIntersectingSurface::findIntersectedCells(), meshOctree::findTrianglesInBox(), meshOctreeModifier::reduceMemoryConsumption(), and meshOctreeCreator::refineBoundary().
|
inline |
returns the list of contained surface elements this list is only allocated for cubes containing elements
Definition at line 89 of file meshOctreeCubeI.H.
References meshOctreeCube::containedElementsLabel_.
Referenced by findCellsIntersectingSurface::findIntersectedCells(), meshOctree::findTrianglesInBox(), meshOctreeModifier::reduceMemoryConsumption(), meshOctreeCreator::refineBoundary(), and meshOctreeInsideOutside::reviseDataBoxes().
|
inline |
returns true if the box contains some edges
Definition at line 94 of file meshOctreeCubeI.H.
References meshOctreeCube::containedEdgesLabel_.
Referenced by meshOctree::findEdgesInBox(), and meshOctreeModifier::reduceMemoryConsumption().
|
inline |
returns the list of contained surface edges this list is only allocated for cubes containing edges
Definition at line 102 of file meshOctreeCubeI.H.
References meshOctreeCube::containedEdgesLabel_.
Referenced by meshOctree::findEdgesInBox(), and meshOctreeModifier::reduceMemoryConsumption().
void leavesInBox | ( | const boundBox & | rootBox, |
const boundBox & | searchingBox, | ||
DynList< const meshOctreeCube *, 256 > & | leaves | ||
) | const |
leaves contained in the given box
Definition at line 43 of file meshOctreeCubeRecursiveFunctions.C.
References DynList< T, staticSize >::append(), meshOctreeCubeCoordinates::cubeBox(), meshOctreeCube::leavesInBox(), boundBox::max(), boundBox::min(), boundBox::overlaps(), and UPstream::parRun().
Referenced by meshOctreeCube::leavesInBox().
void leavesInSphere | ( | const boundBox & | rootBox, |
const point & | c, | ||
const scalar | r, | ||
DynList< label > & | containedLeaves | ||
) | const |
find leaves within a sphere
Definition at line 89 of file meshOctreeCubeRecursiveFunctions.C.
References DynList< T, staticSize >::append(), Foam::constant::universal::c, meshOctreeCubeCoordinates::centre(), meshOctreeCube::leavesInSphere(), Foam::magSqr(), meshOctreeCubeBasic::OTHERPROC, UPstream::parRun(), and Foam::sqr().
Referenced by meshOctreeCube::leavesInSphere().
void markLeavesInSphere | ( | const boundBox & | rootBox, |
const point & | c, | ||
const scalar | r, | ||
labelList & | markedLeaves, | ||
bool & | atProcessorBnd | ||
) | const |
mark leaves within a sphere
Definition at line 135 of file meshOctreeCubeRecursiveFunctions.C.
References Foam::constant::universal::c, meshOctreeCubeCoordinates::centre(), Foam::magSqr(), meshOctreeCube::markLeavesInSphere(), UPstream::parRun(), and Foam::sqr().
Referenced by meshOctreeCube::markLeavesInSphere().
void findLeaves | ( | LongList< meshOctreeCube * > & | leaves | ) | const |
find leaves for a given cube
Definition at line 184 of file meshOctreeCubeRecursiveFunctions.C.
References LongList< T, Offset >::append(), meshOctreeCube::cubeLabel_, meshOctreeCube::findLeaves(), meshOctreeCube::isLeaf(), LongList< T, Offset >::size(), and meshOctreeCube::subCubesPtr_.
Referenced by meshOctreeModifier::createListOfLeaves(), and meshOctreeCube::findLeaves().
void findCoordinatesOfMissingCubes | ( | LongList< meshOctreeCubeCoordinates > & | coordinates | ) | const |
find coordinates of cubes which are located on other processors
Definition at line 207 of file meshOctreeCubeRecursiveFunctions.C.
References PtrList::append(), coordinates(), and meshOctreeCube::findCoordinatesOfMissingCubes().
Referenced by meshOctreeCube::findCoordinatesOfMissingCubes(), and meshOctreeModifier::updateCommunicationPattern().
void countChildCubes | ( | label & | nCubes | ) | const |
count number of originating from this cube
Definition at line 229 of file meshOctreeCubeRecursiveFunctions.C.
References meshOctreeCube::countChildCubes(), meshOctreeCube::isLeaf(), and meshOctreeCube::subCubesPtr_.
Referenced by meshOctreeCube::countChildCubes().
bool purgeProcessorCubes | ( | const short | procNo | ) |
delete boxes which are not local to the given processor
Definition at line 247 of file meshOctreeCubeRecursiveFunctions.C.
References meshOctreeCubeBasic::ALLPROCS, meshOctreeCube::isLeaf(), meshOctreeCubeBasic::procNo(), meshOctreeCubeBasic::setProcNo(), and meshOctreeCube::subCubesPtr_.
Referenced by meshOctreeModifier::distributeLeavesToProcessors(), and meshOctreeModifier::loadDistribution().
|
inline |
assignment
Definition at line 107 of file meshOctreeCubeI.H.
References meshOctreeCube::activeSlotPtr_, meshOctreeCube::containedEdgesLabel_, meshOctreeCube::containedElementsLabel_, meshOctreeCubeBasic::coordinates(), meshOctreeCube::cubeLabel_, and meshOctreeCube::subCubesPtr_.
|
friend |
Definition at line 161 of file meshOctreeCube.C.
|
private |
pointer the slot containing this cube
Definition at line 61 of file meshOctreeCube.H.
Referenced by meshOctreeCube::operator=(), and meshOctreeCube::slotPtr().
|
private |
pointer to the first child element
Definition at line 64 of file meshOctreeCube.H.
Referenced by meshOctreeCube::countChildCubes(), meshOctreeCube::findLeaves(), meshOctreeCube::isLeaf(), meshOctreeCube::operator=(), meshOctreeCube::purgeProcessorCubes(), meshOctreeCube::subCube(), and meshOctreeCube::subCubes().
|
mutableprivate |
position of the cube in the list of leaves
Definition at line 67 of file meshOctreeCube.H.
Referenced by meshOctreeCube::cubeLabel(), meshOctreeCube::findLeaves(), and meshOctreeCube::operator=().
|
private |
label of the row which contains elements contained in the cube
Definition at line 70 of file meshOctreeCube.H.
Referenced by meshOctreeCube::containedElements(), meshOctreeCube::hasContainedElements(), and meshOctreeCube::operator=().
|
private |
labels of contained surface edges
Definition at line 73 of file meshOctreeCube.H.
Referenced by meshOctreeCube::containedEdges(), meshOctreeCube::hasContainedEdges(), and meshOctreeCube::operator=().
|
staticprivate |
this data is needed to map the the current refinement pattern to the Hilbert space-filling curve in order to reduce the bandwidth in the list of leaves. The procedure is performed using the table published in (Campbell etal: Dynamic Octree Load Balancing Using Space-Filling Curves) which is adjusted to the current ref pattern
Definition at line 81 of file meshOctreeCube.H.
|
staticprivate |
orientation of the Hilbert curve in the refined cubes of a cube with the ordering in the above table
Definition at line 85 of file meshOctreeCube.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.