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

The implementation of spatial localizer based on octree technique. More...

#include <octreelocalizer.h>

+ Inheritance diagram for oofem::OctreeSpatialLocalizer:
+ Collaboration diagram for oofem::OctreeSpatialLocalizer:

Public Member Functions

 OctreeSpatialLocalizer (Domain *d)
 Constructor. More...
 
virtual ~OctreeSpatialLocalizer ()
 Destructor - deletes the octree tree. More...
 
int giveOctreeMaskValue (int indx)
 Returns the octreeMask value given by the index. More...
 
virtual int init (bool force=false)
 Initialize receiver data structure if not done previously. More...
 
virtual ElementgiveElementContainingPoint (const FloatArray &coords, const IntArray *regionList=NULL)
 Returns the element, containing given point and belonging to one of the region in region list. More...
 
virtual ElementgiveElementContainingPoint (const FloatArray &coords, const Set &eset)
 Returns the element, containing given point and belonging to one of the region in region list. More...
 
virtual ElementgiveElementClosestToPoint (FloatArray &lcoords, FloatArray &closest, const FloatArray &gcoords, int region)
 Returns the element closest to a given point. More...
 
virtual GaussPointgiveClosestIP (const FloatArray &coords, int region, bool iCohesiveZoneGP=false)
 Returns the integration point in associated domain, which is closest to given point. More...
 
virtual GaussPointgiveClosestIP (const FloatArray &coords, Set &elemSet, bool iCohesiveZoneGP=false)
 Returns the integration point in associated domain, which is closest to given point. More...
 
virtual void giveAllElementsWithIpWithinBox_EvenIfEmpty (elementContainerType &elemSet, const FloatArray &coords, const double radius)
 Returns container (set) of all domain elements having integration point within given box, even if this set is empty. More...
 
virtual void giveAllElementsWithIpWithinBox (elementContainerType &elemSet, const FloatArray &coords, const double radius)
 Returns container (set) of all domain elements having integration point within given box. More...
 
virtual void giveAllElementsWithIpWithinBox_EvenIfEmpty (elementContainerType &elemSet, const FloatArray &coords, const double radius, bool iCohesiveZoneGP)
 
virtual void giveAllElementsWithIpWithinBox (elementContainerType &elemSet, const FloatArray &coords, const double radius, bool iCohesiveZoneGP)
 
virtual void giveAllNodesWithinBox (nodeContainerType &nodeList, const FloatArray &coords, const double radius)
 Returns container (list) of all domain nodes within given box. More...
 
virtual NodegiveNodeClosestToPoint (const FloatArray &coords, double maxDist)
 Returns the node closest to the given coordinate. More...
 
virtual const char * giveClassName () const
 
- Public Member Functions inherited from oofem::SpatialLocalizer
 SpatialLocalizer (Domain *d)
 Constructor. More...
 
virtual ~SpatialLocalizer ()
 
DomaingiveDomain ()
 Returns the domain that localizer acts on. More...
 
virtual void giveAllElementsWithNodesWithinBox (elementContainerType &elemSet, const FloatArray &coords, const double radius)
 Returns container (set) of all domain elements having node within given box. More...
 
std::string errorInfo (const char *func) const
 Error printing helper. More...
 

Protected Member Functions

bool buildOctreeDataStructure ()
 Builds the underlying octree data structure. More...
 
void initElementIPDataStructure ()
 Insert IP records into tree (the tree topology is determined by nodes). More...
 
void initElementDataStructure (int region=0)
 Insert element into tree (the tree topology is determined by nodes). More...
 
OctantRecfindTerminalContaining (OctantRec *startCell, const FloatArray &coords)
 Finds the terminal octant containing the given point. More...
 
void insertNodeIntoOctree (OctantRec *rootCell, int nodeNum, const FloatArray &coords)
 Inserts the given node (identified by its number and position) to the octree structure. More...
 
void insertIPElementIntoOctree (OctantRec *rootCell, int elemNum, const FloatArray &coords)
 Inserts the given integration point (or more precisely the element owning it) to the octree data structure. More...
 
void insertElementIntoOctree (OctantRec *rootCell, int region, int elemNum, const FloatArray &b0, const FloatArray &b1)
 Inserts an element with the given bounding box. More...
 
void insertElementsUsingNodalConnectivitiesIntoOctree (OctantRec *rootCell)
 Initializes the element lists in octree data structure. More...
 
void giveElementsWithIPWithinBox (elementContainerType &elemSet, OctantRec *currentCell, const FloatArray &coords, const double radius, bool iCohesiveZoneGP=false)
 Returns container (set) of elements having integration point within given box and given root cell. More...
 
void giveNodesWithinBox (nodeContainerType &nodeList, OctantRec *currentCell, const FloatArray &coords, const double radius)
 Returns container (list) of nodes within given box and given root cell. More...
 
void giveClosestIPWithinOctant (OctantRec *currentCell, const FloatArray &coords, int region, double &dist, GaussPoint **answer, bool iCohesiveZoneGP)
 Returns closest IP to given point contained within given octree cell. More...
 
void giveClosestIPWithinOctant (OctantRec *currentCell, const FloatArray &coords, Set &elemSet, double &dist, GaussPoint **answer, bool iCohesiveZoneGP)
 Returns closest IP to given point contained within given octree cell. More...
 
ElementgiveElementContainingPoint (OctantRec *cell, const FloatArray &coords, OctantRec *scannedChild=NULL, const IntArray *regionList=NULL)
 Returns the element containing given point. More...
 
ElementgiveElementContainingPoint (OctantRec *cell, const FloatArray &coords, OctantRec *scannedChild=NULL, const Set *elset=NULL)
 Returns the element containing given point. More...
 
void giveElementClosestToPointWithinOctant (OctantRec *currCell, const FloatArray &gcoords, double &minDist, FloatArray &lcoords, FloatArray &closest, Element *&answer, int region)
 Returns the element closest to the given point within the cell. More...
 
void giveNodeClosestToPointWithinOctant (OctantRec *cell, const FloatArray &gcoords, double &minDist, Node *&answer)
 Returns the node closest to the given point within the cell. More...
 
void giveMaxTreeDepthFrom (OctantRec *root, int &maxDepth)
 Determines the max tree depth computed for given tree cell and its children. More...
 
void giveListOfTerminalCellsInBoundingBox (std::list< OctantRec * > &cellList, const FloatArray &coords, const double radius, double innerRadius, OctantRec *currentCell)
 Builds the list of terminal cells contained within given box (coords, radius), starting from given currentCell. More...
 

Protected Attributes

OctantRecrootCell
 Root cell of octree. More...
 
IntArray octreeMask
 Octree degenerate mask. More...
 
bool elementIPListsInitialized
 Flag indicating elementIP tables are initialized. More...
 
IntArray elementListsInitialized
 
- Protected Attributes inherited from oofem::SpatialLocalizer
Domaindomain
 Link to domain object. More...
 

Additional Inherited Members

- Public Types inherited from oofem::SpatialLocalizer
typedef IntArray elementContainerType
 Typedefs to introduce the container type for element numbers, returned by some services. More...
 
typedef std::list< int > nodeContainerType
 Typedefs to introduce the container type for nodal numbers, returned by some services. More...
 

Detailed Description

The implementation of spatial localizer based on octree technique.

The basic task is to provide spatial information and localization for domain, to which receiver is associated. The octree data structure is build over domain nodes, the element type searches are completed using nodal connectivity informations provided by ConTable. Typical services include searching the closes node to give position, searching of an element containing given point, etc. If special element algorithms required, these should be included using interface concept.

Definition at line 185 of file octreelocalizer.h.

Constructor & Destructor Documentation

oofem::OctreeSpatialLocalizer::OctreeSpatialLocalizer ( Domain d)

Constructor.

Definition at line 240 of file octreelocalizer.C.

References oofem::IntArray::clear(), elementIPListsInitialized, elementListsInitialized, and rootCell.

oofem::OctreeSpatialLocalizer::~OctreeSpatialLocalizer ( )
virtual

Destructor - deletes the octree tree.

Definition at line 248 of file octreelocalizer.C.

References rootCell.

Member Function Documentation

