libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::VectorOfNodesAdaptor Class Reference

Public Member Functions

 VectorOfNodesAdaptor (const std::vector< std::pair< Point, dof_id_type >> &nodes)
 
size_t kdtree_get_point_count () const
 Must return the number of data points. More...
 
Real kdtree_get_pt (const size_t idx, int dim) const
 
template<class BBOX >
bool kdtree_get_bbox (BBOX &) const
 

Private Attributes

const std::vector< std::pair< Point, dof_id_type > > _nodes
 

Detailed Description

Definition at line 594 of file unstructured_mesh.C.

Constructor & Destructor Documentation

◆ VectorOfNodesAdaptor()

libMesh::VectorOfNodesAdaptor::VectorOfNodesAdaptor ( const std::vector< std::pair< Point, dof_id_type >> &  nodes)
inline

Definition at line 600 of file unstructured_mesh.C.

600  :
601  _nodes(nodes)
602  {}
const std::vector< std::pair< Point, dof_id_type > > _nodes

Member Function Documentation

◆ kdtree_get_bbox()

template<class BBOX >
bool libMesh::VectorOfNodesAdaptor::kdtree_get_bbox ( BBOX &  ) const
inline

Definition at line 630 of file unstructured_mesh.C.

630 { return false; }

◆ kdtree_get_point_count()

size_t libMesh::VectorOfNodesAdaptor::kdtree_get_point_count ( ) const
inline

Must return the number of data points.

Definition at line 607 of file unstructured_mesh.C.

References _nodes.

607 { return _nodes.size(); }
const std::vector< std::pair< Point, dof_id_type > > _nodes

◆ kdtree_get_pt()

Real libMesh::VectorOfNodesAdaptor::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 614 of file unstructured_mesh.C.

References _nodes, dim, and libMesh::MeshTools::Generation::Private::idx().

615  {
616  libmesh_assert_less (idx, _nodes.size());
617  libmesh_assert_less (dim, 3);
618 
619  const Point & p(_nodes[idx].first);
620 
621  if (dim==0) return p(0);
622  if (dim==1) return p(1);
623  return p(2);
624  }
unsigned int dim
const std::vector< std::pair< Point, dof_id_type > > _nodes
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
A useful inline function which replaces the macros used previously.

Member Data Documentation

◆ _nodes

const std::vector<std::pair<Point, dof_id_type> > libMesh::VectorOfNodesAdaptor::_nodes
private

Definition at line 597 of file unstructured_mesh.C.

Referenced by kdtree_get_point_count(), and kdtree_get_pt().


The documentation for this class was generated from the following file: