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

The dummy implementation of spatial localizer based on traversing the whole domain. More...

#include <dummylocalizer.h>

+ Inheritance diagram for oofem::DummySpatialLocalizer:
+ Collaboration diagram for oofem::DummySpatialLocalizer:

Public Member Functions

 DummySpatialLocalizer (Domain *d)
 Constructor. More...
 
virtual ~DummySpatialLocalizer ()
 Destructor. More...
 
virtual int init (bool force=false)
 Initialize receiver data structure if not done previously If force is set to true, the initialization is enforced (useful if domain geometry has changed) 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 ElementgiveElementClosestToPoint (FloatArray &lcoords, FloatArray &closest, const FloatArray &coords, int region=0)
 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 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 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 ElementgiveElementContainingPoint (const FloatArray &coords, const Set &eset)=0
 Returns the element, containing given point and belonging to one of the region in region list. More...
 
virtual GaussPointgiveClosestIP (const FloatArray &coords, Set &elemSet, bool iCohesiveZoneGP=false)=0
 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)=0
 Returns container (set) of all domain elements having integration point within given box, even if this set is empty. 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 Attributes

std::vector< IntArrayregion_elements
 
bool initialized
 
- 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 dummy implementation of spatial localizer based on traversing the whole domain.

The basic task is to provide spatial information and localization for domain, to which receiver is associated. 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 51 of file dummylocalizer.h.

Constructor & Destructor Documentation

oofem::DummySpatialLocalizer::DummySpatialLocalizer ( Domain d)
inline

Constructor.

Definition at line 59 of file dummylocalizer.h.

virtual oofem::DummySpatialLocalizer::~DummySpatialLocalizer ( )
inlinevirtual

Destructor.

Definition at line 61 of file dummylocalizer.h.

Member Function Documentation

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

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 185 of file dummylocalizer.C.

References oofem::Element::computeGlobalCoordinates(), oofem::FloatArray::distance(), oofem::Element::giveDefaultIntegrationRulePtr(), oofem::SpatialLocalizer::giveDomain(), oofem::Domain::giveElement(), oofem::Domain::giveNumberOfElements(), and oofem::IntArray::insertSortedOnce().

void oofem::DummySpatialLocalizer::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 206 of file dummylocalizer.C.

References oofem::FloatArray::distance(), oofem::Node::giveCoordinates(), oofem::Domain::giveDofManager(), oofem::SpatialLocalizer::giveDomain(), and oofem::Domain::giveNumberOfDofManagers().

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

Implements oofem::SpatialLocalizer.

Definition at line 72 of file dummylocalizer.h.

GaussPoint * oofem::DummySpatialLocalizer::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 160 of file dummylocalizer.C.

References oofem::FloatArray::distance(), and oofem::SpatialLocalizer::giveDomain().

Element * oofem::DummySpatialLocalizer::giveElementClosestToPoint ( FloatArray lcoords,
FloatArray closest,
const FloatArray coords,
int  region = 0 
)
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 104 of file dummylocalizer.C.

References oofem::IntArray::at(), oofem::FloatArray::clear(), oofem::SpatialLocalizer::domain, oofem::SpatialLocalizer::giveDomain(), oofem::Domain::giveElement(), oofem::FEMComponent::giveInterface(), oofem::Domain::giveNumberOfElements(), oofem::Element::giveRegionNumber(), oofem::IntArray::giveSize(), region_elements, oofem::SpatialLocalizerInterface::SpatialLocalizerI_giveClosestPoint(), and oofem::SpatialLocalizerInterfaceType.

Element * oofem::DummySpatialLocalizer::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 80 of file dummylocalizer.C.

References oofem::SpatialLocalizer::domain, oofem::IntArray::findFirstIndexOf(), oofem::Domain::giveElements(), and oofem::SpatialLocalizerInterfaceType.

Node * oofem::DummySpatialLocalizer::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 222 of file dummylocalizer.C.

References oofem::FloatArray::distance(), oofem::Node::giveCoordinates(), and oofem::SpatialLocalizer::giveDomain().

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

Initialize receiver data structure if not done previously If force is set to true, the initialization is enforced (useful if domain geometry has changed)

Returns
Nonzero if successful.

Reimplemented from oofem::SpatialLocalizer.

Definition at line 44 of file dummylocalizer.C.

References oofem::IntArray::at(), oofem::SpatialLocalizer::domain, oofem::Domain::giveElement(), oofem::Domain::giveElements(), oofem::Domain::giveNumberOfElements(), oofem::Domain::giveNumberOfRegions(), oofem::Element::giveRegionNumber(), initialized, region_elements, and oofem::IntArray::zero().

Member Data Documentation

bool oofem::DummySpatialLocalizer::initialized
protected

Definition at line 55 of file dummylocalizer.h.

Referenced by init().

std :: vector< IntArray > oofem::DummySpatialLocalizer::region_elements
protected

Definition at line 54 of file dummylocalizer.h.

Referenced by giveElementClosestToPoint(), and init().


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