bool oofem::OctreeSpatialLocalizer::buildOctreeDataStructure ( )
protected
OctantRec * oofem::OctreeSpatialLocalizer::findTerminalContaining ( OctantRec startCell,
const FloatArray coords 
)
protected

Finds the terminal octant containing the given point.

Parameters
startCellCell used to start search.
coordsCoordinates of point of interest.
Returns
Pointer to terminal octant, NULL if point outside startingCell.

Definition at line 255 of file octreelocalizer.C.

References oofem::OctantRec::CS_NoChild, oofem::OctantRec::giveChildContainingPoint(), oofem::OctantRec::isTerminalOctant(), and OOFEM_ERROR.

Referenced by giveAllElementsWithIpWithinBox_EvenIfEmpty(), giveAllNodesWithinBox(), giveClosestIP(), giveElementClosestToPoint(), giveElementContainingPoint(), giveNodeClosestToPoint(), insertIPElementIntoOctree(), and insertNodeIntoOctree().

virtual void oofem::OctreeSpatialLocalizer::giveAllElementsWithIpWithinBox ( elementContainerType elemSet,
const FloatArray coords,
const double  radius 
)
inlinevirtual

Returns container (set) of all domain elements having integration point within given box.

Parameters
elemSetAnswer containing the list of elements meeting the criteria.
coordsCenter of box of interest.
radiusRadius of bounding sphere.

Implements oofem::SpatialLocalizer.

Definition at line 221 of file octreelocalizer.h.

References giveAllElementsWithIpWithinBox().

Referenced by giveAllElementsWithIpWithinBox(), and giveClosestIP().

void oofem::OctreeSpatialLocalizer::giveAllElementsWithIpWithinBox ( elementContainerType elemSet,
const FloatArray coords,
const double  radius,
bool  iCohesiveZoneGP 
)
virtual
virtual void oofem::OctreeSpatialLocalizer::giveAllElementsWithIpWithinBox_EvenIfEmpty ( elementContainerType elemSet,
const FloatArray coords,
const double  radius 
)
inlinevirtual

Returns container (set) of all domain elements having integration point within given box, even if this set is empty.

Parameters
elemSetAnswer containing the list of elements meeting the criteria.
coordsCenter of box of interest.
radiusRadius of bounding sphere.

Implements oofem::SpatialLocalizer.

Definition at line 220 of file octreelocalizer.h.

References giveAllElementsWithIpWithinBox_EvenIfEmpty().

Referenced by giveAllElementsWithIpWithinBox(), and giveAllElementsWithIpWithinBox_EvenIfEmpty().

void oofem::OctreeSpatialLocalizer::giveAllElementsWithIpWithinBox_EvenIfEmpty ( elementContainerType elemSet,
const FloatArray coords,
const double  radius,
bool  iCohesiveZoneGP 
)
virtual
void oofem::OctreeSpatialLocalizer::giveAllNodesWithinBox ( nodeContainerType nodeList,
const FloatArray coords,
const double  radius 
)
virtual

Returns container (list) of all domain nodes within given box.

Parameters
nodeListAnswer containing the list of nodes meeting the criteria.
coordsCenter of box of interest.
radiusRadius of bounding sphere.

Implements oofem::SpatialLocalizer.

Definition at line 1460 of file octreelocalizer.C.

References oofem::OctantRec::BBS_InsideCell, findTerminalContaining(), giveNodesWithinBox(), oofem::OctantRec::giveParent(), init(), rootCell, and oofem::OctantRec::testBoundingBox().

virtual const char* oofem::OctreeSpatialLocalizer::giveClassName ( ) const
inlinevirtual

Implements oofem::SpatialLocalizer.

Definition at line 227 of file octreelocalizer.h.

GaussPoint * oofem::OctreeSpatialLocalizer::giveClosestIP ( const FloatArray coords,
int  region,
bool  iCohesiveZoneGP = false 
)
virtual

Returns the integration point in associated domain, which is closest to given point.

Since IP holds the information about its element, the IP reference is containing all the information.

Note
{Only the gp belonging to the given region are taken into account.}
Parameters
coordsGlobal problem coordinates of point of interest
regionIf value > 0 then only closet point from given region will be considered, if value < 0 all regions will be valid
Returns
The IP belonging to associated domain (only those provided by elements in default integration rule are taken into account), NULL otherwise
Note
: regions are deprecated, use sets instaed

