OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Class representing the octant of octree. More...
#include <octreelocalizer.h>
Public Types | |
enum | BoundingBoxStatus { BBS_OutsideCell, BBS_InsideCell, BBS_ContainsCell } |
enum | ChildStatus { CS_ChildFound, CS_NoChild } |
Public Member Functions | |
OctantRec (OctreeSpatialLocalizer *loc, OctantRec *parent, FloatArray &origin, double halfWidth) | |
Constructor. More... | |
~OctantRec () | |
Destructor. More... | |
OctantRec * | giveParent () |
const FloatArray & | giveOrigin () |
Gives the cell origin. More... | |
double | giveWidth () |
int | giveCellDepth () |
OctantRec * | giveChild (int xi, int yi, int zi) |
Gives the Child at given local indices. More... | |
ChildStatus | giveChildContainingPoint (OctantRec **child, const FloatArray &coords) |
Returns the child containing given point. More... | |
bool | isTerminalOctant () |
std::list< int > & | giveNodeList () |
IntArray & | giveIPElementList () |
std::list< int > & | giveElementList (int region) |
void | divideLocally (int level, const IntArray &octantMask) |
Divide receiver further, creating corresponding children. More... | |
BoundingBoxStatus | testBoundingBox (const FloatArray &coords, double radius) |
Test if receiver within bounding box (sphere). More... | |
void | addElementIP (int elementNum) |
Adds given element to cell list of elements having IP within this cell. More... | |
void | addElement (int region, int elementNum) |
Adds given element to cell list of elements having IP within this cell. More... | |
void | addNode (int nodeNum) |
Adds given Node to node list of nodes contained by receiver. More... | |
void | deleteNodeList () |
Clears and deletes the nodeList. More... | |
void | printYourself () |
Recursively prints structure. More... | |
std::string | errorInfo (const char *func) const |
Error printing helper. More... | |
Protected Attributes | |
OctreeSpatialLocalizer * | localizer |
Link to octree class. More... | |
OctantRec * | parent |
Link to parent cell record. More... | |
OctantRec * | child [2][2][2] |
Link to octant children. More... | |
FloatArray | origin |
Octant origin coordinates (lower corner) More... | |
double | halfWidth |
Octant size. More... | |
int | depth |
Tree depth. More... | |
std::list< int > | nodeList |
Octant node list. More... | |
IntArray | elementIPList |
Element list, containing all elements having IP in cell. More... | |
std::vector< std::list< int > > | elementList |
Element list of all elements close to the cell. More... | |
Class representing the octant of octree.
It maintains the link to parent cell or if it it the root cell, this link pointer is set to NULL. Maintains links to possible child octree cells as well as its position and size. Also list of node numbers contained in given octree cell can be maintained if cell is terminal cell.
Definition at line 64 of file octreelocalizer.h.
Enumerator | |
---|---|
BBS_OutsideCell | |
BBS_InsideCell | |
BBS_ContainsCell |
Definition at line 88 of file octreelocalizer.h.
Enumerator | |
---|---|
CS_ChildFound | |
CS_NoChild |
Definition at line 89 of file octreelocalizer.h.
oofem::OctantRec::OctantRec | ( | OctreeSpatialLocalizer * | loc, |
OctantRec * | parent, | ||
FloatArray & | origin, | ||
double | halfWidth | ||
) |
Constructor.
Definition at line 51 of file octreelocalizer.C.
References child, depth, and giveCellDepth().
Referenced by divideLocally().
oofem::OctantRec::~OctantRec | ( | ) |
|
inline |
Adds given element to cell list of elements having IP within this cell.
Definition at line 158 of file octreelocalizer.h.
Referenced by oofem::OctreeSpatialLocalizer::insertElementIntoOctree().
|
inline |
Adds given element to cell list of elements having IP within this cell.
elementNum | Element number to add. |
Definition at line 152 of file octreelocalizer.h.
References oofem::IntArray::insertSortedOnce().
Referenced by oofem::OctreeSpatialLocalizer::insertElementsUsingNodalConnectivitiesIntoOctree(), and oofem::OctreeSpatialLocalizer::insertIPElementIntoOctree().
|
inline |
Adds given Node to node list of nodes contained by receiver.
nodeNum | Node number to add. |
Definition at line 163 of file octreelocalizer.h.
Referenced by oofem::OctreeSpatialLocalizer::insertNodeIntoOctree().
|
inline |
Clears and deletes the nodeList.
Definition at line 167 of file octreelocalizer.h.
Referenced by oofem::OctreeSpatialLocalizer::insertNodeIntoOctree().
void oofem::OctantRec::divideLocally | ( | int | level, |
const IntArray & | octantMask | ||
) |
Divide receiver further, creating corresponding children.
level | Depth of tree. |
octantMask | Masking of dimensions. |
Definition at line 151 of file octreelocalizer.C.
References oofem::IntArray::at(), oofem::FloatArray::at(), child, divideLocally(), halfWidth, isTerminalOctant(), localizer, OctantRec(), and origin.
Referenced by oofem::OctreeSpatialLocalizer::buildOctreeDataStructure(), divideLocally(), and oofem::OctreeSpatialLocalizer::insertNodeIntoOctree().
|
inline |
Error printing helper.
Definition at line 173 of file octreelocalizer.h.
|
inline |
Definition at line 106 of file octreelocalizer.h.
Referenced by oofem::OctreeSpatialLocalizer::giveMaxTreeDepthFrom(), oofem::OctreeSpatialLocalizer::insertNodeIntoOctree(), and OctantRec().
OctantRec * oofem::OctantRec::giveChild | ( | int | xi, |
int | yi, | ||
int | zi | ||
) |
Gives the Child at given local indices.
xi | First index. |
yi | Second index. |
zi | Third index. |
Definition at line 106 of file octreelocalizer.C.
References child, and OOFEM_ERROR.
Referenced by oofem::OctreeSpatialLocalizer::giveClosestIPWithinOctant(), oofem::OctreeSpatialLocalizer::giveElementContainingPoint(), oofem::OctreeSpatialLocalizer::giveElementsWithIPWithinBox(), oofem::OctreeSpatialLocalizer::giveListOfTerminalCellsInBoundingBox(), oofem::OctreeSpatialLocalizer::giveMaxTreeDepthFrom(), oofem::OctreeSpatialLocalizer::giveNodesWithinBox(), oofem::OctreeSpatialLocalizer::insertElementIntoOctree(), and oofem::OctreeSpatialLocalizer::insertElementsUsingNodalConnectivitiesIntoOctree().
OctantRec::ChildStatus oofem::OctantRec::giveChildContainingPoint | ( | OctantRec ** | child, |
const FloatArray & | coords | ||
) |
Returns the child containing given point.
If not full 3d coordinates are provided, then only provided coordinates are taken into account, assuming remaining to be same as origin. If point is contained by receiver, corresponding child is set, otherwise. child is set to NULL.
child | |
coords | Coordinate which child should contain. |
Definition at line 119 of file octreelocalizer.C.
References oofem::IntArray::at(), oofem::FloatArray::at(), CS_ChildFound, CS_NoChild, oofem::OctreeSpatialLocalizer::giveOctreeMaskValue(), oofem::FloatArray::giveSize(), isTerminalOctant(), localizer, and origin.
Referenced by oofem::OctreeSpatialLocalizer::findTerminalContaining(), and oofem::OctreeSpatialLocalizer::insertNodeIntoOctree().
std::list< int > & oofem::OctantRec::giveElementList | ( | int | region | ) |
Definition at line 96 of file octreelocalizer.C.
References elementList.
Referenced by oofem::OctreeSpatialLocalizer::giveElementClosestToPointWithinOctant().
IntArray & oofem::OctantRec::giveIPElementList | ( | ) |
Definition at line 90 of file octreelocalizer.C.
References elementIPList.
Referenced by oofem::OctreeSpatialLocalizer::giveClosestIP(), oofem::OctreeSpatialLocalizer::giveClosestIPWithinOctant(), oofem::OctreeSpatialLocalizer::giveElementContainingPoint(), and oofem::OctreeSpatialLocalizer::giveElementsWithIPWithinBox().
std::list< int > & oofem::OctantRec::giveNodeList | ( | ) |
Definition at line 84 of file octreelocalizer.C.
References nodeList.
Referenced by oofem::OctreeSpatialLocalizer::giveNodeClosestToPointWithinOctant(), oofem::OctreeSpatialLocalizer::giveNodesWithinBox(), oofem::OctreeSpatialLocalizer::insertElementsUsingNodalConnectivitiesIntoOctree(), and oofem::OctreeSpatialLocalizer::insertNodeIntoOctree().
|
inline |
Gives the cell origin.
answer | Cell origin. |
Definition at line 102 of file octreelocalizer.h.
Referenced by oofem::OctreeSpatialLocalizer::giveElementClosestToPoint(), and oofem::OctreeSpatialLocalizer::insertElementIntoOctree().
|
inline |
Definition at line 97 of file octreelocalizer.h.
Referenced by oofem::OctreeSpatialLocalizer::giveAllElementsWithIpWithinBox_EvenIfEmpty(), oofem::OctreeSpatialLocalizer::giveAllNodesWithinBox(), oofem::OctreeSpatialLocalizer::giveClosestIP(), and oofem::OctreeSpatialLocalizer::giveElementContainingPoint().
|
inline |
Definition at line 104 of file octreelocalizer.h.
Referenced by oofem::OctreeSpatialLocalizer::giveClosestIP(), oofem::OctreeSpatialLocalizer::giveElementClosestToPoint(), and oofem::OctreeSpatialLocalizer::giveNodeClosestToPoint().
bool oofem::OctantRec::isTerminalOctant | ( | ) |
Definition at line 138 of file octreelocalizer.C.
References child.
Referenced by divideLocally(), oofem::OctreeSpatialLocalizer::findTerminalContaining(), giveChildContainingPoint(), oofem::OctreeSpatialLocalizer::giveClosestIPWithinOctant(), oofem::OctreeSpatialLocalizer::giveElementContainingPoint(), oofem::OctreeSpatialLocalizer::giveElementsWithIPWithinBox(), oofem::OctreeSpatialLocalizer::giveListOfTerminalCellsInBoundingBox(), oofem::OctreeSpatialLocalizer::giveNodesWithinBox(), oofem::OctreeSpatialLocalizer::insertElementIntoOctree(), oofem::OctreeSpatialLocalizer::insertElementsUsingNodalConnectivitiesIntoOctree(), and printYourself().
void oofem::OctantRec::printYourself | ( | ) |
Recursively prints structure.
Definition at line 211 of file octreelocalizer.C.
References oofem::FloatArray::at(), child, depth, elementIPList, oofem::IntArray::giveSize(), halfWidth, isTerminalOctant(), nodeList, origin, and printYourself().
Referenced by printYourself().
OctantRec::BoundingBoxStatus oofem::OctantRec::testBoundingBox | ( | const FloatArray & | coords, |
double | radius | ||
) |
Test if receiver within bounding box (sphere).
coords | Center of sphere. |
radius | Radius of sphere. |
Definition at line 186 of file octreelocalizer.C.
References oofem::FloatArray::at(), BBS_ContainsCell, BBS_InsideCell, BBS_OutsideCell, oofem::OctreeSpatialLocalizer::giveOctreeMaskValue(), oofem::FloatArray::giveSize(), halfWidth, localizer, and origin.
Referenced by oofem::OctreeSpatialLocalizer::giveAllElementsWithIpWithinBox_EvenIfEmpty(), oofem::OctreeSpatialLocalizer::giveAllNodesWithinBox(), oofem::OctreeSpatialLocalizer::giveClosestIP(), oofem::OctreeSpatialLocalizer::giveClosestIPWithinOctant(), oofem::OctreeSpatialLocalizer::giveElementsWithIPWithinBox(), oofem::OctreeSpatialLocalizer::giveListOfTerminalCellsInBoundingBox(), and oofem::OctreeSpatialLocalizer::giveNodesWithinBox().
|
protected |
Link to octant children.
Definition at line 72 of file octreelocalizer.h.
Referenced by divideLocally(), giveChild(), isTerminalOctant(), OctantRec(), printYourself(), and ~OctantRec().
|
protected |
Tree depth.
Definition at line 78 of file octreelocalizer.h.
Referenced by OctantRec(), and printYourself().
|
protected |
Element list, containing all elements having IP in cell.
Definition at line 83 of file octreelocalizer.h.
Referenced by giveIPElementList(), and printYourself().
|
protected |
Element list of all elements close to the cell.
Definition at line 85 of file octreelocalizer.h.
Referenced by giveElementList().
|
protected |
Octant size.
Definition at line 76 of file octreelocalizer.h.
Referenced by divideLocally(), printYourself(), and testBoundingBox().
|
protected |
Link to octree class.
Definition at line 68 of file octreelocalizer.h.
Referenced by divideLocally(), giveChildContainingPoint(), and testBoundingBox().
|
protected |
Octant node list.
Definition at line 81 of file octreelocalizer.h.
Referenced by giveNodeList(), and printYourself().
|
protected |
Octant origin coordinates (lower corner)
Definition at line 74 of file octreelocalizer.h.
Referenced by divideLocally(), giveChildContainingPoint(), printYourself(), and testBoundingBox().
|
protected |
Link to parent cell record.
Definition at line 70 of file octreelocalizer.h.