OOFEM 3.0
Loading...
Searching...
No Matches
oofem::OctantRec Class Reference

#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 (OctantRec *parent, FloatArray origin, double halfWidth)
 Constructor.
 ~OctantRec ()
 Destructor.
OctantRecgiveParent ()
const FloatArraygiveOrigin ()
double giveWidth ()
int giveCellDepth ()
OctantRecgiveChild (int xi, int yi, int zi)
ChildStatus giveChildContainingPoint (OctantRec *&child, const FloatArray &coords, const IntArray &mask)
bool isTerminalOctant ()
std ::list< int > & giveNodeList ()
IntArraygiveIPElementList ()
std ::list< int > & giveElementList (int region)
void divideLocally (int level, const IntArray &octantMask)
BoundingBoxStatus testBoundingBox (const FloatArray &coords, double radius, const IntArray &mask)
void addElementIP (int elementNum)
void addElement (int region, int elementNum)
void addNode (int nodeNum)
void deleteNodeList ()
void printYourself ()
 Recursively prints structure.
std::string errorInfo (const char *func) const
 Error printing helper.

Protected Attributes

OctantRecparent
 Link to parent cell record.
std::unique_ptr< OctantRecchild [2][2][2]
 Link to octant children.
FloatArray origin
 Octant origin coordinates (lower corner).
double halfWidth
 Octant size.
int depth
 Tree depth.
std ::list< int > nodeList
 Octant node list.
IntArray elementIPList
 Element list, containing all elements having IP in cell.
std ::vector< std ::list< int > > elementList
 Element list of all elements close to the cell.

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 69 of file octreelocalizer.h.

Member Enumeration Documentation

◆ BoundingBoxStatus

Enumerator
BBS_OutsideCell 
BBS_InsideCell 
BBS_ContainsCell 

Definition at line 93 of file octreelocalizer.h.

◆ ChildStatus

Enumerator
CS_ChildFound 
CS_NoChild 

Definition at line 94 of file octreelocalizer.h.

Constructor & Destructor Documentation

◆ OctantRec()

oofem::OctantRec::OctantRec ( OctantRec * parent,
FloatArray origin,
double halfWidth )

Constructor.

Definition at line 51 of file octreelocalizer.C.

References depth, halfWidth, OctantRec(), origin, and parent.

Referenced by giveChildContainingPoint(), giveParent(), and OctantRec().

◆ ~OctantRec()

oofem::OctantRec::~OctantRec ( )
inline

Destructor.

Definition at line 99 of file octreelocalizer.h.

Member Function Documentation

◆ addElement()

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 165 of file octreelocalizer.h.

References giveElementList().

◆ addElementIP()

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 159 of file octreelocalizer.h.

References giveIPElementList().

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

◆ addNode()

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 170 of file octreelocalizer.h.

References giveNodeList().

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

◆ deleteNodeList()

void oofem::OctantRec::deleteNodeList ( )
inline

Clears and deletes the nodeList.

Definition at line 174 of file octreelocalizer.h.

References nodeList.

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

◆ divideLocally()

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 124 of file octreelocalizer.C.

References oofem::IntArray::at(), child, halfWidth, isTerminalOctant(), origin, and oofem::Vec3().

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

◆ errorInfo()

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

Error printing helper.

Definition at line 180 of file octreelocalizer.h.

◆ giveCellDepth()

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

Definition at line 111 of file octreelocalizer.h.

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

◆ giveChild()

◆ giveChildContainingPoint()

OctantRec::ChildStatus oofem::OctantRec::giveChildContainingPoint ( OctantRec *& child,
const FloatArray & coords,
const IntArray & mask )

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.
maskMask for which dimensions are in used (size 3, 0 or 1 values)
Returns
Child status.

Definition at line 97 of file octreelocalizer.C.

References child, CS_ChildFound, CS_NoChild, oofem::FloatArray::giveSize(), isTerminalOctant(), OctantRec(), and origin.

Referenced by oofem::OctreeSpatialLocalizer::findTerminalContaining(), and oofem::OctreeSpatialLocalizer::insertNodeIntoOctree().

◆ giveElementList()

std::list< int > & oofem::OctantRec::giveElementList ( int region)
Returns
Reference to closeElement list.

Definition at line 72 of file octreelocalizer.C.

References elementList.

Referenced by addElement(), and oofem::OctreeSpatialLocalizer::giveElementClosestToPointWithinOctant().

◆ giveIPElementList()

◆ giveNodeList()

◆ giveOrigin()

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

Gives the cell origin.

Parameters
answerCell origin.

Definition at line 107 of file octreelocalizer.h.

◆ giveParent()

◆ giveWidth()

double oofem::OctantRec::giveWidth ( )
inline

◆ isTerminalOctant()

◆ printYourself()

void oofem::OctantRec::printYourself ( )

Recursively prints structure.

Definition at line 181 of file octreelocalizer.C.

References child, depth, elementIPList, halfWidth, isTerminalOctant(), nodeList, and origin.

◆ testBoundingBox()

Member Data Documentation

◆ child

std::unique_ptr<OctantRec> oofem::OctantRec::child[2][2][2]
protected

Link to octant children.

Definition at line 75 of file octreelocalizer.h.

Referenced by divideLocally(), giveChild(), giveChildContainingPoint(), isTerminalOctant(), and printYourself().

◆ depth

int oofem::OctantRec::depth
protected

Tree depth.

Definition at line 82 of file octreelocalizer.h.

Referenced by OctantRec(), and printYourself().

◆ elementIPList

IntArray oofem::OctantRec::elementIPList
protected

Element list, containing all elements having IP in cell.

Definition at line 87 of file octreelocalizer.h.

Referenced by giveIPElementList(), and printYourself().

◆ elementList

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

Element list of all elements close to the cell.

Definition at line 89 of file octreelocalizer.h.

Referenced by giveElementList().

◆ halfWidth

double oofem::OctantRec::halfWidth
protected

Octant size.

Definition at line 80 of file octreelocalizer.h.

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

◆ nodeList

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

Octant node list.

Definition at line 85 of file octreelocalizer.h.

Referenced by deleteNodeList(), giveNodeList(), and printYourself().

◆ origin

FloatArray oofem::OctantRec::origin
protected

Octant origin coordinates (lower corner).

Definition at line 78 of file octreelocalizer.h.

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

◆ parent

OctantRec* oofem::OctantRec::parent
protected

Link to parent cell record.

Definition at line 73 of file octreelocalizer.h.

Referenced by OctantRec().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011