![]() |
KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
MPI utilities for searching geometrical objects. More...
#include <search_utilities.h>
Static Public Member Functions | |
Operations | |
| template<class TPointType > | |
| static bool | PointIsInsideBoundingBox (const BoundingBox< TPointType > &rBoundingBox, const array_1d< double, 3 > &rCoords) |
| Check if a point is inside a bounding box. More... | |
| static bool | PointIsInsideBoundingBox (const BoundingBoxType &rBoundingBox, const array_1d< double, 3 > &rCoords) |
| Check if a point is inside a bounding box. More... | |
| template<class TPointType > | |
| 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. More... | |
| 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. More... | |
| 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 if the bounding boxes are initialized. More... | |
| template<typename TPointIteratorType > | |
| 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. More... | |
| template<typename TPointIteratorType , typename TBoundingBoxType > | |
| 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. More... | |
| template<typename TPointIteratorType > | |
| 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 MPI search including the recv sizes. More... | |
| template<typename TPointIteratorType > | |
| 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 MPI search including radius. More... | |
| template<class TContainer , class TResultType > | |
| 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. More... | |
| template<class TContainer , class TResultType > | |
| static void | PrepareOutputSearch (const TContainer &rInput, TResultType &rResults, VectorDistanceType &rResultsDistance) |
| This method prepares the search output. More... | |
| template<class TContainer > | |
| static std::vector< typename PointObject< typename TContainer::value_type >::Pointer > | PreparePointsSearch (const TContainer &rStructure) |
| This method prepares the points for search. More... | |
| template<class TContainer , class TSpatialContainer , class TResultType > | |
| 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. More... | |
Type Definitions | |
| using | BoundingBoxType = std::array< double, 6 > |
| The Bounding Box type. More... | |
| using | IndexType = long unsigned int |
| The index type definition. More... | |
| using | SizeType = std::size_t |
| The size type definition. More... | |
| using | RadiusArrayType = std::vector< double > |
| Input/output types. More... | |
| using | DistanceType = std::vector< double > |
| using | VectorDistanceType = std::vector< DistanceType > |
| static constexpr double | ZeroTolerance = std::numeric_limits<double>::epsilon() |
| Define zero tolerance as Epsilon. More... | |
MPI utilities for searching geometrical objects.
Some methods original implementation coming from MappingUtilities
| using Kratos::SearchUtilities::BoundingBoxType = std::array<double, 6> |
The Bounding Box type.
| using Kratos::SearchUtilities::DistanceType = std::vector<double> |
| using Kratos::SearchUtilities::IndexType = long unsigned int |
The index type definition.
| using Kratos::SearchUtilities::RadiusArrayType = std::vector<double> |
Input/output types.
| using Kratos::SearchUtilities::SizeType = std::size_t |
The size type definition.
| using Kratos::SearchUtilities::VectorDistanceType = std::vector<DistanceType> |
|
static |
Compute the bounding boxes of the given bounding boxes from a given tolerance.
| rBoundingBoxes | The bounding boxes |
| Tolerance | The tolerance |
| rBoundingBoxesWithTolerance | The resulting bounding boxes with the applied tolerance |
|
static |
Compute the bounding boxes of the given bounding boxes from a given tolerance, additionally checking if the bounding boxes are initialized.
This method is used when the bounding boxes are not initialized
| rBoundingBoxes | The bounding boxes |
| Tolerance | The tolerance |
| rBoundingBoxesWithTolerance | The resulting bounding boxes with the applied tolerance |
|
inlinestatic |
This method performs the search in parallel.
| rInput | The input container |
| rRadius | The radius array |
| rSearch | The spatial search |
| rResults | The results |
| rResultsDistance | The results distance |
| AllocationSize | The allocation size |
| TContainer | The container type |
| TSpatialContainer | The spatial container type |
| TResultType | The result type |
|
inlinestatic |
Check if a point is inside a bounding box.
Bounding box class implementation
| rBoundingBox | The bounding box |
| rCoords | The point |
| TPointType | The type of point considered |
|
inlinestatic |
This method checks if a point is inside a bounding box considering a certain tolerance.
| rBoundingBox | The bounding box |
| rCoords | The coordinates of the point |
| Tolerance | The tolerance |
| TPointType | The type of point considered |
|
inlinestatic |
Check if a point is inside a bounding box.
Bounding box array of 6 doubles implementation
| rBoundingBox | The bounding box |
| rCoords | The point |
|
inlinestatic |
This method prepares the search output.
| rInput | The input to be searched |
| rResults | The results |
| rResultsDistance | The results distance |
| TContainer | The container type |
| TResultType | The result type |
|
inlinestatic |
This method prepares the points for search.
| rStructure | The structure to be searched |
| TContainer | The container type |
|
inlinestatic |
This method prepares the search.
| rStructure | The structure to be searched |
| rInput | The input to be searched |
| rResults | The results |
| rResultsDistance | The results distance |
| TContainer | The container type |
| TResultType | The result type |
|
inlinestatic |
SynchronousPointSynchronization prepares synchronously the coordinates of the points for MPI search.
| itPointBegin | Iterator to the beginning of the points range |
| itPointEnd | Iterator to the end of the points range |
| rAllPointsCoordinates | vector where the computed coordinates will be stored |
| rAllPointsIds | The ids of all the points (just a counter for points, and ids for nodes) |
| rDataCommunicator | The data communicator |
| TPointIteratorType | The type of the point iterator |
|
inlinestatic |
SynchronousPointSynchronization prepares synchronously the coordinates of the points for MPI search.
| itPointBegin | Iterator to the beginning of the points range. |
| itPointEnd | Iterator to the end of the points range. |
| rSearchInfo | The class containing the result of the search. |
| rBoundingBox | The bounding box considered. |
| ThresholdBoundingBox | The threshold for computing is inside bounding box considered. |
| rDataCommunicator | The data communicator. |
| IndexItIsJustCounter | If the index considered it it just a counter. |
| TPointIteratorType | The type of the point iterator. |
| TBoundingBoxType | The type of the bounding box. |
|
inlinestatic |
SynchronousPointSynchronizationWithRadius prepares synchronously the coordinates of the points for MPI search including radius.
With radius
| itPointBegin | Iterator to the beginning of the points range |
| itPointEnd | Iterator to the end of the points range |
| rAllPointsCoordinates | vector where the computed coordinates will be stored |
| rAllPointsIds | The ids of all the points (just a counter for points, and ids for nodes) |
| rRadius | The radius of the points |
| rDataCommunicator | The data communicator |
| TPointIteratorType | The type of the point iterator |
|
inlinestatic |
SynchronousPointSynchronizationWithRecvSizes prepares synchronously the coordinates of the points for MPI search including the recv sizes.
With recv sizes
| itPointBegin | Iterator to the beginning of the points range |
| itPointEnd | Iterator to the end of the points range |
| rAllPointsCoordinates | vector where the computed coordinates will be stored |
| rAllPointsIds | The ids of all the points (just a counter for points, and ids for nodes) |
| rDataCommunicator | The data communicator |
| TPointIteratorType | The type of the point iterator |
|
staticconstexpr |
Define zero tolerance as Epsilon.