69 std::vector<std::vector<int>>
Ranks;
91 Ranks.shrink_to_fit();
135 static constexpr
double ZeroTolerance = std::numeric_limits<double>::epsilon();
153 template<
class TPo
intType>
160 const auto& r_max_point = rBoundingBox.
GetMaxPoint();
161 const auto& r_min_point = rBoundingBox.
GetMinPoint();
164 if (rCoords[0] < r_max_point[0] && rCoords[0] > r_min_point[0])
165 if (rCoords[1] < r_max_point[1] && rCoords[1] > r_min_point[1])
166 if (rCoords[2] < r_max_point[2] && rCoords[2] > r_min_point[2])
184 if (rCoords[0] < rBoundingBox[0] && rCoords[0] > rBoundingBox[1])
185 if (rCoords[1] < rBoundingBox[2] && rCoords[1] > rBoundingBox[3])
186 if (rCoords[2] < rBoundingBox[4] && rCoords[2] > rBoundingBox[5])
199 template<
class TPo
intType>
203 const double Tolerance
211 const double epsilon = std::numeric_limits<double>::epsilon();
212 if (
norm_2(max_point) > epsilon &&
norm_2(min_point) > epsilon) {
213 for (
unsigned int i=0;
i<3; ++
i) {
214 max_point[
i] += Tolerance;
215 min_point[
i] -= Tolerance;
220 if (rCoords[0] < max_point[0] && rCoords[0] > min_point[0])
221 if (rCoords[1] < max_point[1] && rCoords[1] > min_point[1])
222 if (rCoords[2] < max_point[2] && rCoords[2] > min_point[2])
234 const std::vector<double>& rBoundingBoxes,
235 const double Tolerance,
236 std::vector<double>& rBoundingBoxesWithTolerance
247 const std::vector<double>& rBoundingBoxes,
248 const double Tolerance,
249 std::vector<double>& rBoundingBoxesWithTolerance
261 template<
typename TPo
intIteratorType>
263 TPointIteratorType itPointBegin,
264 TPointIteratorType itPointEnd,
265 std::vector<double>& rAllPointsCoordinates,
266 std::vector<IndexType>& rAllPointsIds,
271 int number_of_points, total_number_of_points;
272 CalculateNumberOfPoints(itPointBegin, itPointEnd, number_of_points, total_number_of_points, rDataCommunicator);
275 KRATOS_DEBUG_ERROR_IF(total_number_of_points < 0) <<
"The total number of points is negative" << std::endl;
278 SynchronizePoints(itPointBegin, itPointEnd, rAllPointsCoordinates, rAllPointsIds, rDataCommunicator, number_of_points, total_number_of_points);
294 template<
typename TPo
intIteratorType,
typename TBoundingBoxType>
296 TPointIteratorType itPointBegin,
297 TPointIteratorType itPointEnd,
299 const TBoundingBoxType& rBoundingBox,
300 const double ThresholdBoundingBox,
302 const bool IndexItIsJustCounter =
false
306 int number_of_points, total_number_of_points;
307 CalculateNumberOfPoints(itPointBegin, itPointEnd, number_of_points, total_number_of_points, rDataCommunicator);
310 KRATOS_DEBUG_ERROR_IF(total_number_of_points < 0) <<
"The total number of points is negative" << std::endl;
313 return SynchronizePointsWithBoundingBox(itPointBegin, itPointEnd, rSearchInfo, rBoundingBox, ThresholdBoundingBox, rDataCommunicator, number_of_points, total_number_of_points, IndexItIsJustCounter);
327 template<
typename TPo
intIteratorType>
329 TPointIteratorType itPointBegin,
330 TPointIteratorType itPointEnd,
331 std::vector<double>& rAllPointsCoordinates,
332 std::vector<IndexType>& rAllPointsIds,
337 int number_of_points, total_number_of_points;
338 CalculateNumberOfPoints(itPointBegin, itPointEnd, number_of_points, total_number_of_points, rDataCommunicator);
341 KRATOS_DEBUG_ERROR_IF(total_number_of_points < 0) <<
"The total number of points is negative" << std::endl;
344 return SynchronizePoints(itPointBegin, itPointEnd, rAllPointsCoordinates, rAllPointsIds, rDataCommunicator, number_of_points, total_number_of_points);
359 template<
typename TPo
intIteratorType>
361 TPointIteratorType itPointBegin,
362 TPointIteratorType itPointEnd,
363 std::vector<double>& rAllPointsCoordinates,
364 std::vector<IndexType>& rAllPointsIds,
365 const std::vector<double>& rRadius,
370 int number_of_points, total_number_of_points;
371 CalculateNumberOfPoints(itPointBegin, itPointEnd, number_of_points, total_number_of_points, rDataCommunicator);
374 KRATOS_DEBUG_ERROR_IF(total_number_of_points < 0) <<
"The total number of points is negative" << std::endl;
377 const auto recv_sizes = SynchronizePoints(itPointBegin, itPointEnd, rAllPointsCoordinates, rAllPointsIds, rDataCommunicator, number_of_points, total_number_of_points);
381 return SynchronizeRadius(recv_sizes, rRadius, rDataCommunicator);
396 template<
class TContainer,
class TResultType>
397 static std::vector<typename PointObject<typename TContainer::value_type>::Pointer>
PrepareSearch(
398 const TContainer& rStructure,
399 const TContainer& rInput,
400 TResultType& rResults,
419 template<
class TContainer,
class TResultType>
421 const TContainer& rInput,
422 TResultType& rResults,
427 const std::size_t input_size = rInput.size();
428 if (rResults.size() != input_size) {
429 rResults.resize(input_size);
431 if (rResultsDistance.size() != input_size) {
432 rResultsDistance.resize(input_size);
441 template<
class TContainer>
442 static std::vector<typename PointObject<typename TContainer::value_type>::Pointer>
PreparePointsSearch(
const TContainer& rStructure)
445 using ObjectType =
typename TContainer::value_type;
452 const std::size_t structure_size = rStructure.
size();
453 points.reserve(structure_size);
454 const auto it_begin = rStructure.begin();
455 for (std::size_t
i = 0;
i < structure_size; ++
i) {
456 auto it = it_begin +
i;
475 template<
class TContainer,
class TSpatialContainer,
class TResultType>
477 const TContainer& rInput,
479 TSpatialContainer& rSearch,
480 TResultType& rResults,
482 const int AllocationSize = 1000
486 using ObjectType =
typename TContainer::value_type;
491 const std::size_t input_size = rInput.
size();
495 auto it = rInput.begin() +
i;
499 const std::size_t number_of_results = rSearch.SearchInRadius(aux_point, rRadius[
i], results.
begin(), results_distances.begin(), AllocationSize);
500 if (number_of_results > 0) {
501 auto& r_results = rResults[
i];
502 auto& r_results_distance = rResultsDistance[
i];
503 r_results.reserve(number_of_results);
504 r_results_distance.reserve(number_of_results);
505 for (std::size_t
j = 0;
j < number_of_results; ++
j) {
506 auto p_point = results[
j];
507 r_results.push_back(p_point->pGetObject());
508 r_results_distance.push_back(results_distances[
j]);
532 template<
typename TPo
intIteratorType>
533 static std::vector<int> SynchronizePoints(
534 TPointIteratorType itPointBegin,
535 TPointIteratorType itPointEnd,
536 std::vector<double>& rAllPointsCoordinates,
537 std::vector<IndexType>& rAllPointsIds,
539 const int NumberOfPoints,
540 const int TotalNumberOfPoints
544 const int world_size = rDataCommunicator.
Size();
545 const int rank = rDataCommunicator.
Rank();
548 std::vector<int> points_per_partition(world_size);
549 std::vector<int> send_points_per_partition(1, NumberOfPoints);
550 rDataCommunicator.AllGather(send_points_per_partition, points_per_partition);
551 std::size_t initial_id = 0;
552 if constexpr (!std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
553 initial_id = std::accumulate(points_per_partition.begin(), points_per_partition.begin() + rank, 0);
557 if (rAllPointsCoordinates.size() !=
static_cast<unsigned int>(TotalNumberOfPoints * 3)) {
558 rAllPointsCoordinates.resize(TotalNumberOfPoints * 3);
560 if (rAllPointsIds.size() !=
static_cast<unsigned int>(TotalNumberOfPoints)) {
561 rAllPointsIds.resize(TotalNumberOfPoints);
563 std::vector<int> recv_sizes(world_size, 0);
567 array_1d<double, 3> coordinates;
568 unsigned int i_coord;
573 std::vector<double> send_points_coordinates(NumberOfPoints * 3);
574 std::vector<IndexType> send_points_ids(NumberOfPoints);
575 for (
auto it_point = itPointBegin ; it_point != itPointEnd ; ++it_point) {
577 if constexpr (std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
578 if (it_point->FastGetSolutionStepValue(PARTITION_INDEX) != rank) {
582 noalias(coordinates) = it_point->Coordinates();
583 if constexpr (std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
584 send_points_ids[
counter] = it_point->Id();
588 for (i_coord = 0; i_coord < 3; ++i_coord) {
589 send_points_coordinates[3 *
counter + i_coord] = coordinates[i_coord];
597 for (
int i_rank = 0; i_rank < world_size; ++i_rank) {
598 recv_sizes[i_rank] = 3 * points_per_partition[i_rank];
600 std::vector<int> recv_offsets(world_size, 0);
601 for (
int i_rank = 1; i_rank < world_size; ++i_rank) {
602 recv_offsets[i_rank] = recv_offsets[i_rank - 1] + recv_sizes[i_rank - 1];
606 rDataCommunicator.AllGatherv(send_points_coordinates, rAllPointsCoordinates, recv_sizes, recv_offsets);
611 for (
int i_rank = 0; i_rank < world_size; ++i_rank) {
612 recv_sizes[i_rank] = points_per_partition[i_rank];
614 for (
int i_rank = 1; i_rank < world_size; ++i_rank) {
615 recv_offsets[i_rank] = recv_offsets[i_rank - 1] + recv_sizes[i_rank - 1];
619 rDataCommunicator.AllGatherv(send_points_ids, rAllPointsIds, recv_sizes, recv_offsets);
622 for (
auto it_point = itPointBegin ; it_point != itPointEnd ; ++it_point) {
623 noalias(coordinates) = it_point->Coordinates();
624 if constexpr (std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
625 rAllPointsIds[
counter] = it_point->Id();
629 for (i_coord = 0; i_coord < 3; ++i_coord) {
630 rAllPointsCoordinates[3 *
counter + i_coord] = coordinates[i_coord];
654 template<
typename TPo
intIteratorType>
655 static std::vector<int> SynchronizePointsWithRanks(
656 TPointIteratorType itPointBegin,
657 TPointIteratorType itPointEnd,
658 std::vector<double>& rAllPointsCoordinates,
659 std::vector<IndexType>& rAllPointsIds,
660 const DataCommunicator& rDataCommunicator,
661 const int NumberOfPoints,
662 const int TotalNumberOfPoints,
663 const bool IndexItIsJustCounter =
false
667 const auto GetIdNode = [](std::vector<IndexType>& rIds, TPointIteratorType& ItPoint,
const std::size_t Counter,
const std::size_t InitialId) {
668 if constexpr (std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
669 rIds[Counter] = ItPoint->Id();
671 rIds[Counter] = InitialId + Counter;
674 const auto GetIdJustCounter = [](std::vector<IndexType>& rIds, TPointIteratorType& ItPoint,
const std::size_t Counter,
const std::size_t InitialId) {
675 rIds[Counter] = Counter;
677 const auto GetId = IndexItIsJustCounter ? GetIdJustCounter : GetIdNode;
680 const int world_size = rDataCommunicator.Size();
681 const int rank = rDataCommunicator.Rank();
684 std::vector<int> points_per_partition(world_size);
685 std::vector<int> send_points_per_partition(1, NumberOfPoints);
686 std::vector<int> all_points_ranks(TotalNumberOfPoints);
687 rDataCommunicator.AllGather(send_points_per_partition, points_per_partition);
688 std::size_t initial_id = 0;
689 if constexpr (!std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
690 initial_id = std::accumulate(points_per_partition.begin(), points_per_partition.begin() + rank, 0);
694 if (rAllPointsCoordinates.size() !=
static_cast<std::size_t
>(TotalNumberOfPoints * 3)) {
695 rAllPointsCoordinates.resize(TotalNumberOfPoints * 3);
697 if (rAllPointsIds.size() !=
static_cast<std::size_t
>(TotalNumberOfPoints)) {
698 rAllPointsIds.resize(TotalNumberOfPoints);
700 std::vector<int> recv_sizes(world_size, 0);
704 unsigned int i_coord;
707 if (rDataCommunicator.IsDistributed()) {
709 std::vector<double> send_points_coordinates(NumberOfPoints * 3);
710 std::vector<IndexType> send_points_ids(NumberOfPoints);
711 std::vector<int> send_points_ranks(NumberOfPoints);
712 for (
auto it_point = itPointBegin ; it_point != itPointEnd ; ++it_point) {
714 if constexpr (std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
715 if (it_point->FastGetSolutionStepValue(PARTITION_INDEX) != rank) {
719 const auto& r_coordinates = it_point->Coordinates();
720 GetId(send_points_ids, it_point,
counter, initial_id);
721 send_points_ranks[
counter] = rank;
722 for (i_coord = 0; i_coord < 3; ++i_coord) {
723 send_points_coordinates[3 *
counter + i_coord] = r_coordinates[i_coord];
731 for (
int i_rank = 0; i_rank < world_size; ++i_rank) {
732 recv_sizes[i_rank] = 3 * points_per_partition[i_rank];
734 std::vector<int> recv_offsets(world_size, 0);
735 for (
int i_rank = 1; i_rank < world_size; ++i_rank) {
736 recv_offsets[i_rank] = recv_offsets[i_rank - 1] + recv_sizes[i_rank - 1];
740 rDataCommunicator.AllGatherv(send_points_coordinates, rAllPointsCoordinates, recv_sizes, recv_offsets);
745 for (
int i_rank = 0; i_rank < world_size; ++i_rank) {
746 recv_sizes[i_rank] = points_per_partition[i_rank];
748 for (
int i_rank = 1; i_rank < world_size; ++i_rank) {
749 recv_offsets[i_rank] = recv_offsets[i_rank - 1] + recv_sizes[i_rank - 1];
753 rDataCommunicator.AllGatherv(send_points_ids, rAllPointsIds, recv_sizes, recv_offsets);
754 rDataCommunicator.AllGatherv(send_points_ranks, all_points_ranks, recv_sizes, recv_offsets);
757 for (
auto it_point = itPointBegin ; it_point != itPointEnd ; ++it_point) {
758 const auto& r_coordinates = it_point->Coordinates();
759 if constexpr (std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
760 rAllPointsIds[
counter] = it_point->Id();
764 for (i_coord = 0; i_coord < 3; ++i_coord) {
765 rAllPointsCoordinates[3 *
counter + i_coord] = r_coordinates[i_coord];
772 return all_points_ranks;
792 template<
typename TPo
intIteratorType,
typename TBoundingBoxType>
793 static std::vector<IndexType> SynchronizePointsWithBoundingBox(
794 TPointIteratorType itPointBegin,
795 TPointIteratorType itPointEnd,
796 DistributedSearchInformation& rSearchInfo,
797 const TBoundingBoxType& rBoundingBox,
798 const double ThresholdBoundingBox,
799 const DataCommunicator& rDataCommunicator,
800 const int NumberOfPoints,
801 const int TotalNumberOfPoints,
802 const bool IndexItIsJustCounter =
false
806 rSearchInfo.Reserve(TotalNumberOfPoints);
807 std::vector<double> all_points_coordinates(TotalNumberOfPoints * 3);
808 std::vector<IndexType> all_points_ids(TotalNumberOfPoints);
811 std::vector<int> all_points_ranks = SynchronizePointsWithRanks(itPointBegin, itPointEnd, all_points_coordinates, all_points_ids, rDataCommunicator, NumberOfPoints, TotalNumberOfPoints, IndexItIsJustCounter);
817 if (rDataCommunicator.IsDistributed()) {
819 const int rank = rDataCommunicator.Rank();
820 const int world_size = rDataCommunicator.Size();
821 std::vector<int> ranks(1, rank);
822 std::vector<int> inside_ranks(world_size);
826 for (
IndexType i_point = 0; i_point < static_cast<IndexType>(TotalNumberOfPoints); ++i_point) {
827 point_to_test[0] = all_points_coordinates[3 * i_point + 0];
828 point_to_test[1] = all_points_coordinates[3 * i_point + 1];
829 point_to_test[2] = all_points_coordinates[3 * i_point + 2];
831 const int search_rank = all_points_ranks[i_point];
832 const bool to_be_included = is_inside || search_rank == rank;
833 inside_ranks.resize(world_size);
834 if (to_be_included) {
835 for (i_coord = 0; i_coord < 3; ++i_coord) {
836 rSearchInfo.PointCoordinates.push_back(all_points_coordinates[3 * i_point + i_coord]);
838 rSearchInfo.Indexes.push_back(all_points_ids[i_point]);
843 rDataCommunicator.AllGather(ranks, inside_ranks);
847 inside_ranks.begin(),
849 [](
const int rank) { return rank < 0; }
855 if (to_be_included) {
856 rSearchInfo.Ranks.push_back(inside_ranks);
857 rSearchInfo.SearchRanks.push_back(search_rank);
862 const std::size_t total_number_of_points = itPointEnd - itPointBegin;
863 for (
IndexType i_point = 0 ; i_point < total_number_of_points; ++i_point) {
864 auto it_point = itPointBegin + i_point;
866 const auto& r_coordinates = it_point->Coordinates();
867 for (i_coord = 0; i_coord < 3; ++i_coord) {
868 rSearchInfo.PointCoordinates.push_back(r_coordinates[i_coord]);
870 rSearchInfo.Indexes.push_back(all_points_ids[i_point]);
871 rSearchInfo.Ranks.push_back({0});
877 rSearchInfo.Shrink();
879 return all_points_ids;
889 static std::vector<double> SynchronizeRadius(
890 const std::vector<int>& rRecvSizes,
891 const std::vector<double>& rRadius,
892 const DataCommunicator& rDataCommunicator
896 const int total_number_of_points = std::accumulate(rRecvSizes.begin(), rRecvSizes.end(), 0);
899 if (total_number_of_points == 0) {
903 std::vector<double> all_points_radius(total_number_of_points);
906 const int world_size = rDataCommunicator.Size();
909 std::vector<int> recv_offsets(world_size, 0);
910 for (
int i_rank = 1; i_rank < world_size; ++i_rank) {
911 recv_offsets[i_rank] = recv_offsets[i_rank - 1] + rRecvSizes[i_rank - 1];
915 rDataCommunicator.AllGatherv(rRadius, all_points_radius, rRecvSizes, recv_offsets);
917 return all_points_radius;
930 template<
typename TPo
intIteratorType>
931 static void CalculateNumberOfPoints(
932 TPointIteratorType itPointBegin,
933 TPointIteratorType itPointEnd,
934 int& rNumberOfPoints,
935 int& rTotalNumberOfPoints,
936 const DataCommunicator& rDataCommunicator
940 rNumberOfPoints = std::distance(itPointBegin, itPointEnd);
943 if (rDataCommunicator.IsDistributed()) {
944 if constexpr (std::is_same<TPointIteratorType, ModelPart::NodeIterator>::value || std::is_same<TPointIteratorType, ModelPart::NodeConstantIterator>::value) {
946 const int rank = rDataCommunicator.Rank();
949 for (
auto it_node = itPointBegin; it_node < itPointEnd; ++it_node) {
950 if (it_node->FastGetSolutionStepValue(PARTITION_INDEX) != rank) {
957 rTotalNumberOfPoints = rDataCommunicator.SumAll(rNumberOfPoints);
959 rTotalNumberOfPoints = rNumberOfPoints;
Representing a bounding box by storing the min and max points.
Definition: bounding_box.h:39
TPointType & GetMinPoint()
Gets a reference to the minimum point.
Definition: bounding_box.h:179
TPointType & GetMaxPoint()
Gets a reference to the maximum point.
Definition: bounding_box.h:199
Serial (do-nothing) version of a wrapper class for MPI communication.
Definition: data_communicator.h:318
virtual int Size() const
Get the parallel size of this DataCommunicator.
Definition: data_communicator.h:597
virtual int Rank() const
Get the parallel rank for this DataCommunicator.
Definition: data_communicator.h:587
virtual bool IsDistributed() const
Check whether this DataCommunicator is aware of parallelism.
Definition: data_communicator.h:606
This class is useful for index iteration over containers.
Definition: parallel_utilities.h:451
void for_each(TUnaryFunction &&f)
Definition: parallel_utilities.h:514
Point class.
Definition: point.h:59
Custom Point container to be used by the search.
Definition: point_object.h:56
MPI utilities for searching geometrical objects.
Definition: search_utilities.h:115
static bool PointIsInsideBoundingBox(const BoundingBox< TPointType > &rBoundingBox, const array_1d< double, 3 > &rCoords)
Check if a point is inside a bounding box.
Definition: search_utilities.h:154
static std::vector< IndexType > SynchronousPointSynchronizationWithBoundingBox(TPointIteratorType itPointBegin, TPointIteratorType itPointEnd, DistributedSearchInformation &rSearchInfo, const TBoundingBoxType &rBoundingBox, const double ThresholdBoundingBox, const DataCommunicator &rDataCommunicator, const bool IndexItIsJustCounter=false)
SynchronousPointSynchronization prepares synchronously the coordinates of the points for MPI search.
Definition: search_utilities.h:295
static std::vector< typename PointObject< typename TContainer::value_type >::Pointer > PreparePointsSearch(const TContainer &rStructure)
This method prepares the points for search.
Definition: search_utilities.h:442
static bool PointIsInsideBoundingBox(const BoundingBoxType &rBoundingBox, const array_1d< double, 3 > &rCoords)
Check if a point is inside a bounding box.
Definition: search_utilities.h:178
static void ComputeBoundingBoxesWithToleranceCheckingNullBB(const std::vector< double > &rBoundingBoxes, const double Tolerance, std::vector< double > &rBoundingBoxesWithTolerance)
Compute the bounding boxes of the given bounding boxes from a given tolerance, additionally checking ...
Definition: search_utilities.cpp:51
std::array< double, 6 > BoundingBoxType
The Bounding Box type.
Definition: search_utilities.h:121
std::size_t SizeType
The size type definition.
Definition: search_utilities.h:127
static void PrepareOutputSearch(const TContainer &rInput, TResultType &rResults, VectorDistanceType &rResultsDistance)
This method prepares the search output.
Definition: search_utilities.h:420
static void ComputeBoundingBoxesWithTolerance(const std::vector< double > &rBoundingBoxes, const double Tolerance, std::vector< double > &rBoundingBoxesWithTolerance)
Compute the bounding boxes of the given bounding boxes from a given tolerance.
Definition: search_utilities.cpp:24
static std::vector< int > SynchronousPointSynchronizationWithRecvSizes(TPointIteratorType itPointBegin, TPointIteratorType itPointEnd, std::vector< double > &rAllPointsCoordinates, std::vector< IndexType > &rAllPointsIds, const DataCommunicator &rDataCommunicator)
SynchronousPointSynchronizationWithRecvSizes prepares synchronously the coordinates of the points for...
Definition: search_utilities.h:328
std::vector< double > DistanceType
Definition: search_utilities.h:131
static void SynchronousPointSynchronization(TPointIteratorType itPointBegin, TPointIteratorType itPointEnd, std::vector< double > &rAllPointsCoordinates, std::vector< IndexType > &rAllPointsIds, const DataCommunicator &rDataCommunicator)
SynchronousPointSynchronization prepares synchronously the coordinates of the points for MPI search.
Definition: search_utilities.h:262
static std::vector< double > SynchronousPointSynchronizationWithRadius(TPointIteratorType itPointBegin, TPointIteratorType itPointEnd, std::vector< double > &rAllPointsCoordinates, std::vector< IndexType > &rAllPointsIds, const std::vector< double > &rRadius, const DataCommunicator &rDataCommunicator)
SynchronousPointSynchronizationWithRadius prepares synchronously the coordinates of the points for MP...
Definition: search_utilities.h:360
static std::vector< typename PointObject< typename TContainer::value_type >::Pointer > PrepareSearch(const TContainer &rStructure, const TContainer &rInput, TResultType &rResults, VectorDistanceType &rResultsDistance)
This method prepares the search.
Definition: search_utilities.h:397
static constexpr double ZeroTolerance
Define zero tolerance as Epsilon.
Definition: search_utilities.h:135
static void ParallelSearch(const TContainer &rInput, const RadiusArrayType &rRadius, TSpatialContainer &rSearch, TResultType &rResults, VectorDistanceType &rResultsDistance, const int AllocationSize=1000)
This method performs the search in parallel.
Definition: search_utilities.h:476
long unsigned int IndexType
The index type definition.
Definition: search_utilities.h:124
std::vector< double > RadiusArrayType
Input/output types.
Definition: search_utilities.h:130
std::vector< DistanceType > VectorDistanceType
Definition: search_utilities.h:132
static bool PointIsInsideBoundingBox(const BoundingBox< TPointType > &rBoundingBox, const array_1d< double, 3 > &rCoords, const double Tolerance)
This method checks if a point is inside a bounding box considering a certain tolerance.
Definition: search_utilities.h:200
BOOST_UBLAS_INLINE size_type size() const
Definition: array_1d.h:370
BOOST_UBLAS_INLINE const_iterator begin() const
Definition: array_1d.h:606
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
std::vector< PointTypePointer > PointVector
Definition: internal_variables_interpolation_process.h:53
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
PointType::Pointer PointTypePointer
Definition: internal_variables_interpolation_process.h:52
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
std::vector< double > DistanceVector
Definition: internal_variables_interpolation_process.h:55
Point PointType
Geometric definitions.
Definition: mortar_classes.h:36
int j
Definition: quadrature.py:648
int counter
Definition: script_THERMAL_CORRECT.py:218
integer i
Definition: TensorModule.f:17