Implements oofem::SpatialLocalizer.

Definition at line 817 of file octreelocalizer.C.

References oofem::OctantRec::BBS_ContainsCell, oofem::OctantRec::BBS_InsideCell, oofem::Element::computeGlobalCoordinates(), oofem::FloatArray::distance(), oofem::SpatialLocalizer::domain, oofem::Element_remote, findTerminalContaining(), giveAllElementsWithIpWithinBox(), giveClosestIPWithinOctant(), oofem::Element::giveDefaultIntegrationRulePtr(), oofem::Domain::giveElement(), oofem::OctantRec::giveIPElementList(), giveListOfTerminalCellsInBoundingBox(), oofem::Element::giveParallelMode(), oofem::OctantRec::giveParent(), oofem::Element::giveRegionNumber(), oofem::OctantRec::giveWidth(), init(), initElementIPDataStructure(), oofem::XfemElementInterface::mpCZIntegrationRules, OOFEM_ERROR, oofem::FloatArray::printYourself(), rootCell, and oofem::OctantRec::testBoundingBox().

GaussPoint * oofem::OctreeSpatialLocalizer::giveClosestIP ( const FloatArray coords,
Set elemSet,
bool  iCohesiveZoneGP = false 
)
virtual

Returns the integration point in associated domain, which is closest to given point.

Since IP holds the information about its element, the IP reference is containing all the information.

Note
{Only the gp belonging to the given set are taken into account.}
Parameters
coordsGlobal problem coordinates of point of interest
regionOnly closet point from given region will be considered
Returns
The IP belonging to associated domain (only those provided by elements in default integration rule are taken into account), NULL otherwise

Implements oofem::SpatialLocalizer.

Definition at line 1080 of file octreelocalizer.C.

References oofem::OctantRec::BBS_ContainsCell, oofem::OctantRec::BBS_InsideCell, oofem::Element::computeGlobalCoordinates(), oofem::FloatArray::distance(), oofem::SpatialLocalizer::domain, oofem::Element_remote, findTerminalContaining(), giveAllElementsWithIpWithinBox(), giveClosestIPWithinOctant(), oofem::Element::giveDefaultIntegrationRulePtr(), oofem::Domain::giveElement(), oofem::OctantRec::giveIPElementList(), giveListOfTerminalCellsInBoundingBox(), oofem::FEMComponent::giveNumber(), oofem::Element::giveParallelMode(), oofem::OctantRec::giveParent(), oofem::Element::giveRegionNumber(), oofem::OctantRec::giveWidth(), oofem::Set::hasElement(), init(), initElementIPDataStructure(), oofem::XfemElementInterface::mpCZIntegrationRules, OOFEM_ERROR, oofem::FloatArray::printYourself(), rootCell, and oofem::OctantRec::testBoundingBox().

void oofem::OctreeSpatialLocalizer::giveClosestIPWithinOctant ( OctantRec currentCell,
const FloatArray coords,
int  region,
double &  dist,
GaussPoint **  answer,
bool  iCohesiveZoneGP 
)
protected

Returns closest IP to given point contained within given octree cell.

Parameters
currentCellStarting cell to search, all children will be searched too
coordsPoint coordinates.
regionRegion id of elements.
distThreshold distance, only update answer param, if distance is smaller, distance is updated too.
answerPointer to IP, which has the smallest distance "distance" from given point.

Definition at line 988 of file octreelocalizer.C.

References oofem::IntArray::at(), oofem::OctantRec::BBS_ContainsCell, oofem::OctantRec::BBS_InsideCell, oofem::Element::computeGlobalCoordinates(), oofem::FloatArray::distance(), oofem::SpatialLocalizer::domain, oofem::Element_remote, oofem::OctantRec::giveChild(), oofem::Element::giveDefaultIntegrationRulePtr(), oofem::Domain::giveElement(), oofem::OctantRec::giveIPElementList(), oofem::Element::giveParallelMode(), oofem::Element::giveRegionNumber(), oofem::OctantRec::isTerminalOctant(), oofem::XfemElementInterface::mpCZIntegrationRules, octreeMask, OOFEM_ERROR, and oofem::OctantRec::testBoundingBox().

