35 #ifndef octreelocalizer_h 36 #define octreelocalizer_h 51 class OctreeSpatialLocalizer;
53 #define OCTREE_MAX_NODES_LIMIT 10 54 #define OCTREE_MAX_DEPTH 15 114 OctantRec *giveChild(
int xi,
int yi,
int zi);
127 bool isTerminalOctant();
129 std :: list< int > &giveNodeList();
133 std :: list< int > &giveElementList(
int region);
140 void divideLocally(
int level,
const IntArray &octantMask);
158 void addElement(
int region,
int elementNum) { this->giveElementList(region).push_back(elementNum); }
163 void addNode(
int nodeNum) { this->giveNodeList().push_back(nodeNum); }
171 void printYourself();
173 std :: string
errorInfo(
const char *func)
const {
return std :: string(
"OctantRec") + func; }
213 virtual int init(
bool force =
false);
218 virtual GaussPoint *giveClosestIP(
const FloatArray &coords,
int region,
bool iCohesiveZoneGP =
false);
222 virtual void giveAllElementsWithIpWithinBox_EvenIfEmpty(
elementContainerType &elemSet,
const FloatArray &coords,
const double radius,
bool iCohesiveZoneGP);
225 virtual Node * giveNodeClosestToPoint(
const FloatArray &coords,
double maxDist);
227 virtual const char *
giveClassName()
const {
return "OctreeSpatialLocalizer"; }
237 bool buildOctreeDataStructure();
242 void initElementIPDataStructure();
246 void initElementDataStructure(
int region = 0);
272 void insertIPElementIntoOctree(
OctantRec *rootCell,
int elemNum,
const FloatArray &coords);
290 void insertElementsUsingNodalConnectivitiesIntoOctree(
OctantRec *rootCell);
299 const FloatArray &coords,
const double radius,
bool iCohesiveZoneGP =
false);
308 const FloatArray &coords,
const double radius);
318 void giveClosestIPWithinOctant(
OctantRec *currentCell,
320 int region,
double &dist,
GaussPoint **answer,
bool iCohesiveZoneGP);
329 void giveClosestIPWithinOctant(
OctantRec *currentCell,
331 Set &elemSet,
double &dist,
GaussPoint **answer,
bool iCohesiveZoneGP);
352 OctantRec *scannedChild = NULL,
const Set *elset = NULL);
372 void giveNodeClosestToPointWithinOctant(
OctantRec* cell,
const FloatArray &gcoords,
double &minDist,
Node * &answer);
381 void giveMaxTreeDepthFrom(
OctantRec *root,
int &maxDepth);
390 void giveListOfTerminalCellsInBoundingBox(std :: list< OctantRec * > &cellList,
const FloatArray &coords,
391 const double radius,
double innerRadius,
OctantRec *currentCell);
394 #endif // octreelocalizer_h The base class for all spatial localizers.
OctantRec * parent
Link to parent cell record.
The implementation of spatial localizer based on octree technique.
IntArray elementListsInitialized
std::list< int > nodeList
Octant node list.
OctreeSpatialLocalizer * localizer
Link to octree class.
virtual const char * giveClassName() const
bool insertSortedOnce(int value, int allocChunk=0)
Inserts given value into a receiver, which is assumed to be sorted.
FloatArray origin
Octant origin coordinates (lower corner)
int giveOctreeMaskValue(int indx)
Returns the octreeMask value given by the index.
Abstract base class for all finite elements.
void deleteNodeList()
Clears and deletes the nodeList.
Class representing the octant of octree.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
std::list< int > nodeContainerType
Typedefs to introduce the container type for nodal numbers, returned by some services.
Set of elements, boundaries, edges and/or nodes.
bool elementIPListsInitialized
Flag indicating elementIP tables are initialized.
OctantRec * rootCell
Root cell of octree.
IntArray octreeMask
Octree degenerate mask.
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...
void addElement(int region, int elementNum)
Adds given element to cell list of elements having IP within this cell.
Class representing vector of real numbers.
void addNode(int nodeNum)
Adds given Node to node list of nodes contained by receiver.
std::string errorInfo(const char *func) const
Error printing helper.
virtual void giveAllElementsWithIpWithinBox(elementContainerType &elemSet, const FloatArray &coords, const double radius)
Returns container (set) of all domain elements having integration point within given box...
double halfWidth
Octant size.
std::vector< std::list< int > > elementList
Element list of all elements close to the cell.
IntArray elementIPList
Element list, containing all elements having IP in cell.
const FloatArray & giveOrigin()
Gives the cell origin.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class implementing node in finite element mesh.
void addElementIP(int elementNum)
Adds given element to cell list of elements having IP within this cell.
Class representing integration point in finite element program.