51 template<std::
size_t dim,
class T>
59 double tmp1 = p1[0] - p2[0];
60 double tmp2 = p1[1] - p2[1];
61 double tmp3 = p1[2] - p2[2];
63 dist += tmp1*tmp1 + tmp2*tmp2 + tmp3*tmp3;
71 template<std::
size_t Dimension>
80 for(std::size_t
i = 0;
i < Dimension;
i++)
81 coord[
i] = baseElem->GetGeometry()[0][
i];
88 void Initialize(Element::Pointer baseElem,
double Radius)
90 for(std::size_t
i = 0;
i < Dimension;
i++)
91 coord[
i] = baseElem->GetGeometry()[0][
i];
110 for(std::size_t
i = 0;
i < Dimension;
i++)
115 template< std::
size_t Dimension >
117 for(std::size_t
i = 0 ;
i < Dimension ;
i++)
118 rOut << rPoint[
i] <<
" ";
122 template< std::
size_t Dimension >
124 for(std::size_t
i = 0 ;
i < Dimension ;
i++)
130 template<
class TDerived >
163 DEMSearch(
const double domain_min_x = 0.0,
const double domain_min_y = 0.0,
const double domain_min_z = 0.0,
164 const double domain_max_x = -1.0,
const double domain_max_y = -1.0,
const double domain_max_z = -1.0)
172 TDerived::ElementConfigureType::SetDomain(domain_min_x, domain_min_y, domain_min_z, domain_max_x, domain_max_y, domain_max_z);
173 TDerived::NodeConfigureType::SetDomain(domain_min_x, domain_min_y, domain_min_z, domain_max_x, domain_max_y, domain_max_z);
198 static_cast<TDerived*
>(
this)->SearchElementsInRadiusExclusiveImplementation(StructureElements,InputElements,Radius,rResults,rResultsDistance);
208 static_cast<TDerived*
>(
this)->SearchElementsInRadiusInclusiveImplementation(StructureElements,InputElements,Radius,rResults,rResultsDistance);
217 static_cast<TDerived*
>(
this)->SearchElementsInRadiusExclusiveImplementation(StructureElements,InputElements,Radius,rResults);
226 static_cast<TDerived*
>(
this)->SearchElementsInRadiusInclusiveImplementation(StructureElements,InputElements,Radius,rResults);
236 static_cast<TDerived*
>(
this)->SearchNodesInRadiusExclusiveImplementation(StructureNodes,InputNodes,Radius,rResults,rResultsDistance);
246 static_cast<TDerived*
>(
this)->SearchNodesInRadiusInclusiveImplementation(StructureNodes,InputNodes,Radius,rResults,rResultsDistance);
255 static_cast<TDerived*
>(
this)->SearchNodesInRadiusExclusiveImplementation(StructureNodes,InputNodes,Radius,rResults);
264 static_cast<TDerived*
>(
this)->SearchNodesInRadiusInclusiveImplementation(StructureNodes,InputNodes,Radius,rResults);
274 static_cast<TDerived*
>(
this)->SearchGeometricalInRadiusExclusiveImplementation(StructureElements,InputConditions,Radius,rResults,rResultsDistance);
284 static_cast<TDerived*
>(
this)->SearchGeometricalInRadiusInclusiveImplementation(StructureElements,InputConditions,Radius,rResults,rResultsDistance);
294 static_cast<TDerived*
>(
this)->SearchGeometricalInRadiusExclusiveImplementation(StructureElements,InputElements,Radius,rResults,rResultsDistance);
304 static_cast<TDerived*
>(
this)->SearchGeometricalInRadiusInclusiveImplementation(StructureElements,InputElements,Radius,rResults,rResultsDistance);
322 virtual std::string
Info()
const override
324 std::stringstream buffer;
325 buffer <<
"DemSearch" ;
331 virtual void PrintInfo(std::ostream& rOStream)
const override {rOStream <<
"DemSearch";}
334 virtual void PrintData(std::ostream& rOStream)
const override {}
Definition: dem_search.h:132
void SearchElementsOverConditionsInRadiusInclusive(ConditionsContainerType const &StructureElements, ElementsContainerType const &InputElements, const RadiusArrayType &Radius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance) override
Definition: dem_search.h:297
bool mDomainPeriodicity
Definition: dem_search.h:367
void SearchNodesInRadiusInclusive(NodesContainerType const &StructureNodes, NodesContainerType const &InputNodes, const RadiusArrayType &Radius, VectorResultNodesContainerType &rResults) override
Definition: dem_search.h:258
std::vector< PtrPointType > * PointVector
Definition: dem_search.h:142
RadiusPoint< Dimension > PointType
Definition: dem_search.h:140
void SearchNodesInRadiusInclusive(NodesContainerType const &StructureNodes, NodesContainerType const &InputNodes, const RadiusArrayType &Radius, VectorResultNodesContainerType &rResults, VectorDistanceType &rResultsDistance) override
Definition: dem_search.h:239
void SearchElementsInRadiusExclusive(ElementsContainerType const &StructureElements, ElementsContainerType const &InputElements, const RadiusArrayType &Radius, VectorResultElementsContainerType &rResults) override
Definition: dem_search.h:211
PointType * PtrPointType
Definition: dem_search.h:141
KRATOS_CLASS_POINTER_DEFINITION(DEMSearch)
Pointer definition of DEMSearch.
void SearchElementsInRadiusExclusive(ElementsContainerType const &StructureElements, ElementsContainerType const &InputElements, const RadiusArrayType &Radius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance) override
Definition: dem_search.h:191
array_1d< double, 3 > mDomainMax
Definition: dem_search.h:369
PointVector searchPoints
Definition: dem_search.h:144
virtual ~DEMSearch()
Destructor.
Definition: dem_search.h:179
void SearchNodesInRadiusExclusive(NodesContainerType const &StructureNodes, NodesContainerType const &InputNodes, const RadiusArrayType &Radius, VectorResultNodesContainerType &rResults, VectorDistanceType &rResultsDistance) override
Definition: dem_search.h:229
void SearchConditionsOverElementsInRadiusExclusive(ElementsContainerType const &StructureElements, ConditionsContainerType const &InputConditions, const RadiusArrayType &Radius, VectorResultConditionsContainerType &rResults, VectorDistanceType &rResultsDistance)
Definition: dem_search.h:267
void SearchElementsInRadiusInclusive(ElementsContainerType const &StructureElements, ElementsContainerType const &InputElements, const RadiusArrayType &Radius, VectorResultElementsContainerType &rResults)
Definition: dem_search.h:220
array_1d< double, 3 > mDomainMin
Definition: dem_search.h:368
virtual std::string Info() const override
Turn back information as a string.
Definition: dem_search.h:322
void SearchNodesInRadiusExclusive(NodesContainerType const &StructureNodes, NodesContainerType const &InputNodes, const RadiusArrayType &Radius, VectorResultNodesContainerType &rResults) override
Definition: dem_search.h:249
DEMSearch(const double domain_min_x=0.0, const double domain_min_y=0.0, const double domain_min_z=0.0, const double domain_max_x=-1.0, const double domain_max_y=-1.0, const double domain_max_z=-1.0)
Default constructor.
Definition: dem_search.h:163
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: dem_search.h:334
void SearchElementsInRadiusInclusive(ElementsContainerType const &StructureElements, ElementsContainerType const &InputElements, const RadiusArrayType &Radius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance)
Definition: dem_search.h:201
void SearchElementsOverConditionsInRadiusExclusive(ConditionsContainerType const &StructureElements, ElementsContainerType const &InputElements, const RadiusArrayType &Radius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance) override
Definition: dem_search.h:287
void SearchConditionsOverElementsInRadiusInclusive(ElementsContainerType const &StructureElements, ConditionsContainerType const &InputConditions, const RadiusArrayType &Radius, VectorResultConditionsContainerType &rResults, VectorDistanceType &rResultsDistance)
Definition: dem_search.h:277
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: dem_search.h:331
Short class definition.
Definition: dem_search.h:53
double operator()(T const &p1, T const &p2)
Definition: dem_search.h:55
Point class.
Definition: point.h:59
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
Definition: dem_search.h:73
double mRadius
Definition: dem_search.h:100
void Initialize(Element::Pointer baseElem)
Definition: dem_search.h:78
Element::Pointer pNaseElem
Definition: dem_search.h:107
void Initialize(Element::Pointer baseElem, double Radius)
Definition: dem_search.h:88
double coord[Dimension]
Definition: dem_search.h:102
double const & operator[](std::size_t i) const
Definition: dem_search.h:105
void operator=(Point const &Other)
Definition: dem_search.h:109
virtual ~RadiusPoint()
Definition: dem_search.h:76
double & operator[](std::size_t i)
Definition: dem_search.h:104
RadiusPoint()
Definition: dem_search.h:75
This class is used to search for elements, conditions and nodes in a given model part.
Definition: spatial_search.h:50
virtual void SearchNodesInRadiusInclusive(ModelPart &rModelPart, const RadiusArrayType &rRadius, VectorResultNodesContainerType &rResults, VectorDistanceType &rResultsDistance)
Search neighbours for every node in "rModelpart" including itself.
Definition: spatial_search.cpp:315
std::vector< ResultConditionsContainerType > VectorResultConditionsContainerType
Definition: spatial_search.h:92
std::vector< double > RadiusArrayType
Input/output types.
Definition: spatial_search.h:95
std::vector< DistanceType > VectorDistanceType
Definition: spatial_search.h:97
std::vector< ResultNodesContainerType > VectorResultNodesContainerType
Definition: spatial_search.h:82
std::vector< ResultElementsContainerType > VectorResultElementsContainerType
Definition: spatial_search.h:87
virtual void SearchElementsOverConditionsInRadiusExclusive(ModelPart &rModelPart, const RadiusArrayType &rRadius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance)
Search neighbours for every element in "rModelpart" excluding itself.
Definition: spatial_search.cpp:809
virtual void SearchElementsOverConditionsInRadiusInclusive(ModelPart &rModelPart, const RadiusArrayType &rRadius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance)
Search neighbours for every element in "rModelpart" excluding itself.
Definition: spatial_search.cpp:854
virtual void SearchNodesInRadiusExclusive(ModelPart &rModelPart, const RadiusArrayType &rRadius, VectorResultNodesContainerType &rResults, VectorDistanceType &rResultsDistance)
Search neighbours for every node in "rModelpart" excluding itself.
Definition: spatial_search.cpp:255
virtual void SearchElementsInRadiusInclusive(ModelPart &rModelPart, const RadiusArrayType &rRadius, VectorResultNodesContainerType &rResults, VectorDistanceType &rResultsDistance)
Search neighbours for every element in "rModelpart" including itself.
Definition: spatial_search.cpp:83
virtual void SearchConditionsOverElementsInRadiusExclusive(ModelPart &rModelPart, const RadiusArrayType &rRadius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance)
Search neighbours for every element in "rModelpart" excluding itself.
Definition: spatial_search.cpp:719
virtual void SearchElementsInRadiusExclusive(ModelPart &rModelPart, const RadiusArrayType &rRadius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance)
Search neighbours for every element in "rModelpart" excluding itself.
Definition: spatial_search.cpp:23
virtual void SearchConditionsOverElementsInRadiusInclusive(ModelPart &rModelPart, const RadiusArrayType &rRadius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance)
Search neighbours for every element in "rModelpart" excluding itself.
Definition: spatial_search.cpp:764
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
float dist
Definition: edgebased_PureConvection.py:89
integer i
Definition: TensorModule.f:17