Referenced by giveClosestIP(), and giveClosestIPWithinOctant().

void oofem::OctreeSpatialLocalizer::giveClosestIPWithinOctant ( OctantRec currentCell,
const FloatArray coords,
Set elemSet,
double &  dist,
GaussPoint **  answer,
bool  iCohesiveZoneGP 
)
protected

Returns closest IP to given point contained within given octree cell.

Parameters
currentCellStarting cell to search, all children will be searched too
coordsPoint coordinates.
elemSetset of considered elements.
distThreshold distance, only update answer param, if distance is smaller, distance is updated too.
answerPointer to IP, which has the smallest distance "distance" from given point.

Definition at line 1249 of file octreelocalizer.C.

References oofem::IntArray::at(), oofem::OctantRec::BBS_ContainsCell, oofem::OctantRec::BBS_InsideCell, oofem::Element::computeGlobalCoordinates(), oofem::FloatArray::distance(), oofem::SpatialLocalizer::domain, oofem::Element_remote, oofem::OctantRec::giveChild(), giveClosestIPWithinOctant(), oofem::Element::giveDefaultIntegrationRulePtr(), oofem::Domain::giveElement(), oofem::OctantRec::giveIPElementList(), oofem::FEMComponent::giveNumber(), oofem::Element::giveParallelMode(), oofem::Set::hasElement(), oofem::OctantRec::isTerminalOctant(), oofem::XfemElementInterface::mpCZIntegrationRules, octreeMask, OOFEM_ERROR, and oofem::OctantRec::testBoundingBox().

Element * oofem::OctreeSpatialLocalizer::giveElementClosestToPoint ( FloatArray lcoords,
FloatArray closest,
const FloatArray coords,
int  region 
)
virtual

Returns the element closest to a given point.

Parameters
[out]lcoordsLocal coordinates in element found.
[out]closestGlobal coordinates for found point.
coordsGlobal problem coordinates of point of interest.
regionOnly elements within given region are considered, if 0 all regions are considered.
Returns
The element belonging to associated domain, close to given point, NULL otherwise.

Implements oofem::SpatialLocalizer.

Definition at line 746 of file octreelocalizer.C.

References oofem::FloatArray::distance(), findTerminalContaining(), giveElementClosestToPointWithinOctant(), giveListOfTerminalCellsInBoundingBox(), oofem::OctantRec::giveOrigin(), oofem::OctantRec::giveWidth(), initElementDataStructure(), and rootCell.

void oofem::OctreeSpatialLocalizer::giveElementClosestToPointWithinOctant ( OctantRec currCell,
const FloatArray gcoords,
double &  minDist,
FloatArray lcoords,
FloatArray closest,
Element *&  answer,
int  region 
)
protected

Returns the element closest to the given point within the cell.

Parameters
currCellTerminal cell to look in.
gcoordsPoint coordinates.
lcoordsLocal coordinates in closest element.
[in,out]minDistDistance from the center of returned element.
closestCoordinates in closest element.
answerRequested element.
regionRegion to consider.

Definition at line 781 of file octreelocalizer.C.

References oofem::Element_remote, oofem::SpatialLocalizer::giveDomain(), oofem::Domain::giveElement(), oofem::OctantRec::giveElementList(), oofem::FEMComponent::giveInterface(), oofem::Element::giveParallelMode(), oofem::Element::giveRegionNumber(), oofem::SpatialLocalizerInterface::SpatialLocalizerI_giveClosestPoint(), and oofem::SpatialLocalizerInterfaceType.

Referenced by giveElementClosestToPoint().

Element * oofem::OctreeSpatialLocalizer::giveElementContainingPoint ( const FloatArray coords,
const IntArray regionList = NULL 
)
virtual

Returns the element, containing given point and belonging to one of the region in region list.

Parameters
coordsGlobal problem coordinates of point of interest.
regionListOnly elements within given regions are considered, if NULL all regions are considered.
Returns
The element belonging to associated domain, containing given point, NULL otherwise.

