9 #if !defined(KRATOS_POINT_POINT_SEARCH_H_INCLUDED)
10 #define KRATOS_POINT_POINT_SEARCH_H_INCLUDED
34 #define KRATOS_TIMER_START(t) Timer::Start(t);
35 #define KRATOS_TIMER_STOP(t) Timer::Stop(t);
37 #define KRATOS_TIMER_START(t)
38 #define KRATOS_TIMER_STOP(t)
109 int max_n_of_neigh_nodes = r_nodes_to_find.size();
117 std::map<Point::Pointer, Node::Pointer> map_point_to_node;
119 nodes_temp.reserve(nodes.size());
121 for (NodesContainerType::ContainerType::iterator it = nodes.begin(); it != nodes.end(); ++it){
122 auto p_point = std::make_shared<Point>((*it)->Coordinates());
123 nodes_temp.push_back(p_point);
126 nodes_to_find_temp.reserve(nodes_to_find.size());
128 for (
auto it = nodes_to_find.begin(); it != nodes_to_find.end(); ++it){
129 auto p_point = std::make_shared<Point>((*it)->Coordinates());
130 nodes_to_find_temp.push_back(p_point);
131 map_point_to_node[p_point] = *it;
134 PointBinsType bins(nodes_to_find_temp.begin(), nodes_to_find_temp.end());
139 DistanceType local_results_distances(max_n_of_neigh_nodes);
140 std::size_t n_of_results = 0;
143 for (
int i = 0; i < static_cast<int>(nodes.size()); ++
i){
145 DistanceType::iterator i_distances_results_begin = local_results_distances.begin();
149 r_results[
i].reserve(n_of_results);
152 r_results[
i].push_back(map_point_to_node[ *it ]);
155 r_results_distances[
i].insert(r_results_distances[
i].begin(), local_results_distances.begin(), local_results_distances.begin() + n_of_results);
163 virtual std::string
Info()
const override
165 std::stringstream buffer;
166 buffer <<
"PointPointSearch" ;
172 virtual void PrintInfo(std::ostream& rOStream)
const override {rOStream <<
"PointPointSearch";}
175 virtual void PrintData(std::ostream& rOStream)
const override {}
Short class definition.
Definition: bins_dynamic_objects.h:57
virtual SizeType SearchObjectsInRadiusExclusive(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results)
Definition: bins_dynamic_objects.h:368
Point class.
Definition: point.h:59
Short class definition.
Definition: point_point_search.h:68
PointType * PointPointerType
Definition: point_point_search.h:76
double * DistanceVector
Definition: point_point_search.h:80
PointerVectorSet< Point, IndexedObject > PointSetType
Definition: point_point_search.h:87
PointPointSearch()
Default constructor.
Definition: point_point_search.h:95
~PointPointSearch()
Destructor.
Definition: point_point_search.h:98
virtual std::string Info() const override
Turn back information as a string.
Definition: point_point_search.h:163
void SearchPointsImplementation(NodesContainerType const &r_nodes, NodesContainerType const &r_nodes_to_find, RadiusArrayType const &radius, VectorResultNodesContainerType &r_results, VectorDistanceType &r_results_distances)
Definition: point_point_search.h:100
BinsObjectDynamic< PointConfigureType > PointBinsType
Definition: point_point_search.h:86
double * DistanceIterator
Definition: point_point_search.h:81
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: point_point_search.h:172
std::vector< PointPointerType >::iterator PointIterator
Definition: point_point_search.h:78
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: point_point_search.h:175
PointConfigure< 3 > PointConfigureType
Definition: point_point_search.h:84
KRATOS_CLASS_POINTER_DEFINITION(PointPointSearch)
Pointer definition of PointPointSearch.
std::vector< PointPointerType > * PointVector
Definition: point_point_search.h:77
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
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
TContainerType ContainerType
Definition: pointer_vector_set.h:90
This class is used to search for elements, conditions and nodes in a given model part.
Definition: spatial_search.h:50
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
ModelPart::NodesContainerType NodesContainerType
Nodes classes.
Definition: spatial_search.h:80
std::vector< double > DistanceType
Definition: spatial_search.h:96
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
float radius
Definition: mesh_to_mdpa_converter.py:18
integer i
Definition: TensorModule.f:17
Configure::ContainerType ContainerType
Definition: transfer_utility.h:247