$extrastylesheet
#include <meshfree_interpolation.h>
Public Types | |
| typedef Real | coord_t |
Public Member Functions | |
| PointListAdaptor (const std::vector< Point > &pts) | |
| size_t | kdtree_get_point_count () const |
| coord_t | kdtree_distance (const coord_t *p1, const size_t idx_p2, size_t size) const |
| coord_t | kdtree_get_pt (const size_t idx, int dim) const |
| template<class BBOX > | |
| bool | kdtree_get_bbox (BBOX &) const |
Private Attributes | |
| const std::vector< Point > & | _pts |
This class adapts list of libMesh Point types for use in a nanoflann KD-Tree. For more on the basic idea see examples/pointcloud_adaptor_example.cpp in the nanoflann source tree.
Definition at line 186 of file meshfree_interpolation.h.
| typedef Real libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< PLDim >::coord_t |
Definition at line 199 of file meshfree_interpolation.h.
| libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< PLDim >::PointListAdaptor | ( | const std::vector< Point > & | pts | ) | [inline] |
Definition at line 192 of file meshfree_interpolation.h.
:
_pts(pts)
{}
| coord_t libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< PLDim >::kdtree_distance | ( | const coord_t * | p1, |
| const size_t | idx_p2, | ||
| size_t | size | ||
| ) | const [inline] |
Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class
Definition at line 210 of file meshfree_interpolation.h.
{
libmesh_assert_equal_to (size, PLDim);
libmesh_assert_less (idx_p2, _pts.size());
const Point &p2(_pts[idx_p2]);
switch (size)
{
case 3:
{
const coord_t d0=p1[0] - p2(0);
const coord_t d1=p1[1] - p2(1);
const coord_t d2=p1[2] - p2(2);
return d0*d0 + d1*d1 + d2*d2;
}
case 2:
{
const coord_t d0=p1[0] - p2(0);
const coord_t d1=p1[1] - p2(1);
return d0*d0 + d1*d1;
}
case 1:
{
const coord_t d0=p1[0] - p2(0);
return d0*d0;
}
default:
libmesh_error_msg("ERROR: unknown size " << size);
}
return -1.;
}
| bool libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< PLDim >::kdtree_get_bbox | ( | BBOX & | ) | const [inline] |
Optional bounding-box computation: return false to default to a standard bbox computation loop. Return true if the BBOX was already computed by the class and returned in "bb" so it can be avoided to redo it again. Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 for point clouds)
Definition at line 275 of file meshfree_interpolation.h.
{ return false; }
| size_t libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< PLDim >::kdtree_get_point_count | ( | ) | const [inline] |
Must return the number of data points
Definition at line 204 of file meshfree_interpolation.h.
{ return _pts.size(); }
| coord_t libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< PLDim >::kdtree_get_pt | ( | const size_t | idx, |
| int | dim | ||
| ) | const [inline] |
Returns the dim'th component of the idx'th point in the class: Since this is inlined and the "dim" argument is typically an immediate value, the "if's" are actually solved at compile time.
Definition at line 255 of file meshfree_interpolation.h.
const std::vector<Point>& libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< PLDim >::_pts [private] |
Definition at line 189 of file meshfree_interpolation.h.
Referenced by libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< KDDim >::kdtree_distance(), libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< KDDim >::kdtree_get_point_count(), and libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< KDDim >::kdtree_get_pt().