Implements oofem::SpatialLocalizer.

Definition at line 573 of file octreelocalizer.C.

References findTerminalContaining(), oofem::OctantRec::giveParent(), init(), initElementIPDataStructure(), and rootCell.

Referenced by giveElementContainingPoint().

Element * oofem::OctreeSpatialLocalizer::giveElementContainingPoint ( const FloatArray coords,
const Set eset 
)
virtual

Returns the element, containing given point and belonging to one of the region in region list.

Parameters
coordsGlobal problem coordinates of point of interest.
elementset Only elements within given set are considered.
Returns
The element belonging to associated domain, containing given point, NULL otherwise.

Implements oofem::SpatialLocalizer.

Definition at line 601 of file octreelocalizer.C.

References findTerminalContaining(), giveElementContainingPoint(), oofem::OctantRec::giveParent(), init(), initElementIPDataStructure(), and rootCell.

Element * oofem::OctreeSpatialLocalizer::giveElementContainingPoint ( OctantRec cell,
const FloatArray coords,
OctantRec scannedChild = NULL,
const IntArray regionList = NULL 
)
protected

Returns the element containing given point.

The search is done only for given cell and its children, skipping the given child from search

Parameters
cellTop level cell to search.
coordsPoint coordinates.
scannedChildChild pointer to exclude from search.
regionListOnly elements within given regions are considered, if NULL all regions are considered.
Note
regions depreceted, use sets insteed

Definition at line 630 of file octreelocalizer.C.

References oofem::IntArray::at(), oofem::Element_remote, oofem::IntArray::findFirstIndexOf(), oofem::OctantRec::giveChild(), oofem::SpatialLocalizer::giveDomain(), oofem::Domain::giveElement(), giveElementContainingPoint(), oofem::FEMComponent::giveInterface(), oofem::OctantRec::giveIPElementList(), oofem::Element::giveParallelMode(), oofem::Element::giveRegionNumber(), oofem::IntArray::isEmpty(), oofem::OctantRec::isTerminalOctant(), octreeMask, and oofem::SpatialLocalizerInterfaceType.

Element * oofem::OctreeSpatialLocalizer::giveElementContainingPoint ( OctantRec cell,
const FloatArray coords,
OctantRec scannedChild = NULL,
const Set elset = NULL 
)
protected

Returns the element containing given point.

The search is done only for given cell and its children, skipping the given child from search

Parameters
cellTop level cell to search.
coordsPoint coordinates.
scannedChildChild pointer to exclude from search.
elsetOnly elements in gibven set are considered, if NULL all regions are considered.

Definition at line 688 of file octreelocalizer.C.

References oofem::IntArray::at(), oofem::Element_remote, oofem::OctantRec::giveChild(), oofem::SpatialLocalizer::giveDomain(), oofem::Domain::giveElement(), giveElementContainingPoint(), oofem::FEMComponent::giveInterface(), oofem::OctantRec::giveIPElementList(), oofem::FEMComponent::giveNumber(), oofem::Element::giveParallelMode(), oofem::Set::hasElement(), oofem::IntArray::isEmpty(), oofem::OctantRec::isTerminalOctant(), octreeMask, and oofem::SpatialLocalizerInterfaceType.

void oofem::OctreeSpatialLocalizer::giveElementsWithIPWithinBox ( elementContainerType elemSet,
OctantRec currentCell,
const FloatArray coords,
const double  radius,
bool  iCohesiveZoneGP = false 
)
protected
void oofem::OctreeSpatialLocalizer::giveListOfTerminalCellsInBoundingBox ( std::list< OctantRec * > &  cellList,
const FloatArray coords,
const double  radius,
double  innerRadius,
OctantRec currentCell 
)
protected

Builds the list of terminal cells contained within given box (coords, radius), starting from given currentCell.

Parameters
cellListList of terminal cell pointers contained by bounding box.
coordsCenter of box of interest.
radiusRadius of bounding sphere.
innerRadiusInner radius of bounding sphere.
currentCellStarting cell.

Definition at line 1588 of file octreelocalizer.C.

