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

#include <octreelocalizer.h>

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

Public Member Functions

 OctreeSpatialLocalizer (Domain *d)
 Constructor.
virtual ~OctreeSpatialLocalizer ()
 Destructor - deletes the octree tree.
int giveOctreeMaskValue (int indx)
int init (bool force=false) override
ElementgiveElementContainingPoint (const FloatArray &coords, const IntArray *regionList=nullptr) override
ElementgiveElementContainingPoint (const FloatArray &coords, const Set &eset) override
ElementgiveElementClosestToPoint (FloatArray &lcoords, FloatArray &closest, const FloatArray &gcoords, int region) override
GaussPointgiveClosestIP (const FloatArray &coords, int region, bool iCohesiveZoneGP=false) override
GaussPointgiveClosestIP (const FloatArray &coords, Set &elemSet, bool iCohesiveZoneGP=false) override
void giveAllElementsWithIpWithinBox_EvenIfEmpty (elementContainerType &elemSet, const FloatArray &coords, const double radius) override
void giveAllElementsWithIpWithinBox (elementContainerType &elemSet, const FloatArray &coords, const double radius) override
void giveAllElementsWithIpWithinBox_EvenIfEmpty (elementContainerType &elemSet, const FloatArray &coords, const double radius, bool iCohesiveZoneGP)
void giveAllElementsWithIpWithinBox (elementContainerType &elemSet, const FloatArray &coords, const double radius, bool iCohesiveZoneGP)
void giveAllNodesWithinBox (nodeContainerType &nodeList, const FloatArray &coords, const double radius) override
NodegiveNodeClosestToPoint (const FloatArray &coords, double maxDist) override
const char * giveClassName () const override
Public Member Functions inherited from oofem::SpatialLocalizer
 SpatialLocalizer (Domain *d)
 Constructor.
virtual ~SpatialLocalizer ()
DomaingiveDomain ()
 Returns the domain that localizer acts on.
virtual void giveAllElementsWithNodesWithinBox (elementContainerType &elemSet, const FloatArray &coords, const double radius)
std::string errorInfo (const char *func) const
 Error printing helper.

Protected Member Functions

bool buildOctreeDataStructure ()
void initElementIPDataStructure ()
void initElementDataStructure (int region=0)
OctantRecfindTerminalContaining (OctantRec &startCell, const FloatArray &coords)
void insertNodeIntoOctree (OctantRec &rootCell, int nodeNum, const FloatArray &coords)
void insertIPElementIntoOctree (OctantRec &rootCell, int elemNum, const FloatArray &coords)
void insertElementIntoOctree (OctantRec &rootCell, int region, int elemNum, const FloatArray &b0, const FloatArray &b1)
void insertElementsUsingNodalConnectivitiesIntoOctree (OctantRec &rootCell)
void giveElementsWithIPWithinBox (elementContainerType &elemSet, OctantRec &currentCell, const FloatArray &coords, const double radius, bool iCohesiveZoneGP=false)
void giveNodesWithinBox (nodeContainerType &nodeList, OctantRec &currentCell, const FloatArray &coords, const double radius)
void giveClosestIPWithinOctant (OctantRec &currentCell, const FloatArray &coords, int region, double &dist, GaussPoint *&answer, bool iCohesiveZoneGP)
void giveClosestIPWithinOctant (OctantRec &currentCell, const FloatArray &coords, Set &elemSet, double &dist, GaussPoint *&answer, bool iCohesiveZoneGP)
ElementgiveElementContainingPoint (OctantRec &cell, const FloatArray &coords, OctantRec *scannedChild=nullptr, const IntArray *regionList=nullptr)
ElementgiveElementContainingPoint (OctantRec &cell, const FloatArray &coords, OctantRec *scannedChild=nullptr, const Set *elset=nullptr)
void giveElementClosestToPointWithinOctant (OctantRec &currCell, const FloatArray &gcoords, double &minDist, FloatArray &lcoords, FloatArray &closest, Element *&answer, int region)
void giveNodeClosestToPointWithinOctant (OctantRec &cell, const FloatArray &gcoords, double &minDist, Node *&answer)
int giveMaxTreeDepthFrom (OctantRec &root)
void giveListOfTerminalCellsInBoundingBox (std ::list< OctantRec * > &cellList, const FloatArray &coords, const double radius, double innerRadius, OctantRec &currentCell)

Protected Attributes

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

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.
typedef std ::list< int > nodeContainerType
 Typedefs to introduce the container type for nodal numbers, returned by some services.

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

Constructor & Destructor Documentation

◆ OctreeSpatialLocalizer()

oofem::OctreeSpatialLocalizer::OctreeSpatialLocalizer ( Domain * d)

◆ ~OctreeSpatialLocalizer()

virtual oofem::OctreeSpatialLocalizer::~OctreeSpatialLocalizer ( )
inlinevirtual

Destructor - deletes the octree tree.

Definition at line 212 of file octreelocalizer.h.

Member Function Documentation

◆ buildOctreeDataStructure()

bool oofem::OctreeSpatialLocalizer::buildOctreeDataStructure ( )
protected

