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

Functor for closest node search. More...

#include <octreelocalizert.h>

+ Inheritance diagram for oofem::ClosestNode:
+ Collaboration diagram for oofem::ClosestNode:

Public Member Functions

 ClosestNode (FloatArray *pos, Domain *d)
 Constructor. More...
 
 ~ClosestNode ()
 Destructor. More...
 
void giveStartingPosition (FloatArray &position)
 Gives the starting position of the search. More...
 
bool evaluate (int &nodeNr)
 Evaluates a node. More...
 
void giveResult (std::list< int > &answer)
 Gives the closest nodes. More...
 
bool isBBXStage1Defined (BoundingBox &BBXStage1)
 Stage1 means, we are looking for objects in a distance given by some boundingBox (e.g. More...
 
bool isBBXStage2Defined (BoundingBox &BBXStage2)
 Stage2BBX is given by results of a prior search. More...
 

Protected Attributes

FloatArraystartingPosition
 
Domaindomain
 
int CNindex
 
double distanceToClosestNode
 
bool initFlag
 
std::list< int > closestNodeIndices
 

Detailed Description

Functor for closest node search.

Author
David Krybus

Definition at line 650 of file octreelocalizert.h.

Constructor & Destructor Documentation

oofem::ClosestNode::ClosestNode ( FloatArray pos,
Domain d 
)
inline

Constructor.

Parameters
posStarting position of the search
dDomain containing nodes

Definition at line 667 of file octreelocalizert.h.

oofem::ClosestNode::~ClosestNode ( )
inline

Destructor.

Definition at line 673 of file octreelocalizert.h.

Member Function Documentation

bool oofem::ClosestNode::evaluate ( int &  nodeNr)
inlinevirtual

Evaluates a node.

The closest nodes are stored in a container, if their distance to starting position is the same. Is the distance smaller than previous one, the container is emptied and new node is added.

Parameters
nodeNrNumber of the node in the domain list
Returns
true after evaluation is processed.

Implements oofem::SL_Evaluation_Functor< int >.

Definition at line 690 of file octreelocalizert.h.

References oofem::FloatArray::distance(), oofem::Node::giveCoordinates(), and oofem::Domain::giveNode().

void oofem::ClosestNode::giveResult ( std::list< int > &  answer)
inlinevirtual

Gives the closest nodes.

Parameters
answerList containing numbers of the closest nodes

Implements oofem::SL_Evaluation_Functor< int >.

Definition at line 717 of file octreelocalizert.h.

void oofem::ClosestNode::giveStartingPosition ( FloatArray position)
inlinevirtual

Gives the starting position of the search.

Parameters
positionstartingPosition

Implements oofem::SL_Evaluation_Functor< int >.

Definition at line 679 of file octreelocalizert.h.

bool oofem::ClosestNode::isBBXStage1Defined ( BoundingBox BBXStage1)
inlinevirtual

Stage1 means, we are looking for objects in a distance given by some boundingBox (e.g.

IPs around some given coordinates)

Implements oofem::SL_Evaluation_Functor< int >.

Definition at line 721 of file octreelocalizert.h.

bool oofem::ClosestNode::isBBXStage2Defined ( BoundingBox BBXStage2)
inlinevirtual

Stage2BBX is given by results of a prior search.

e.g. We found a closest point to another point in an octant, BBX is defined by the distance from each other and the found closest point. Now we have to check surrounding octants whithin this bounding, which may contain points closer to starting point.

Implements oofem::SL_Evaluation_Functor< int >.

Definition at line 726 of file octreelocalizert.h.

References oofem::BoundingBox::setOrigin(), and oofem::BoundingBox::setSize().

Member Data Documentation

std :: list< int > oofem::ClosestNode::closestNodeIndices
protected

Definition at line 659 of file octreelocalizert.h.

int oofem::ClosestNode::CNindex
protected

Definition at line 655 of file octreelocalizert.h.

double oofem::ClosestNode::distanceToClosestNode
protected

Definition at line 656 of file octreelocalizert.h.

Domain* oofem::ClosestNode::domain
protected

Definition at line 654 of file octreelocalizert.h.

bool oofem::ClosestNode::initFlag
protected

Definition at line 657 of file octreelocalizert.h.

FloatArray* oofem::ClosestNode::startingPosition
protected

Definition at line 653 of file octreelocalizert.h.


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

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:34 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011