References oofem::IntArray::at(), oofem::OctantRec::BBS_OutsideCell, oofem::OctantRec::giveChild(), oofem::OctantRec::isTerminalOctant(), octreeMask, and oofem::OctantRec::testBoundingBox().

Referenced by giveClosestIP(), giveElementClosestToPoint(), and giveNodeClosestToPoint().

void oofem::OctreeSpatialLocalizer::giveMaxTreeDepthFrom ( OctantRec root,
int &  maxDepth 
)
protected

Determines the max tree depth computed for given tree cell and its children.

To obtain total tree depth, root cell should be supplied. The tree depth is always measured from the root cell. Before call, maxDepth should be set to zero.

Parameters
rootRoot of tree.
maxDepthThe maximum depth in the tree.

Definition at line 1570 of file octreelocalizer.C.

References oofem::IntArray::at(), oofem::OctantRec::giveCellDepth(), oofem::OctantRec::giveChild(), oofem::max(), and octreeMask.

Referenced by buildOctreeDataStructure().

Node * oofem::OctreeSpatialLocalizer::giveNodeClosestToPoint ( const FloatArray coords,
double  maxDist 
)
virtual

Returns the node closest to the given coordinate.

Parameters
coordsGlobal coordinate.
Returns
Closest node, or NULL or none exists.

Implements oofem::SpatialLocalizer.

Definition at line 1481 of file octreelocalizer.C.

References findTerminalContaining(), giveListOfTerminalCellsInBoundingBox(), giveNodeClosestToPointWithinOctant(), oofem::OctantRec::giveWidth(), oofem::min(), and rootCell.

void oofem::OctreeSpatialLocalizer::giveNodeClosestToPointWithinOctant ( OctantRec cell,
const FloatArray gcoords,
double &  minDist,
Node *&  answer 
)
protected

Returns the node closest to the given point within the cell.

Parameters
currCellTerminal cell to look in.
gcoordsPoint coordinates.
[in,out]minDistDistance from the center of returned element.
answerRequested node.

Definition at line 1511 of file octreelocalizer.C.

References oofem::FloatArray::distance_square(), oofem::SpatialLocalizer::domain, oofem::Node::giveCoordinates(), oofem::Domain::giveNode(), and oofem::OctantRec::giveNodeList().

Referenced by giveNodeClosestToPoint().

void oofem::OctreeSpatialLocalizer::giveNodesWithinBox ( nodeContainerType nodeList,
OctantRec currentCell,
const FloatArray coords,
const double  radius 
)
protected

Returns container (list) of nodes within given box and given root cell.

Parameters
nodeListAnswer containing the list of nodes meeting the criteria.
currentCellThe starting cell to be transversed.
coordsCenter of box of interest.
radiusRadius of bounding sphere.

Definition at line 1530 of file octreelocalizer.C.

References oofem::IntArray::at(), oofem::OctantRec::BBS_ContainsCell, oofem::OctantRec::BBS_InsideCell, oofem::FloatArray::distance(), oofem::SpatialLocalizer::domain, oofem::OctantRec::giveChild(), oofem::Node::giveCoordinates(), oofem::Domain::giveNode(), oofem::OctantRec::giveNodeList(), oofem::OctantRec::isTerminalOctant(), octreeMask, oofem::FloatArray::push_back(), and oofem::OctantRec::testBoundingBox().

Referenced by giveAllNodesWithinBox().

int oofem::OctreeSpatialLocalizer::giveOctreeMaskValue ( int  indx)
inline

Returns the octreeMask value given by the index.

Parameters
indxIndex of mask.
Returns
Mask for given index.

Definition at line 207 of file octreelocalizer.h.

References oofem::IntArray::at().

Referenced by oofem::OctantRec::giveChildContainingPoint(), and oofem::OctantRec::testBoundingBox().

int oofem::OctreeSpatialLocalizer::init ( bool  force = false)
virtual

Initialize receiver data structure if not done previously.

Current implementation calls and returns the buildOctreeDataStructure service response.

Reimplemented from oofem::SpatialLocalizer.

Definition at line 1615 of file octreelocalizer.C.

References buildOctreeDataStructure(), elementIPListsInitialized, elementListsInitialized, rootCell, and oofem::IntArray::zero().

