libMesh::InverseDistanceInterpolation< KDDim > Class Template Reference

#include <meshfree_interpolation.h>

Inheritance diagram for libMesh::InverseDistanceInterpolation< KDDim >:

List of all members.

Classes

class  PointListAdaptor

Public Types

enum  ParallelizationStrategy { SYNC_SOURCES = 0, INVALID_STRATEGY }

Public Member Functions

 InverseDistanceInterpolation (const unsigned int n_interp_pts=8, const unsigned int power=2)
virtual void clear ()
virtual void interpolate_field_data (const std::vector< std::string > &field_names, const std::vector< Point > &tgt_pts, std::vector< Number > &tgt_vals) const
void print_info (std::ostream &os=libMesh::out) const
unsigned int n_field_variables () const
void set_field_variables (const std::vector< std::string > &names)
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)
virtual void prepare_for_use ()

Protected Member Functions

virtual void gather_remote_data ()

Protected Attributes

ParallelizationStrategy _parallelization_strategy
std::vector< std::string > _names
std::vector< Point_src_pts
std::vector< Number_src_vals

Private Types

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

Private Member Functions

void construct_kd_tree ()
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

Private Attributes

PointListAdaptor< KDDim > _point_list_adaptor
AutoPtr< kd_tree_t_kd_tree
const int _half_power
const unsigned int _n_interp_pts
std::vector< Number_vals

Friends

std::ostream & operator<< (std::ostream &os, const MeshfreeInterpolation &mfi)

Detailed Description

template<unsigned int KDDim>
class libMesh::InverseDistanceInterpolation< KDDim >

Inverse distance interplation.

Definition at line 171 of file meshfree_interpolation.h.


Member Typedef Documentation

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

Definition at line 286 of file meshfree_interpolation.h.


Member Enumeration Documentation

"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 66 of file meshfree_interpolation.h.

00066                                { SYNC_SOURCES     = 0,
00067                                  INVALID_STRATEGY}; 


Constructor & Destructor Documentation

template<unsigned int KDDim>
libMesh::InverseDistanceInterpolation< KDDim >::InverseDistanceInterpolation ( const unsigned int  n_interp_pts = 8,
const unsigned int  power = 2 
) [inline]

Constructor. Takes the inverse distance power, which defaults to 2.

Definition at line 320 of file meshfree_interpolation.h.

00321                                                                      :
00322     MeshfreeInterpolation(),
00323 #if LIBMESH_HAVE_NANOFLANN
00324     _point_list_adaptor(_src_pts),
00325 #endif
00326     _half_power(power/2),
00327     _n_interp_pts(n_interp_pts)
00328   {
00329     libmesh_assert_greater_equal (power, 2);
00330   }


Member Function Documentation

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

Sets source data at specified points.

template<unsigned int KDDim>
virtual void libMesh::InverseDistanceInterpolation< KDDim >::clear (  )  [virtual]

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

Reimplemented from libMesh::MeshfreeInterpolation.

template<unsigned int KDDim>
void libMesh::InverseDistanceInterpolation< KDDim >::construct_kd_tree (  )  [private]

Build & initialize the KD tree, if needed.

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

Definition at line 109 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_names.

00110   { return _names; }

virtual void libMesh::MeshfreeInterpolation::gather_remote_data (  )  [protected, virtual, inherited]

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.

std::vector<Point>& libMesh::MeshfreeInterpolation::get_source_points (  )  [inline, inherited]
Returns:
a writeable reference to the point list.

Definition at line 115 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_src_pts.

00116   { return _src_pts; }

std::vector<Number>& libMesh::MeshfreeInterpolation::get_source_vals (  )  [inline, inherited]
Returns:
a writeable reference to the point list.

Definition at line 121 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_src_vals.

00122   { return _src_vals; }

template<unsigned int KDDim>
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 [private]

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

template<unsigned int KDDim>
virtual void libMesh::InverseDistanceInterpolation< KDDim >::interpolate_field_data ( const std::vector< std::string > &  field_names,
const std::vector< Point > &  tgt_pts,
std::vector< Number > &  tgt_vals 
) const [virtual]

Interpolate source data at target points. Pure virtual, must be overriden in derived classes.

Implements libMesh::MeshfreeInterpolation.

unsigned int libMesh::MeshfreeInterpolation::n_field_variables (  )  const [inline, inherited]

The number of field variables.

Definition at line 96 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_names.

00097   { return libmesh_cast_int<unsigned int>(_names.size()); }

virtual void libMesh::MeshfreeInterpolation::prepare_for_use (  )  [virtual, inherited]

Prepares data structures for use.

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

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

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

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

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

Definition at line 103 of file meshfree_interpolation.h.

References libMesh::MeshfreeInterpolation::_names.

00104   { _names = names; }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const MeshfreeInterpolation mfi 
) [friend, inherited]

Same as above, but allows you to also use stream syntax.


Member Data Documentation

template<unsigned int KDDim>
const int libMesh::InverseDistanceInterpolation< KDDim >::_half_power [private]

Definition at line 306 of file meshfree_interpolation.h.

template<unsigned int KDDim>
AutoPtr<kd_tree_t> libMesh::InverseDistanceInterpolation< KDDim >::_kd_tree [mutable, private]

Definition at line 288 of file meshfree_interpolation.h.

template<unsigned int KDDim>
const unsigned int libMesh::InverseDistanceInterpolation< KDDim >::_n_interp_pts [private]

Definition at line 307 of file meshfree_interpolation.h.

template<unsigned int KDDim>
PointListAdaptor<KDDim> libMesh::InverseDistanceInterpolation< KDDim >::_point_list_adaptor [private]

Definition at line 276 of file meshfree_interpolation.h.

std::vector<Point> libMesh::MeshfreeInterpolation::_src_pts [protected, inherited]
std::vector<Number> libMesh::MeshfreeInterpolation::_src_vals [protected, inherited]
template<unsigned int KDDim>
std::vector<Number> libMesh::InverseDistanceInterpolation< KDDim >::_vals [mutable, private]

Temporary work array. Object level scope to avoid cache thrashing.

Definition at line 312 of file meshfree_interpolation.h.


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

Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:30 UTC

Hosted By:
SourceForge.net Logo