Builds the underlying octree data structure. The desired tree level is determined by following rules:

  • if number of nodes exceed threshold, cell is subdivided.
  • there is maximal octree level.
  • in current implementation, the neighbor cell size difference is allowed to be > 2.

Definition at line 238 of file octreelocalizer.C.

References oofem::FloatArray::add(), oofem::FloatArray::at(), oofem::SpatialLocalizer::domain, elementIPListsInitialized, elementListsInitialized, oofem::Timer::getUtime(), oofem::DofManager::giveCoordinates(), giveMaxTreeDepthFrom(), init(), insertNodeIntoOctree(), oofem::max(), oofem::min(), OCTREE_MAX_NODES_LIMIT, octreeMask, OOFEM_LOG_DEBUG, rootCell, oofem::Timer::startTimer(), oofem::Timer::stopTimer(), and oofem::FloatArray::times().

Referenced by init().

◆ findTerminalContaining()

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

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

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

◆ giveAllElementsWithIpWithinBox() [1/2]

void oofem::OctreeSpatialLocalizer::giveAllElementsWithIpWithinBox ( elementContainerType & elemSet,
const FloatArray & coords,
const double radius )
inlineoverridevirtual

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

References giveAllElementsWithIpWithinBox().

Referenced by giveAllElementsWithIpWithinBox(), giveClosestIP(), and giveClosestIP().

◆ giveAllElementsWithIpWithinBox() [2/2]

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

◆ giveAllElementsWithIpWithinBox_EvenIfEmpty() [1/2]

void oofem::OctreeSpatialLocalizer::giveAllElementsWithIpWithinBox_EvenIfEmpty ( elementContainerType & elemSet,
const FloatArray & coords,
const double radius )
inlineoverridevirtual

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

References giveAllElementsWithIpWithinBox_EvenIfEmpty().

Referenced by giveAllElementsWithIpWithinBox(), and giveAllElementsWithIpWithinBox_EvenIfEmpty().

◆ giveAllElementsWithIpWithinBox_EvenIfEmpty() [2/2]

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

◆ giveAllNodesWithinBox()

void oofem::OctreeSpatialLocalizer::giveAllNodesWithinBox ( nodeContainerType & nodeList,
const FloatArray & coords,
const double radius )
overridevirtual

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

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

◆ giveClassName()

const char * oofem::OctreeSpatialLocalizer::giveClassName ( ) const
inlineoverridevirtual

Implements oofem::SpatialLocalizer.

Definition at line 242 of file octreelocalizer.h.

◆ giveClosestIP() [1/2]

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

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

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

◆ giveClosestIP() [2/2]

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

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

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

◆ giveClosestIPWithinOctant() [1/2]

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

References oofem::Element::computeGlobalCoordinates(), oofem::distance(), oofem::SpatialLocalizer::domain, oofem::Element_remote, oofem::OctantRec::giveChild(), giveClosestIPWithinOctant(), oofem::Element::giveDefaultIntegrationRulePtr(), 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(), giveClosestIP(), giveClosestIPWithinOctant(), and giveClosestIPWithinOctant().

◆ giveClosestIPWithinOctant() [2/2]

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

References oofem::Element::computeGlobalCoordinates(), oofem::distance(), oofem::SpatialLocalizer::domain, oofem::Element_remote, oofem::OctantRec::giveChild(), giveClosestIPWithinOctant(), oofem::Element::giveDefaultIntegrationRulePtr(), 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().

◆ giveElementClosestToPoint()

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

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

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

◆ giveElementClosestToPointWithinOctant()

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

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

Referenced by giveElementClosestToPoint().

◆ giveElementContainingPoint() [1/4]

Element * oofem::OctreeSpatialLocalizer::giveElementContainingPoint ( const FloatArray & coords,
const IntArray * regionList = nullptr )
overridevirtual

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

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

Referenced by giveElementContainingPoint(), giveElementContainingPoint(), giveElementContainingPoint(), and giveElementContainingPoint().

◆ giveElementContainingPoint() [2/4]

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

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

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

◆ giveElementContainingPoint() [3/4]

Element * oofem::OctreeSpatialLocalizer::giveElementContainingPoint ( OctantRec & cell,
const FloatArray & coords,
OctantRec * scannedChild = nullptr,
const IntArray * regionList = nullptr )
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 605 of file octreelocalizer.C.

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

◆ giveElementContainingPoint() [4/4]

Element * oofem::OctreeSpatialLocalizer::giveElementContainingPoint ( OctantRec & cell,
const FloatArray & coords,
OctantRec * scannedChild = nullptr,
const Set * elset = nullptr )
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 660 of file octreelocalizer.C.

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

◆ giveElementsWithIPWithinBox()

void oofem::OctreeSpatialLocalizer::giveElementsWithIPWithinBox ( elementContainerType & elemSet,
OctantRec & currentCell,
const FloatArray & coords,
const double radius,
bool iCohesiveZoneGP = false )
protected

Returns container (set) of elements having integration point within given box and given root cell.

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