Referenced by buildOctreeDataStructure(), giveAllElementsWithIpWithinBox_EvenIfEmpty(), giveAllNodesWithinBox(), giveClosestIP(), giveElementContainingPoint(), and initElementDataStructure().

void oofem::OctreeSpatialLocalizer::insertElementIntoOctree ( OctantRec rootCell,
int  region,
int  elemNum,
const FloatArray b0,
const FloatArray b1 
)
protected

Inserts an element with the given bounding box.

Parameters
rootCellStarting cell for insertion.
regionElement region number.
elemNumElement number.
b0Lower bounding box.
b1Upper bounding box.

Definition at line 452 of file octreelocalizer.C.

References oofem::OctantRec::addElement(), oofem::IntArray::at(), oofem::FloatArray::at(), oofem::OctantRec::giveChild(), oofem::OctantRec::giveOrigin(), oofem::FloatArray::giveSize(), oofem::OctantRec::isTerminalOctant(), and octreeMask.

Referenced by initElementDataStructure().

void oofem::OctreeSpatialLocalizer::insertElementsUsingNodalConnectivitiesIntoOctree ( OctantRec rootCell)
protected

Initializes the element lists in octree data structure.

This implementation requires that the list of nodes in terminate cells exists simply all shared elements to nodes in terminal cell are added. If this is added to existing implementation based on adding elements only if integration point is in the cell. this leads to more complete element list in terminal cell.

Parameters
rootCellStarting cell for octree transversal.

Definition at line 496 of file octreelocalizer.C.

References oofem::OctantRec::addElementIP(), oofem::IntArray::at(), oofem::SpatialLocalizer::domain, oofem::OctantRec::giveChild(), oofem::Domain::giveConnectivityTable(), oofem::ConnectivityTable::giveDofManConnectivityArray(), oofem::OctantRec::giveNodeList(), oofem::OctantRec::isTerminalOctant(), and octreeMask.

void oofem::OctreeSpatialLocalizer::insertIPElementIntoOctree ( OctantRec rootCell,
int  elemNum,
const FloatArray coords 
)
protected

Inserts the given integration point (or more precisely the element owning it) to the octree data structure.

The tree is traversed until terminal octant containing given position (ip coordinates) is found and corresponding entry is then inserted into corresponding octant list.

Parameters
rootCellStarting cell for insertion.
elemNumElement number.
coordsGlobal IP coordinates.

Definition at line 418 of file octreelocalizer.C.

References oofem::OctantRec::addElementIP(), and findTerminalContaining().

Referenced by initElementIPDataStructure().

void oofem::OctreeSpatialLocalizer::insertNodeIntoOctree ( OctantRec rootCell,
int  nodeNum,
const FloatArray coords 
)
protected

Inserts the given node (identified by its number and position) to the octree structure.

The tree is traversed until terminal octant containing given position is found and node is then inserted into octant nodal list. If there is too much nodes per cell, this is subdivided further and its assigned nodes are propagated to children.

Parameters
rootCellStarting cell for insertion.
nodeNumNode number.
coordsCorresponding node coordinates.

Definition at line 523 of file octreelocalizer.C.

References oofem::OctantRec::addNode(), oofem::OctantRec::CS_ChildFound, oofem::OctantRec::deleteNodeList(), oofem::OctantRec::divideLocally(), oofem::SpatialLocalizer::domain, findTerminalContaining(), oofem::OctantRec::giveCellDepth(), oofem::OctantRec::giveChildContainingPoint(), oofem::Node::giveCoordinates(), oofem::Domain::giveNode(), oofem::OctantRec::giveNodeList(), OCTREE_MAX_DEPTH, OCTREE_MAX_NODES_LIMIT, octreeMask, and OOFEM_ERROR.

Referenced by buildOctreeDataStructure().

Member Data Documentation

bool oofem::OctreeSpatialLocalizer::elementIPListsInitialized
protected

Flag indicating elementIP tables are initialized.

Definition at line 193 of file octreelocalizer.h.

Referenced by buildOctreeDataStructure(), init(), initElementIPDataStructure(), and OctreeSpatialLocalizer().

IntArray oofem::OctreeSpatialLocalizer::elementListsInitialized
protected

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