MFEM v4.7.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. | |
Public Member Functions | |
KDTree ()=default | |
Default constructor. | |
int | SpaceDimension () const |
Returns the spatial dimension of the points. | |
iterator | begin () |
Returns iterator to beginning of the point cloud. | |
iterator | end () |
Returns iterator to the end of the point cloud. | |
size_t | size () const |
Returns the size of the point cloud. | |
void | clear () |
Clears the point cloud. | |
void | Sort () override |
void | AddPoint (const PointND &pt, Tindex ii) |
Adds a new node to the point cloud. | |
void | AddPoint (const Tfloat *xx, Tindex ii) override |
Adds a new node by coordinates and an associated index. | |
Tindex | FindClosestPoint (const PointND &pt) const |
Finds the nearest neighbour index. | |
Tindex | FindClosestPoint (const Tfloat *xx) const override |
Returns the index of the closest point to xx. | |
Tindex | FindClosestPoint (const PointND &pt, const PointND &clp) const |
Finds the nearest neighbour index and return the clossest point in clp. | |
void | FindClosestPoint (const PointND &pt, Tindex &ind, Tfloat &dist) const |
Returns the closest point and the distance to the input point pt. | |
void | FindClosestPoint (const PointND &pt, Tindex &ind, Tfloat &dist, PointND &clp) const |
Returns the closest point and the distance to the input point pt. | |
void | FindClosestPointSlow (const PointND &pt, Tindex &ind, Tfloat &dist) const |
Brute force search - please, use it only for debuging purposes. | |
void | FindNeighborPoints (const PointND &pt, Tfloat R, std::vector< Tindex > &res, std::vector< Tfloat > &dist) |
void | FindNeighborPoints (const PointND &pt, Tfloat R, std::vector< Tindex > &res) |
void | FindNeighborPointsSlow (const PointND &pt, Tfloat R, std::vector< Tindex > &res, std::vector< Tfloat > &dist) |
Brute force search - please, use it only for debuging purposes. | |
void | FindNeighborPointsSlow (const PointND &pt, Tfloat R, std::vector< Tindex > &res) |
Brute force search - please, use it only for debuging purposes. | |
Public Member Functions inherited from mfem::KDTreeBase< Tindex, Tfloat > | |
virtual | ~KDTreeBase () |
Virtual destructor. | |
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 118 of file kdtree.hpp.
typedef std::vector<NodeND>::iterator mfem::KDTree< Tindex, Tfloat, ndim, Tnorm >::iterator |
Data iterator.
Definition at line 159 of file kdtree.hpp.
|
default |
Default constructor.
|
inline |
Adds a new node to the point cloud.
Definition at line 193 of file kdtree.hpp.
|
inlineoverridevirtual |
Adds a new node by coordinates and an associated index.
Implements mfem::KDTreeBase< Tindex, Tfloat >.
Definition at line 199 of file kdtree.hpp.
|
inline |
Returns iterator to beginning of the point cloud.
Definition at line 162 of file kdtree.hpp.
|
inline |
Clears the point cloud.
Definition at line 180 of file kdtree.hpp.
|
inline |
Returns iterator to the end of the point cloud.
Definition at line 168 of file kdtree.hpp.
|
inline |
Finds the nearest neighbour index.
Definition at line 205 of file kdtree.hpp.
|
inline |
Finds the nearest neighbour index and return the clossest point in clp.
Definition at line 223 of file kdtree.hpp.
|
inline |
Returns the closest point and the distance to the input point pt.
Definition at line 238 of file kdtree.hpp.
|
inline |
Returns the closest point and the distance to the input point pt.
Definition at line 245 of file kdtree.hpp.
|
inlineoverridevirtual |
Returns the index of the closest point to xx.
Implements mfem::KDTreeBase< Tindex, Tfloat >.
Definition at line 217 of file kdtree.hpp.
|
inline |
Brute force search - please, use it only for debuging purposes.
Definition at line 263 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 295 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 287 of file kdtree.hpp.
|
inline |
Brute force search - please, use it only for debuging purposes.
Definition at line 318 of file kdtree.hpp.
|
inline |
Brute force search - please, use it only for debuging purposes.
Definition at line 301 of file kdtree.hpp.
|
inline |
Returns the size of the point cloud.
Definition at line 174 of file kdtree.hpp.
|
inlineoverridevirtual |
Builds the KDTree. If the point cloud is modified the tree needs to be rebuild by a new call to Sort().
Implements mfem::KDTreeBase< Tindex, Tfloat >.
Definition at line 187 of file kdtree.hpp.
|
inline |
Returns the spatial dimension of the points.
Definition at line 153 of file kdtree.hpp.