The SurfaceSkdTree implements a Bounding Volume Hierarchy tree for surface patches. More...
Public Member Functions | |
SurfaceSkdTree (const SurfaceKernel *patch, bool interorOnly=false) | |
void | clear (bool release) |
double | evalPointDistance (const std::array< double, 3 > &point) const |
double | evalPointDistance (const std::array< double, 3 > &point, double maxDistance) const |
double | evalPointDistance (const std::array< double, 3 > &point, double maxDistance, bool interorOnly) const |
void | evalPointDistance (int nPoints, const std::array< double, 3 > *points, const double *maxDistances, bool interorOnly, double *distances) const |
void | evalPointDistance (int nPoints, const std::array< double, 3 > *points, const double *maxDistances, double *distances) const |
void | evalPointDistance (int nPoints, const std::array< double, 3 > *points, double *distances) const |
void | evalPointDistance (int nPoints, const std::array< double, 3 > *points, double maxDistance, double *distances) const |
void | evalPointGlobalDistance (int nPoints, const std::array< double, 3 > *points, const double *maxDistances, double *distances) const |
void | evalPointGlobalDistance (int nPoints, const std::array< double, 3 > *points, double *distances) const |
void | evalPointGlobalDistance (int nPoints, const std::array< double, 3 > *points, double maxDistance, double *distances) const |
long | findPointClosestCell (const std::array< double, 3 > &point, double maxDistance, bool interorOnly, long *id, double *distance) const |
long | findPointClosestCell (const std::array< double, 3 > &point, double maxDistance, long *id, double *distance) const |
long | findPointClosestCell (const std::array< double, 3 > &point, long *id, double *distance) const |
long | findPointClosestCell (int nPoints, const std::array< double, 3 > *points, const double *maxDistances, bool interorOnly, long *ids, double *distances) const |
long | findPointClosestCell (int nPoints, const std::array< double, 3 > *points, const double *maxDistances, long *ids, double *distances) const |
long | findPointClosestCell (int nPoints, const std::array< double, 3 > *points, double maxDistance, long *ids, double *distances) const |
long | findPointClosestCell (int nPoints, const std::array< double, 3 > *points, long *ids, double *distances) const |
long | findPointClosestCells (const std::array< double, 3 > &point, double maxDistance, bool interorOnly, std::vector< long > &ids, double *distance) const |
long | findPointClosestCells (const std::array< double, 3 > &point, double maxDistance, std::vector< long > &ids, double *distance) const |
long | findPointClosestCells (const std::array< double, 3 > &point, std::vector< long > &ids, double *distance) const |
long | findPointClosestGlobalCell (int nPoints, const std::array< double, 3 > *points, const double *maxDistances, long *ids, int *ranks, double *distances) const |
long | findPointClosestGlobalCell (int nPoints, const std::array< double, 3 > *points, double maxDistance, long *ids, int *ranks, double *distances) const |
long | findPointClosestGlobalCell (int nPoints, const std::array< double, 3 > *points, long *ids, int *ranks, double *distances) const |
Public Member Functions inherited from bitpit::PatchSkdTree | |
bool | areLookupsThreadSafe () const |
void | build (std::size_t leaftThreshold=1, bool squeezeStorage=false) |
void | clear (bool release=false) |
void | enableThreadSafeLookups (bool enable) |
std::size_t | evalMaxDepth (std::size_t rootId=0) const |
std::size_t | getLeafCount () const |
std::size_t | getLeafMaxCellCount () const |
std::size_t | getLeafMinCellCount () const |
const SkdNode & | getNode (std::size_t nodeId) const |
std::size_t | getNodeCount () const |
const SkdBox & | getPartitionBox (int rank) const |
const PatchKernel & | getPatch () const |
Additional Inherited Members | |
Protected Member Functions inherited from bitpit::PatchSkdTree | |
PatchSkdTree (const PatchKernel *patch, bool interiorCellsOnly=false) | |
SkdNode & | _getNode (std::size_t nodeId) |
void | freeCommunicator () |
const MPI_Comm & | getCommunicator () const |
bool | isCommunicatorSet () const |
void | setCommunicator (MPI_Comm communicator) |
Protected Attributes inherited from bitpit::PatchSkdTree | |
std::vector< std::size_t > | m_cellRawIds |
MPI_Comm | m_communicator |
bool | m_interiorCellsOnly |
std::size_t | m_nLeafs |
std::size_t | m_nMaxLeafCells |
std::size_t | m_nMinLeafCells |
std::vector< SkdNode > | m_nodes |
int | m_nProcessors |
std::vector< SkdBox > | m_partitionBoxes |
SkdPatchInfo | m_patchInfo |
int | m_rank |
bool | m_threadSafeLookups |
The SurfaceSkdTree implements a Bounding Volume Hierarchy tree for surface patches.
Definition at line 33 of file surface_skd_tree.hpp.
bitpit::SurfaceSkdTree::SurfaceSkdTree | ( | const SurfaceKernel * | patch, |
bool | interiorCellsOnly = false ) |
Constructor.
patch | is the surface patch that will be use to build the tree |
interiorCellsOnly | if set to true, only interior cells will be considered |
Definition at line 44 of file surface_skd_tree.cpp.
void bitpit::SurfaceSkdTree::clear | ( | bool | release | ) |
Clear the tree.
release | if it's true the memory hold by the tree will be released, otherwise the treewill be cleared but its memory will not be relased |
Definition at line 55 of file surface_skd_tree.cpp.
double bitpit::SurfaceSkdTree::evalPointDistance | ( | const std::array< double, 3 > & | point | ) | const |
Computes the distance between the specified point and the closest cell contained in the tree. Only cells with a distance less than the specified maximum distance will be considered.
[in] | point | is the point |
Definition at line 73 of file surface_skd_tree.cpp.
double bitpit::SurfaceSkdTree::evalPointDistance | ( | const std::array< double, 3 > & | point, |
double | maxDistance ) const |
Computes the distance between the specified point and the closest cell contained in the tree. Only cells with a distance less than the specified maximum distance will be considered. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.
[in] | point | is the point |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
Definition at line 94 of file surface_skd_tree.cpp.
double bitpit::SurfaceSkdTree::evalPointDistance | ( | const std::array< double, 3 > & | point, |
double | maxDistance, | ||
bool | interiorCellsOnly ) const |
Computes the distance between the specified point and the closest cell contained in the tree. Only cells with a distance less than the specified maximum distance will be considered. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.
[in] | point | is the point |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[in] | interiorCellsOnly | if set to true, only interior cells will be considered, it will be possible to consider non-interior cells only if the tree has been instantiated with non-interior cells support enabled |
Definition at line 118 of file surface_skd_tree.cpp.
void bitpit::SurfaceSkdTree::evalPointDistance | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
const double * | maxDistances, | ||
bool | interiorCellsOnly, | ||
double * | distances ) const |
Computes the distance between the specified points and the closest cell contained in the tree. Only cells with a distance less than the specified maximum distance will be considered. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistances | are the maximum allowed distances, all cells whose distance is greater than this parameter will not be considered for the evaluation of the distance with respect to the related point |
[in] | interiorCellsOnly | if set to true, only interior cells will be considered |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 211 of file surface_skd_tree.cpp.
void bitpit::SurfaceSkdTree::evalPointDistance | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
const double * | maxDistances, | ||
double * | distances ) const |
Computes the distance between the specified points and the closest cell contained in the tree. Only cells with a distance less than the specified maximum distance will be considered. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistances | are the maximum allowed distances, all cells whose distance is greater than this parameter will not be considered for the evaluation of the distance with respect to the related point |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 186 of file surface_skd_tree.cpp.
void bitpit::SurfaceSkdTree::evalPointDistance | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
double * | distances ) const |
Computes the distance between each of the the specified points and the closest cell contained in the tree. Only cells with a distance less than the specified maximum distance will be considered.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[out] | distances | on output it will contain the distances between the points and closest cells |
Definition at line 138 of file surface_skd_tree.cpp.
void bitpit::SurfaceSkdTree::evalPointDistance | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
double | maxDistance, | ||
double * | distances ) const |
Computes the distance between each of the the specified points and the closest cell contained in the tree. Only cells with a distance less than the specified maximum distance will be considered. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 162 of file surface_skd_tree.cpp.
void bitpit::SurfaceSkdTree::evalPointGlobalDistance | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
const double * | maxDistances, | ||
double * | distances ) const |
Computes the distance between the specified point, considered distributed on the processes, and the closest cells contained in the tree. Only cells with a distance less than the specified maximum distance will be considered. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistances | are the maximum allowed distances, all cells whose distance is greater than this parameter will not be considered for the evaluation of the distance with respect to the related point |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 280 of file surface_skd_tree.cpp.
void bitpit::SurfaceSkdTree::evalPointGlobalDistance | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
double * | distances ) const |
Computes the distance between the specified point, considered distributed on the processes, and the closest cells contained in the tree. Only cells with a distance less than the specified maximum distance will be considered.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[out] | distances | on output it will contain the distances between the points and closest cells |
Definition at line 230 of file surface_skd_tree.cpp.
void bitpit::SurfaceSkdTree::evalPointGlobalDistance | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
double | maxDistance, | ||
double * | distances ) const |
Computes the distance between the specified point, considered distributed on the processes, and the closest cells contained in the tree. Only cells with a distance less than the specified maximum distance will be considered. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 255 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCell | ( | const std::array< double, 3 > & | point, |
double | maxDistance, | ||
bool | interiorCellsOnly, | ||
long * | id, | ||
double * | distance ) const |
Given the specified point find the closest cell contained in the tree and evaluate the distance between that cell and the given point.
[in] | point | is the point |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[in] | interiorCellsOnly | if set to true, only interior cells will be considered, it will be possible to consider non-interior cells only if the tree has been instantiated with non-interior cells support enabled |
[out] | id | on output it will contain the id of the closest cell. If all cells contained in the tree are farther than the maximum distance, the argument will be set to the null id |
[out] | distance | on output it will contain the distance between the point and closest cell. If all cells contained in the tree are farther than the maximum distance, the argument will be set to the maximum representable distance |
Definition at line 351 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCell | ( | const std::array< double, 3 > & | point, |
double | maxDistance, | ||
long * | id, | ||
double * | distance ) const |
Given the specified point find the closest cell contained in the three and evaluates the distance between that cell and the given point.
[in] | point | is the point |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[out] | id | on output it will contain the id of the closest cell. If all cells contained in the tree are farther than the maximum distance, the argument will be set to the null id |
[out] | distance | on output it will contain the distance between the point and closest cell. If all cells contained in the tree are farther than the maximum distance, the argument will be set to the maximum representable distance |
Definition at line 326 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCell | ( | const std::array< double, 3 > & | point, |
long * | id, | ||
double * | distance ) const |
Given the specified point find the closest cell contained in the three and evaluates the distance between that cell and the given point.
[in] | point | is the point |
[out] | id | on output it will contain the id of the cell closest to the point, if the distance between the point and the surface is greater than the specified maximum distance, the id parameter will be set to the null id |
[in,out] | distance | on output it will contain the distance between the point and closest cell. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance. |
Definition at line 304 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCell | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
const double * | maxDistances, | ||
bool | interiorCellsOnly, | ||
long * | ids, | ||
double * | distances ) const |
For each of the specified points find the closest cell contained in the three and evaluates the distance between that cell and the point.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistances | are the maximum allowed distances, all cells whose distance is greater than this parameter will not be considered for the evaluation of the distance with respect to the related point |
[in] | interiorCellsOnly | if set to true, only interior cells will be considered |
[out] | ids | on output it will contain the ids of the cells closest to the points. If all cells contained in the tree are farther from a point than the maximum distance, the related id will be set to the null id |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 490 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCell | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
const double * | maxDistances, | ||
long * | ids, | ||
double * | distances ) const |
For each of the specified points find the closest cell contained in the three and evaluates the distance between that cell and the point.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistances | are the maximum allowed distances, all cells whose distance is greater than this parameter will not be considered for the evaluation of the distance with respect to the related point |
[out] | ids | on output it will contain the ids of the cells closest to the points. If all cells contained in the tree are farther from a point than the maximum distance, the related id will be set to the null id |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 466 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCell | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
double | maxDistance, | ||
long * | ids, | ||
double * | distances ) const |
For each of the specified points find the closest cell contained in the three and evaluates the distance between that cell and the point.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[out] | ids | on output it will contain the ids of the cells closest to the points. If all cells contained in the tree are farther from a point than the maximum distance, the related id will be set to the null id |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 439 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCell | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
long * | ids, | ||
double * | distances ) const |
For each of the specified points find the closest cell contained in the three and evaluates the distance between that cell and the point.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[out] | ids | on output it will contain the ids of the cells closest to the local points |
[out] | distances | on output it will contain the distances between the points and closest cells |
Definition at line 413 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCells | ( | const std::array< double, 3 > & | point, |
double | maxDistance, | ||
bool | interiorCellsOnly, | ||
std::vector< long > & | ids, | ||
double * | distance ) const |
Given the specified point find the closest cells contained in the tree and evaluate the distance between those cells and the given point. All the cells at the same minimal distance (using patch tolerance) are returned.
[in] | point | is the point |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[in] | interiorCellsOnly | if set to true, only interior cells will be considered, it will be possible to consider non-interior cells only if the tree has been instantiated with non-interior cells support enabled |
[out] | ids | on output it will contain the ids of the closest cells. If all cells contained in the tree are farther than the maximum distance, the first element of the container will be set to the null id. |
[out] | distance | on output it will contain the distance between the point and closest cell. If all cells contained in the tree are farther than the maximum distance, the argument will be set to the maximum representable distance |
Definition at line 563 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCells | ( | const std::array< double, 3 > & | point, |
double | maxDistance, | ||
std::vector< long > & | ids, | ||
double * | distance ) const |
Given the specified point find the closest cells contained in the tree and evaluate the distance between those cells and the given point. All the cells at the same minimal distance (using patch tolerance) are returned.
[in] | point | is the point |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[out] | ids | on output it will contain the ids of the closest cells. If all cells contained in the tree are farther than the maximum distance, the first element of the container will be set to the null id. |
[out] | distance | on output it will contain the distance between the point and closest cellss. If all cells contained in the tree are farther than the maximum distance, the argument will be set to the maximum representable distance |
Definition at line 537 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestCells | ( | const std::array< double, 3 > & | point, |
std::vector< long > & | ids, | ||
double * | distance ) const |
Given the specified point find the closest cells contained in the tree and evaluate the distance between those cells and the given point. All the cells at the same minimal distance (using patch tolerance) are returned.
[in] | point | is the point |
[out] | ids | on output it will contain the ids of the closest cells. If all cells contained in the tree are farther than the maximum distance, the first element of the container will be set to the null id. |
[out] | distance | on output it will contain the distance between the point and closest cells. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance. |
Definition at line 515 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestGlobalCell | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
const double * | maxDistances, | ||
long * | ids, | ||
int * | ranks, | ||
double * | distances ) const |
Given the specified points, considered distributed on the processes, find the closest cells contained in the tree and evaluates the distance values between those cells and the given points.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistances | are the maximum allowed distances, all cells whose distance is greater than this parameter will not be considered for the evaluation of the distance with respect to the related point |
[out] | ids | on output it will contain the ids of the cells closest to the points. If all cells contained in the tree are farther from a point than the maximum distance, the related id will be set to the null id |
[out] | ranks | on output it will contain the rank indices of the processes owner of the cells closest to the points |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 781 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestGlobalCell | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
double | maxDistance, | ||
long * | ids, | ||
int * | ranks, | ||
double * | distances ) const |
Given the specified points, considered distributed on the processes, find the closest cells contained in the tree and evaluates the distance values between those cells and the given points.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[in] | maxDistance | all cells whose distance is greater than this parameters will not be considered for the evaluation of the distance |
[out] | ids | on output it will contain the ids of the cells closest to the points. If all cells contained in the tree are farther from a point than the maximum distance, the related id will be set to the null id |
[out] | ranks | on output it will contain the rank indices of the processes owner of the cells closest to the points |
[out] | distances | on output it will contain the distances between the points and closest cells. If all cells contained in the tree are farther than the maximum distance, the related argument will be set to the maximum representable distance. |
Definition at line 753 of file surface_skd_tree.cpp.
long bitpit::SurfaceSkdTree::findPointClosestGlobalCell | ( | int | nPoints, |
const std::array< double, 3 > * | points, | ||
long * | ids, | ||
int * | ranks, | ||
double * | distances ) const |
Given the specified points, considered distributed on the processes, find the closest cells contained in the tree and evaluates the distance values between those cells and the given points.
[in] | nPoints | is the number of the points |
[in] | points | are the points coordinates |
[out] | ids | on output it will contain the ids of the cells closest to the local points |
[out] | ranks | on output it will contain the rank indices of the processes owner of the cells closest to the points |
[out] | distances | on output it will contain the distances between the points and closest cells |
Definition at line 728 of file surface_skd_tree.cpp.