Loading...
Searching...
No Matches
Public Member Functions | List of all members
bitpit::SurfaceSkdTree Class Reference

The SurfaceSkdTree implements a Bounding Volume Hierarchy tree for surface patches. More...

Inheritance diagram for bitpit::SurfaceSkdTree:
Inheritance graph
[legend]
Collaboration diagram for bitpit::SurfaceSkdTree:
Collaboration graph
[legend]

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 SkdNodegetNode (std::size_t nodeId) const
 
std::size_t getNodeCount () const
 
const SkdBoxgetPartitionBox (int rank) const
 
const PatchKernelgetPatch () 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< SkdNodem_nodes
 
int m_nProcessors
 
std::vector< SkdBoxm_partitionBoxes
 
SkdPatchInfo m_patchInfo
 
int m_rank
 
bool m_threadSafeLookups
 

Detailed Description

The SurfaceSkdTree implements a Bounding Volume Hierarchy tree for surface patches.

Definition at line 33 of file surface_skd_tree.hpp.

Constructor & Destructor Documentation

◆ SurfaceSkdTree()

bitpit::SurfaceSkdTree::SurfaceSkdTree ( const SurfaceKernel * patch,
bool interiorCellsOnly = false )

Constructor.

Parameters
patchis the surface patch that will be use to build the tree
interiorCellsOnlyif set to true, only interior cells will be considered

Definition at line 44 of file surface_skd_tree.cpp.

Member Function Documentation

◆ clear()

void bitpit::SurfaceSkdTree::clear ( bool release)

Clear the tree.

Parameters
releaseif 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.

◆ evalPointDistance() [1/7]

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.

Parameters
[in]pointis the point
Returns
The distance between the specified point and the closest cell contained in the tree.

Definition at line 73 of file surface_skd_tree.cpp.

◆ evalPointDistance() [2/7]

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.

Parameters
[in]pointis the point
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
Returns
The distance between the specified point and the closest cell contained in the tree. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.

Definition at line 94 of file surface_skd_tree.cpp.

◆ evalPointDistance() [3/7]

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.

Parameters
[in]pointis the point
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[in]interiorCellsOnlyif 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
Returns
The distance between the specified point and the closest cell contained in the tree. If all cells contained in the tree are farther than the maximum distance, the function will return the maximum representable distance.

Definition at line 118 of file surface_skd_tree.cpp.

◆ evalPointDistance() [4/7]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistancesare 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]interiorCellsOnlyif set to true, only interior cells will be considered
[out]distanceson 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.

◆ evalPointDistance() [5/7]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistancesare 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]distanceson 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.

◆ evalPointDistance() [6/7]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[out]distanceson output it will contain the distances between the points and closest cells

Definition at line 138 of file surface_skd_tree.cpp.

◆ evalPointDistance() [7/7]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[out]distanceson 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.

◆ evalPointGlobalDistance() [1/3]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistancesare 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]distanceson 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.

◆ evalPointGlobalDistance() [2/3]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[out]distanceson output it will contain the distances between the points and closest cells

Definition at line 230 of file surface_skd_tree.cpp.

◆ evalPointGlobalDistance() [3/3]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[out]distanceson 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.

◆ findPointClosestCell() [1/7]

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.

Parameters
[in]pointis the point
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[in]interiorCellsOnlyif 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]idon 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]distanceon 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.

◆ findPointClosestCell() [2/7]

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.

Parameters
[in]pointis the point
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[out]idon 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]distanceon 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.

◆ findPointClosestCell() [3/7]

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.

Parameters
[in]pointis the point
[out]idon 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]distanceon 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.

◆ findPointClosestCell() [4/7]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistancesare 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]interiorCellsOnlyif set to true, only interior cells will be considered
[out]idson 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]distanceson 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.

◆ findPointClosestCell() [5/7]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistancesare 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]idson 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]distanceson 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.

◆ findPointClosestCell() [6/7]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[out]idson 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]distanceson 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.

◆ findPointClosestCell() [7/7]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[out]idson output it will contain the ids of the cells closest to the local points
[out]distanceson output it will contain the distances between the points and closest cells

Definition at line 413 of file surface_skd_tree.cpp.

◆ findPointClosestCells() [1/3]

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.

Parameters
[in]pointis the point
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[in]interiorCellsOnlyif 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]idson 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]distanceon 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.

◆ findPointClosestCells() [2/3]

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.

Parameters
[in]pointis the point
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[out]idson 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]distanceon 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.

◆ findPointClosestCells() [3/3]

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.

Parameters
[in]pointis the point
[out]idson 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]distanceon 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.

◆ findPointClosestGlobalCell() [1/3]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistancesare 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]idson 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]rankson output it will contain the rank indices of the processes owner of the cells closest to the points
[out]distanceson 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.

◆ findPointClosestGlobalCell() [2/3]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[in]maxDistanceall cells whose distance is greater than this parameters will not be considered for the evaluation of the distance
[out]idson 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]rankson output it will contain the rank indices of the processes owner of the cells closest to the points
[out]distanceson 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.

◆ findPointClosestGlobalCell() [3/3]

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.

Parameters
[in]nPointsis the number of the points
[in]pointsare the points coordinates
[out]idson output it will contain the ids of the cells closest to the local points
[out]rankson output it will contain the rank indices of the processes owner of the cells closest to the points
[out]distanceson output it will contain the distances between the points and closest cells

Definition at line 728 of file surface_skd_tree.cpp.


The documentation for this class was generated from the following files:
--- layout: doxygen_footer ---