Go to the documentation of this file.
44DummySpatialLocalizer :: init(
bool force)
52 int nregion = this->
domain->giveNumberOfRegions();
53 int nelem = this->
domain->giveNumberOfElements();
57 for (
auto &elem :
domain->giveElements() ) {
58 r = elem->giveRegionNumber();
64 for (
int i = 1; i <= nregion; i++ ) {
70 for (
int i = 1; i <= nelem; i++ ) {
80DummySpatialLocalizer :: giveElementContainingPoint(
const FloatArray &coords,
const IntArray *regionList)
82 for (
auto &elem :
domain->giveElements() ) {
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++ ) {
119 double currDist = interface->SpatialLocalizerI_giveClosestPoint(el_lcoords, el_coords, coords);
120 if ( answer == NULL || ( currDist < dist && currDist >= 0.0 ) ) {
122 lcoords = el_lcoords;
132 nelems = this->
giveDomain()->giveNumberOfElements();
133 for (
int ielem = 1; ielem <= nelems; ielem++ ) {
141 double currDist = interface->SpatialLocalizerI_giveClosestPoint(el_lcoords, el_coords, coords);
142 if ( answer == NULL || ( currDist < dist && currDist >= 0.0 ) ) {
144 lcoords = el_lcoords;
160DummySpatialLocalizer :: giveClosestIP(
const FloatArray &coords,
int region,
bool iCohesiveZoneGP)
162 double minDist = 0.0;
166 for (
auto &elem : this->
giveDomain()->giveElements() ) {
167 if ( ( region < 0 ) || ( region == elem->giveRegionNumber() ) ) {
168 for (
auto &jGp: *elem->giveDefaultIntegrationRulePtr() ) {
169 if ( elem->computeGlobalCoordinates( jGpCoords, jGp->giveNaturalCoordinates() ) ) {
170 double dist =
distance(coords, jGpCoords);
171 if ( answer ==
nullptr || dist < minDist ) {
190 nelem = this->
giveDomain()->giveNumberOfElements();
191 for (
int i = 1; i <= nelem; i++ ) {
195 double currDist =
distance(coords, jGpCoords);
196 if ( currDist <= radius ) {
208 int nnode = this->
giveDomain()->giveNumberOfDofManagers();
209 for (
int i = 1; i <= nnode; i++ ) {
211 Node *inode =
dynamic_cast< Node *
>(idofman);
214 nodeSet.push_back(i);
222DummySpatialLocalizer :: giveNodeClosestToPoint(
const FloatArray &coords,
double maxDist)
224 Node *closest =
nullptr;
226 for (
auto &dman : this->
giveDomain()->giveDofManagers() ) {
227 Node *node =
dynamic_cast< Node*
>( dman.get() );
230 if ( closest ==
nullptr || dist < maxdist ) {
236 return maxdist > maxDist ? closest :
nullptr;
const FloatArray & giveCoordinates() const
std ::vector< IntArray > region_elements
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
virtual Interface * giveInterface(InterfaceType t)
bool insertSortedOnce(int value, int allocChunk=0)
void zero()
Sets all component to zero.
int findFirstIndexOf(int value) const
Domain * domain
Link to domain object.
Domain * giveDomain()
Returns the domain that localizer acts on.
std ::list< int > nodeContainerType
Typedefs to introduce the container type for nodal numbers, returned by some services.
IntArray elementContainerType
Typedefs to introduce the container type for element numbers, returned by some services.
@ SpatialLocalizerInterfaceType
double distance(const FloatArray &x, const FloatArray &y)
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