Definition at line 1313 of file octreelocalizer.C.

References oofem::Element::computeGlobalCoordinates(), oofem::distance(), oofem::SpatialLocalizer::domain, oofem::IntArray::findSorted(), oofem::OctantRec::giveChild(), oofem::Element::giveDefaultIntegrationRulePtr(), giveElementsWithIPWithinBox(), oofem::OctantRec::giveIPElementList(), oofem::IntArray::insertSortedOnce(), oofem::OctantRec::isTerminalOctant(), oofem::XfemElementInterface::mpCZIntegrationRules, octreeMask, and OOFEM_ERROR.

Referenced by giveAllElementsWithIpWithinBox_EvenIfEmpty(), and giveElementsWithIPWithinBox().

◆ giveListOfTerminalCellsInBoundingBox()

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

References oofem::OctantRec::giveChild(), giveListOfTerminalCellsInBoundingBox(), oofem::OctantRec::isTerminalOctant(), octreeMask, and oofem::OctantRec::testBoundingBox().

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

◆ giveMaxTreeDepthFrom()

int oofem::OctreeSpatialLocalizer::giveMaxTreeDepthFrom ( OctantRec & root)
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.
Returns
The maximum depth in the tree from the given root

Definition at line 1499 of file octreelocalizer.C.

References oofem::OctantRec::giveChild(), giveMaxTreeDepthFrom(), and octreeMask.

Referenced by buildOctreeDataStructure(), and giveMaxTreeDepthFrom().

◆ giveNodeClosestToPoint()

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

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

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

◆ giveNodeClosestToPointWithinOctant()

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

References oofem::distance_square(), oofem::SpatialLocalizer::domain, oofem::DofManager::giveCoordinates(), and oofem::OctantRec::giveNodeList().

Referenced by giveNodeClosestToPoint().

◆ giveNodesWithinBox()

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

References oofem::distance(), oofem::SpatialLocalizer::domain, oofem::OctantRec::giveChild(), oofem::OctantRec::giveNodeList(), giveNodesWithinBox(), oofem::OctantRec::isTerminalOctant(), and octreeMask.

Referenced by giveAllNodesWithinBox(), and giveNodesWithinBox().

◆ giveOctreeMaskValue()

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

References octreeMask.

◆ init()

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

Initialize receiver data structure if not done previously. Current implementation calls and returns the buildOctreeDataStructure service response.

Reimplemented from oofem::SpatialLocalizer.

Definition at line 1543 of file octreelocalizer.C.

References buildOctreeDataStructure(), elementIPListsInitialized, elementListsInitialized, initialized, OOFEM_LOG_INFO, and rootCell.

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

◆ initElementDataStructure()

void oofem::OctreeSpatialLocalizer::initElementDataStructure ( int region = 0)
protected

◆ initElementIPDataStructure()

◆ insertElementIntoOctree()

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

References oofem::FloatArray::at(), oofem::IntArray::at(), oofem::FloatArray::giveSize(), insertElementIntoOctree(), octreeMask, and rootCell.

Referenced by initElementDataStructure(), and insertElementIntoOctree().

◆ insertElementsUsingNodalConnectivitiesIntoOctree()

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

References oofem::OctantRec::addElementIP(), oofem::SpatialLocalizer::domain, oofem::OctantRec::giveChild(), oofem::OctantRec::giveNodeList(), insertElementsUsingNodalConnectivitiesIntoOctree(), oofem::OctantRec::isTerminalOctant(), and octreeMask.

Referenced by insertElementsUsingNodalConnectivitiesIntoOctree().

◆ insertIPElementIntoOctree()

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

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

Referenced by initElementIPDataStructure().

◆ insertNodeIntoOctree()

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

References oofem::OctantRec::addNode(), oofem::OctantRec::deleteNodeList(), oofem::OctantRec::divideLocally(), oofem::SpatialLocalizer::domain, findTerminalContaining(), oofem::OctantRec::giveCellDepth(), oofem::OctantRec::giveChildContainingPoint(), oofem::DofManager::giveCoordinates(), oofem::OctantRec::giveNodeList(), insertNodeIntoOctree(), OCTREE_MAX_DEPTH, OCTREE_MAX_NODES_LIMIT, octreeMask, OOFEM_ERROR, and rootCell.

Referenced by buildOctreeDataStructure(), and insertNodeIntoOctree().

Member Data Documentation

◆ elementIPListsInitialized

bool oofem::OctreeSpatialLocalizer::elementIPListsInitialized
protected

Flag indicating elementIP tables are initialized.

Definition at line 200 of file octreelocalizer.h.

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

◆ elementListsInitialized

IntArray oofem::OctreeSpatialLocalizer::elementListsInitialized
protected

Definition at line 201 of file octreelocalizer.h.

Referenced by buildOctreeDataStructure(), init(), and initElementDataStructure().

◆ initialized

bool oofem::OctreeSpatialLocalizer::initialized
protected

Definition at line 202 of file octreelocalizer.h.

Referenced by init(), and OctreeSpatialLocalizer().

◆ octreeMask

◆ rootCell


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