OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::OctantRec Class Reference

Class representing the octant of octree. More...

#include <octreelocalizer.h>

+ Collaboration diagram for oofem::OctantRec:

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...
 
OctantRecgiveParent ()
 
const FloatArraygiveOrigin ()
 Gives the cell origin. More...
 
double giveWidth ()
 
int giveCellDepth ()
 
OctantRecgiveChild (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 ()
 
IntArraygiveIPElementList ()
 
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

OctreeSpatialLocalizerlocalizer
 Link to octree class. More...
 
OctantRecparent
 Link to parent cell record. More...
 
OctantRecchild [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...
 

Detailed Description

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.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

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 ( )

Destructor.

Definition at line 68 of file octreelocalizer.C.

References child.

Member Function Documentation

void oofem::OctantRec::addElement ( int  region,
int  elementNum 
)
inline

Adds given element to cell list of elements having IP within this cell.

Parameters
regionElement region number (0 for global).
elementNumElement number to add.

Definition at line 158 of file octreelocalizer.h.

Referenced by oofem::OctreeSpatialLocalizer::insertElementIntoOctree().

void oofem::OctantRec::addElementIP ( int  elementNum)
inline

Adds given element to cell list of elements having IP within this cell.

Parameters
elementNumElement number to add.

Definition at line 152 of file octreelocalizer.h.

References oofem::IntArray::insertSortedOnce().

Referenced by oofem::OctreeSpatialLocalizer::insertElementsUsingNodalConnectivitiesIntoOctree(), and oofem::OctreeSpatialLocalizer::insertIPElementIntoOctree().

void oofem::OctantRec::addNode ( int  nodeNum)
inline

Adds given Node to node list of nodes contained by receiver.

Parameters
nodeNumNode number to add.

Definition at line 163 of file octreelocalizer.h.

Referenced by oofem::OctreeSpatialLocalizer::insertNodeIntoOctree().

void oofem::OctantRec::deleteNodeList ( )
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.

Parameters
levelDepth of tree.
octantMaskMasking 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().

std :: string oofem::OctantRec::errorInfo ( const char *  func) const
inline

Error printing helper.

Definition at line 173 of file octreelocalizer.h.

int oofem::OctantRec::giveCellDepth ( )
inline
Returns
Depth in the tree for this octant.

Definition at line 106 of file octreelocalizer.h.

Referenced by oofem::OctreeSpatialLocalizer::giveMaxTreeDepthFrom(), oofem::OctreeSpatialLocalizer::insertNodeIntoOctree(), and OctantRec().

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.

Parameters
child
coordsCoordinate which child should contain.
Returns
Child status.

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)
Returns
Reference to closeElement list.

Definition at line 96 of file octreelocalizer.C.

References elementList.

Referenced by oofem::OctreeSpatialLocalizer::giveElementClosestToPointWithinOctant().

const FloatArray& oofem::OctantRec::giveOrigin ( )
inline

Gives the cell origin.

Parameters
answerCell origin.

Definition at line 102 of file octreelocalizer.h.

Referenced by oofem::OctreeSpatialLocalizer::giveElementClosestToPoint(), and oofem::OctreeSpatialLocalizer::insertElementIntoOctree().

double oofem::OctantRec::giveWidth ( )
inline
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().

Member Data Documentation

OctantRec* oofem::OctantRec::child[2][2][2]
protected

Link to octant children.

Definition at line 72 of file octreelocalizer.h.

Referenced by divideLocally(), giveChild(), isTerminalOctant(), OctantRec(), printYourself(), and ~OctantRec().

int oofem::OctantRec::depth
protected

Tree depth.

Definition at line 78 of file octreelocalizer.h.

Referenced by OctantRec(), and printYourself().

IntArray oofem::OctantRec::elementIPList
protected

Element list, containing all elements having IP in cell.

Definition at line 83 of file octreelocalizer.h.

Referenced by giveIPElementList(), and printYourself().

std :: vector< std :: list< int > > oofem::OctantRec::elementList
protected

Element list of all elements close to the cell.

Definition at line 85 of file octreelocalizer.h.

Referenced by giveElementList().

double oofem::OctantRec::halfWidth
protected

Octant size.

Definition at line 76 of file octreelocalizer.h.

Referenced by divideLocally(), printYourself(), and testBoundingBox().

OctreeSpatialLocalizer* oofem::OctantRec::localizer
protected

Link to octree class.

Definition at line 68 of file octreelocalizer.h.

Referenced by divideLocally(), giveChildContainingPoint(), and testBoundingBox().

std :: list< int > oofem::OctantRec::nodeList
protected

Octant node list.

Definition at line 81 of file octreelocalizer.h.

Referenced by giveNodeList(), and printYourself().

FloatArray oofem::OctantRec::origin
protected

Octant origin coordinates (lower corner)

Definition at line 74 of file octreelocalizer.h.

Referenced by divideLocally(), giveChildContainingPoint(), printYourself(), and testBoundingBox().

OctantRec* oofem::OctantRec::parent
protected

Link to parent cell record.

Definition at line 70 of file octreelocalizer.h.


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:39 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011