libMesh
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
libMesh::RadialBasisInterpolation< KDDim, RBF > Class Template Reference

Radial Basis Function interpolation. More...

#include <radial_basis_interpolation.h>

Inheritance diagram for libMesh::RadialBasisInterpolation< KDDim, RBF >:
[legend]

Public Types

enum  ParallelizationStrategy { SYNC_SOURCES = 0, INVALID_STRATEGY }
 "ParallelizationStrategy" to employ. More...
 

Public Member Functions

 RadialBasisInterpolation (const libMesh::Parallel::Communicator &comm_in, Real radius=-1)
 Constructor. More...
 
virtual void clear () override
 Clears all internal data structures and restores to a pristine state. More...
 
virtual void prepare_for_use () override
 Prepares data structures for use. More...
 
virtual void interpolate_field_data (const std::vector< std::string > &field_names, const std::vector< Point > &tgt_pts, std::vector< Number > &tgt_vals) const override
 Interpolate source data at target points. More...
 
void print_info (std::ostream &os=libMesh::out) const
 Prints information about this object, by default to libMesh::out. More...
 
unsigned int n_field_variables () const
 The number of field variables. More...
 
void set_field_variables (const std::vector< std::string > &names)
 Defines the field variable(s) we are responsible for, and importantly their assumed ordering. More...
 
const std::vector< std::string > & field_variables () const
 
std::vector< Point > & get_source_points ()
 
std::vector< Number > & get_source_vals ()
 
virtual void add_field_data (const std::vector< std::string > &field_names, const std::vector< Point > &pts, const std::vector< Number > &vals)
 Sets source data at specified points. More...
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Protected Types

typedef nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< Real, PointListAdaptor< KDDim > >, PointListAdaptor< KDDim >, KDDim > kd_tree_t
 

Protected Member Functions

virtual void construct_kd_tree ()
 Build & initialize the KD tree, if needed. More...
 
virtual void interpolate (const Point &pt, const std::vector< size_t > &src_indices, const std::vector< Real > &src_dist_sqr, std::vector< Number >::iterator &out_it) const
 Performs inverse distance interpolation at the input point from the specified points. More...
 
virtual void gather_remote_data ()
 Gathers source points and values that have been added on other processors. More...
 

Protected Attributes

BoundingBox _src_bbox
 Bounding box for our source points. More...
 
std::vector< Number_weights
 basis coefficients. More...
 
Real _r_bbox
 Diagonal of the bounding box. More...
 
Real _r_override
 Diagonal override. More...
 
PointListAdaptor< KDDim > _point_list_adaptor
 
std::unique_ptr< kd_tree_t_kd_tree
 
const Real _half_power
 
const unsigned int _n_interp_pts
 
std::vector< Number_vals
 Temporary work array. More...
 
ParallelizationStrategy _parallelization_strategy
 
std::vector< std::string > _names
 
std::vector< Point_src_pts
 
std::vector< Number_src_vals
 
const Parallel::Communicator_communicator
 

Detailed Description

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
class libMesh::RadialBasisInterpolation< KDDim, RBF >

Radial Basis Function interpolation.

Author
Benjamin S. Kirk
Date
2013 Does radial basis function interpolation using Nanoflann.

Definition at line 43 of file radial_basis_interpolation.h.

Member Typedef Documentation

◆ kd_tree_t

template<unsigned int KDDim>
typedef nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<Real, PointListAdaptor<KDDim> >, PointListAdaptor<KDDim>, KDDim> libMesh::InverseDistanceInterpolation< KDDim >::kd_tree_t
protectedinherited

Definition at line 298 of file meshfree_interpolation.h.

Member Enumeration Documentation

◆ ParallelizationStrategy

"ParallelizationStrategy" to employ.

SYNC_SOURCES assumes that the data added on each processor are independent and relatively small. Calling the prepare_for_use() method with this ParallelizationStrategy will copy remote data from other processors, so all interpolation can be performed locally.

Other ParallelizationStrategy techniques will be implemented as needed.

Enumerator
SYNC_SOURCES 
INVALID_STRATEGY 

Definition at line 73 of file meshfree_interpolation.h.

Constructor & Destructor Documentation

◆ RadialBasisInterpolation()

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
libMesh::RadialBasisInterpolation< KDDim, RBF >::RadialBasisInterpolation ( const libMesh::Parallel::Communicator comm_in,
Real  radius = -1 
)

Constructor.

Definition at line 79 of file radial_basis_interpolation.h.

80  :
81  InverseDistanceInterpolation<KDDim> (comm_in,8,2),
82  _r_bbox(0.),
83  _r_override(radius)
84  { libmesh_experimental(); }
Real _r_bbox
Diagonal of the bounding box.

Member Function Documentation

◆ add_field_data()

virtual void libMesh::MeshfreeInterpolation::add_field_data ( const std::vector< std::string > &  field_names,
const std::vector< Point > &  pts,
const std::vector< Number > &  vals 
)
virtualinherited

Sets source data at specified points.

◆ clear()

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
virtual void libMesh::RadialBasisInterpolation< KDDim, RBF >::clear ( )
overridevirtual

Clears all internal data structures and restores to a pristine state.

Reimplemented from libMesh::InverseDistanceInterpolation< KDDim >.

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inherited

◆ construct_kd_tree()

template<unsigned int KDDim>
virtual void libMesh::InverseDistanceInterpolation< KDDim >::construct_kd_tree ( )
protectedvirtualinherited

Build & initialize the KD tree, if needed.

◆ field_variables()

const std::vector<std::string>& libMesh::MeshfreeInterpolation::field_variables ( ) const
inherited
Returns
The field variables as a read-only reference.

Definition at line 117 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_names.

Referenced by libMesh::MeshlessInterpolationFunction::operator()().

118  { return _names; }
std::vector< std::string > _names

◆ gather_remote_data()

virtual void libMesh::MeshfreeInterpolation::gather_remote_data ( )
protectedvirtualinherited

Gathers source points and values that have been added on other processors.

Note
The user is responsible for adding points only once per processor if this method is called. No attempt is made to identify duplicate points.

This method is virtual so that it can be overwritten or extended as required in derived classes.

◆ get_source_points()

std::vector<Point>& libMesh::MeshfreeInterpolation::get_source_points ( )
inherited
Returns
A writable reference to the point list.

Definition at line 123 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_src_pts.

124  { return _src_pts; }

◆ get_source_vals()

std::vector<Number>& libMesh::MeshfreeInterpolation::get_source_vals ( )
inherited
Returns
A writable reference to the point list.

Definition at line 129 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_src_vals.

130  { return _src_vals; }

◆ interpolate()

template<unsigned int KDDim>
virtual void libMesh::InverseDistanceInterpolation< KDDim >::interpolate ( const Point pt,
const std::vector< size_t > &  src_indices,
const std::vector< Real > &  src_dist_sqr,
std::vector< Number >::iterator &  out_it 
) const
protectedvirtualinherited

Performs inverse distance interpolation at the input point from the specified points.

◆ interpolate_field_data()

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
virtual void libMesh::RadialBasisInterpolation< KDDim, RBF >::interpolate_field_data ( const std::vector< std::string > &  field_names,
const std::vector< Point > &  tgt_pts,
std::vector< Number > &  tgt_vals 
) const
overridevirtual

Interpolate source data at target points.

Pure virtual, must be overridden in derived classes.

Reimplemented from libMesh::InverseDistanceInterpolation< KDDim >.

◆ n_field_variables()

unsigned int libMesh::MeshfreeInterpolation::n_field_variables ( ) const
inherited

The number of field variables.

Definition at line 104 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_names.

105  { return cast_int<unsigned int>(_names.size()); }
std::vector< std::string > _names

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
inherited
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::MeshBase::partition().

94  { return cast_int<processor_id_type>(_communicator.size()); }
processor_id_type size() const
Definition: communicator.h:175
const Parallel::Communicator & _communicator

◆ prepare_for_use()

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
virtual void libMesh::RadialBasisInterpolation< KDDim, RBF >::prepare_for_use ( )
overridevirtual

Prepares data structures for use.

Reimplemented from libMesh::MeshfreeInterpolation.

◆ print_info()

void libMesh::MeshfreeInterpolation::print_info ( std::ostream &  os = libMesh::out) const
inherited

Prints information about this object, by default to libMesh::out.

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited

◆ set_field_variables()

void libMesh::MeshfreeInterpolation::set_field_variables ( const std::vector< std::string > &  names)
inherited

Defines the field variable(s) we are responsible for, and importantly their assumed ordering.

Definition at line 111 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_names.

112  { _names = names; }
std::vector< std::string > _names

Member Data Documentation

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited

◆ _half_power

template<unsigned int KDDim>
const Real libMesh::InverseDistanceInterpolation< KDDim >::_half_power
protectedinherited

Definition at line 318 of file meshfree_interpolation.h.

◆ _kd_tree

template<unsigned int KDDim>
std::unique_ptr<kd_tree_t> libMesh::InverseDistanceInterpolation< KDDim >::_kd_tree
mutableprotectedinherited

Definition at line 300 of file meshfree_interpolation.h.

◆ _n_interp_pts

template<unsigned int KDDim>
const unsigned int libMesh::InverseDistanceInterpolation< KDDim >::_n_interp_pts
protectedinherited

Definition at line 319 of file meshfree_interpolation.h.

◆ _names

std::vector<std::string> libMesh::MeshfreeInterpolation::_names
protectedinherited

◆ _parallelization_strategy

ParallelizationStrategy libMesh::MeshfreeInterpolation::_parallelization_strategy
protectedinherited

Definition at line 168 of file meshfree_interpolation.h.

◆ _point_list_adaptor

template<unsigned int KDDim>
PointListAdaptor<KDDim> libMesh::InverseDistanceInterpolation< KDDim >::_point_list_adaptor
protectedinherited

Definition at line 288 of file meshfree_interpolation.h.

◆ _r_bbox

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
Real libMesh::RadialBasisInterpolation< KDDim, RBF >::_r_bbox
protected

Diagonal of the bounding box.

Definition at line 67 of file radial_basis_interpolation.h.

◆ _r_override

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
Real libMesh::RadialBasisInterpolation< KDDim, RBF >::_r_override
protected

Diagonal override.

Definition at line 72 of file radial_basis_interpolation.h.

◆ _src_bbox

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
BoundingBox libMesh::RadialBasisInterpolation< KDDim, RBF >::_src_bbox
protected

Bounding box for our source points.

Definition at line 57 of file radial_basis_interpolation.h.

◆ _src_pts

std::vector<Point> libMesh::MeshfreeInterpolation::_src_pts
protectedinherited

◆ _src_vals

std::vector<Number> libMesh::MeshfreeInterpolation::_src_vals
protectedinherited

◆ _vals

template<unsigned int KDDim>
std::vector<Number> libMesh::InverseDistanceInterpolation< KDDim >::_vals
mutableprotectedinherited

Temporary work array.

Object level scope to avoid cache thrashing.

Definition at line 324 of file meshfree_interpolation.h.

◆ _weights

template<unsigned int KDDim, class RBF = WendlandRBF<KDDim, 2>>
std::vector<Number> libMesh::RadialBasisInterpolation< KDDim, RBF >::_weights
protected

basis coefficients.

Definition at line 62 of file radial_basis_interpolation.h.


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