58 r = elem->giveRegionNumber();
64 for (
int i = 1; i <= nregion; i++ ) {
70 for (
int i = 1; i <= nelem; i++ ) {
85 if ( regionList && ( regionList->
findFirstIndexOf( elem->giveRegionNumber() ) == 0 ) ) {
89 if ( interface->SpatialLocalizerI_BBoxContainsPoint(coords) == 0 ) {
93 if ( interface->SpatialLocalizerI_containsPoint(coords) ) {
115 for (
int ielem = 1; ielem <= elems.
giveSize(); ielem++ ) {
120 if ( answer == NULL || ( currDist < dist && currDist >= 0.0 ) ) {
122 lcoords = el_lcoords;
133 for (
int ielem = 1; ielem <= nelems; ielem++ ) {
142 if ( answer == NULL || ( currDist < dist && currDist >= 0.0 ) ) {
144 lcoords = el_lcoords;
162 double minDist = 0.0;
166 for (
auto &elem : this->
giveDomain()->giveElements() ) {
167 if ( ( region < 0 ) || ( region == elem->giveRegionNumber() ) ) {
168 for (
GaussPoint *jGp: *elem->giveDefaultIntegrationRulePtr() ) {
169 if ( elem->computeGlobalCoordinates( jGpCoords, jGp->giveNaturalCoordinates() ) ) {
170 double distance = coords.
distance(jGpCoords);
171 if ( answer == NULL || distance < minDist ) {
191 for (
int i = 1; i <= nelem; i++ ) {
195 double currDist = coords.
distance(jGpCoords);
196 if ( currDist <= radius ) {
209 for (
int i = 1; i <= nnode; i++ ) {
211 Node *inode =
dynamic_cast< Node *
>(idofman);
212 if ( inode != NULL ) {
214 nodeSet.push_back(i);
224 Node *closest = NULL;
226 for (
auto &dman : this->
giveDomain()->giveDofManagers() ) {
230 if ( closest == NULL || dist < maxdist ) {
236 return maxdist > maxDist ? closest : NULL;
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
void zero()
Sets all component to zero.
void clear()
Clears receiver (zero size).
bool insertSortedOnce(int value, int allocChunk=0)
Inserts given value into a receiver, which is assumed to be sorted.
Abstract base class for all finite elements.
Base class for dof managers.
virtual void giveAllNodesWithinBox(nodeContainerType &nodeList, const FloatArray &coords, const double radius)
Returns container (list) of all domain nodes within given box.
int giveNumberOfElements() const
Returns number of elements in domain.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
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)
Domain * domain
Link to domain object.
virtual Element * giveElementClosestToPoint(FloatArray &lcoords, FloatArray &closest, const FloatArray &coords, int region=0)
Returns the element closest to a given point.
std::list< int > nodeContainerType
Typedefs to introduce the container type for nodal numbers, returned by some services.
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
virtual double SpatialLocalizerI_giveClosestPoint(FloatArray &lcoords, FloatArray &closest, const FloatArray &gcoords)
Gives the closest point on the element.
std::vector< IntArray > region_elements
Element * giveElement(int n)
Service for accessing particular domain fe element.
virtual GaussPoint * giveClosestIP(const FloatArray &coords, int region, bool iCohesiveZoneGP=false)
Returns the integration point in associated domain, which is closest to given point.
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=NULL)
Returns the element, containing given point and belonging to one of the region in region list...
virtual Node * giveNodeClosestToPoint(const FloatArray &coords, double maxDist)
Returns the node closest to the given coordinate.
Class representing vector of real numbers.
virtual void giveAllElementsWithIpWithinBox(elementContainerType &elemSet, const FloatArray &coords, const double radius)
Returns container (set) of all domain elements having integration point within given box...
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
int giveNumberOfRegions() const
Returns number of regions. Currently regions corresponds to cross section models. ...
The spatial localizer element interface associated to spatial localizer.
virtual FloatArray * giveCoordinates()
std::vector< std::unique_ptr< Element > > & giveElements()
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class implementing node in finite element mesh.
Domain * giveDomain()
Returns the domain that localizer acts on.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Class representing integration point in finite element program.
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element's local coordinates.
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.