MFEM
v4.6.0
Finite element discretization library
|
#include <kdtree.hpp>
Classes | |
struct | NodeND |
Structure defining a node in the KDTree. More... | |
struct | PointND |
Public Types | |
typedef std::vector< NodeND >::iterator | iterator |
Data iterator. More... | |
Public Member Functions | |
KDTree ()=default | |
Default constructor. More... | |
int | SpaceDimension () |
Returns the spatial dimension of the points. More... | |
iterator | begin () |
Returns iterator to beginning of the point cloud. More... | |
iterator | end () |
Returns iterator to the end of the point cloud. More... | |
size_t | size () |
Returns the size of the point cloud. More... | |
void | clear () |
Clears the point cloud. More... | |
void | Sort () |
void | AddPoint (PointND &pt, Tindex ii) |
Adds a new node to the point cloud. More... | |
void | AddPoint (Tfloat *xx, Tindex ii) |
Adds a new node by coordinates and an associated index. More... | |
Tindex | FindClosestPoint (PointND &pt) |
Finds the nearest neighbour index. More... | |
Tindex | FindClosestPoint (PointND &pt, PointND &clp) |
Finds the nearest neighbour index and return the clossest poitn in clp. More... | |
void | FindClosestPoint (PointND &pt, Tindex &ind, Tfloat &dist) |
Returns the closest point and the distance to the input point pt. More... | |
void | FindClosestPoint (PointND &pt, Tindex &ind, Tfloat &dist, PointND &clp) |
Returns the closest point and the distance to the input point pt. More... | |
void | FindClosestPointSlow (PointND &pt, Tindex &ind, Tfloat &dist) |
Brute force search - please, use it only for debuging purposes. More... | |
void | FindNeighborPoints (PointND &pt, Tfloat R, std::vector< Tindex > &res, std::vector< Tfloat > &dist) |
void | FindNeighborPoints (PointND &pt, Tfloat R, std::vector< Tindex > &res) |
void | FindNeighborPointsSlow (PointND &pt, Tfloat R, std::vector< Tindex > &res, std::vector< Tfloat > &dist) |
Brute force search - please, use it only for debuging purposes. More... | |
void | FindNeighborPointsSlow (PointND &pt, Tfloat R, std::vector< Tindex > &res) |
Brute force search - please, use it only for debuging purposes. More... | |
Template class for build KDTree with template parameters Tindex specifying the type utilized for indexing the points, Tfloat specifying a float type for representing the coordinates of the points, integer parameter ndim specifying the dimensionality of the space and template function Tnorm for evaluating the distance between two points. The KDTree class implements the standard k-d tree data structure that can be used to transfer a ParGridFunction defined on one MPI communicator to a ParGridFunction/GridFunction defined on different MPI communicator. This can be useful when comparing a solution computed on m ranks against a solution computed with n or 1 rank(s).
Definition at line 98 of file kdtree.hpp.
typedef std::vector<NodeND>::iterator mfem::KDTree< Tindex, Tfloat, ndim, Tnorm >::iterator |
Data iterator.
Definition at line 135 of file kdtree.hpp.
|
default |
Default constructor.
|
inline |
Adds a new node to the point cloud.
Definition at line 169 of file kdtree.hpp.
|
inline |
Adds a new node by coordinates and an associated index.
Definition at line 178 of file kdtree.hpp.
|
inline |
Returns iterator to beginning of the point cloud.
Definition at line 138 of file kdtree.hpp.
|
inline |
Clears the point cloud.
Definition at line 156 of file kdtree.hpp.
|
inline |
Returns iterator to the end of the point cloud.
Definition at line 144 of file kdtree.hpp.
|
inline |
Finds the nearest neighbour index.
Definition at line 190 of file kdtree.hpp.
|
inline |
Finds the nearest neighbour index and return the clossest poitn in clp.
Definition at line 203 of file kdtree.hpp.
|
inline |
Returns the closest point and the distance to the input point pt.
Definition at line 218 of file kdtree.hpp.
|
inline |
Returns the closest point and the distance to the input point pt.
Definition at line 226 of file kdtree.hpp.
|
inline |
Brute force search - please, use it only for debuging purposes.
Definition at line 243 of file kdtree.hpp.
|
inline |
Finds all points within a distance R from point pt. The indices are returned in the vector res and the correponding distances in vector dist.
Definition at line 267 of file kdtree.hpp.
|
inline |
Finds all points within a distance R from point pt. The indices are returned in the vector res and the correponding distances in vector dist.
Definition at line 275 of file kdtree.hpp.
|
inline |
Brute force search - please, use it only for debuging purposes.
Definition at line 281 of file kdtree.hpp.
|
inline |
Brute force search - please, use it only for debuging purposes.
Definition at line 297 of file kdtree.hpp.
|
inline |
Returns the size of the point cloud.
Definition at line 150 of file kdtree.hpp.
|
inline |
Builds the KDTree. If the point cloud is modified the tree needs to be rebuild by a new call to Sort().
Definition at line 163 of file kdtree.hpp.
|
inline |
Returns the spatial dimension of the points.
Definition at line 129 of file kdtree.hpp.