libMesh
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
libMesh::MeshfreeInterpolation Class Referenceabstract

Base class to support various mesh-free interpolation methods. More...

#include <meshfree_interpolation.h>

Inheritance diagram for libMesh::MeshfreeInterpolation:
[legend]

Public Types

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

Public Member Functions

 MeshfreeInterpolation (const libMesh::Parallel::Communicator &comm_in)
 Constructor. More...
 
void print_info (std::ostream &os=libMesh::out) const
 Prints information about this object, by default to libMesh::out. More...
 
virtual void clear ()
 Clears all internal data structures and restores to a pristine state. 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...
 
virtual void prepare_for_use ()
 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 =0
 Interpolate source data at target points. More...
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Protected Member Functions

virtual void gather_remote_data ()
 Gathers source points and values that have been added on other processors. More...
 

Protected Attributes

ParallelizationStrategy _parallelization_strategy
 
std::vector< std::string > _names
 
std::vector< Point_src_pts
 
std::vector< Number_src_vals
 
const Parallel::Communicator_communicator
 

Friends

std::ostream & operator<< (std::ostream &os, const MeshfreeInterpolation &mfi)
 Same as above, but allows you to also use stream syntax. More...
 

Detailed Description

Base class to support various mesh-free interpolation methods.

Such methods can be useful for example to pass data between two different domains which share a physical boundary, where that boundary may be discretized differently in each domain. This is the case for conjugate heat transfer applications where the common interface has overlapping but distinct boundary discretizations.

Author
Benjamin S. Kirk
Date
2012 Base class which defines the mesh-free interpolation interface.

Definition at line 57 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

◆ MeshfreeInterpolation()

libMesh::MeshfreeInterpolation::MeshfreeInterpolation ( const libMesh::Parallel::Communicator comm_in)

Constructor.

Definition at line 78 of file meshfree_interpolation.h.

78  :
79  ParallelObject(comm_in),
81  {}
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
ParallelizationStrategy _parallelization_strategy

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 
)
virtual

Sets source data at specified points.

◆ clear()

virtual void libMesh::MeshfreeInterpolation::clear ( )
virtual

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

Reimplemented in libMesh::InverseDistanceInterpolation< KDDim >, and libMesh::RadialBasisInterpolation< KDDim, RBF >.

◆ comm()

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

◆ field_variables()

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

Definition at line 117 of file meshfree_interpolation.h.

References _names.

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

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

◆ gather_remote_data()

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

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 ( )
Returns
A writable reference to the point list.

Definition at line 123 of file meshfree_interpolation.h.

References _src_pts.

124  { return _src_pts; }

◆ get_source_vals()

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

Definition at line 129 of file meshfree_interpolation.h.

References _src_vals.

130  { return _src_vals; }

◆ interpolate_field_data()

virtual void libMesh::MeshfreeInterpolation::interpolate_field_data ( const std::vector< std::string > &  field_names,
const std::vector< Point > &  tgt_pts,
std::vector< Number > &  tgt_vals 
) const
pure virtual

Interpolate source data at target points.

Pure virtual, must be overridden in derived classes.

Implemented in libMesh::InverseDistanceInterpolation< KDDim >, and libMesh::RadialBasisInterpolation< KDDim, RBF >.

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

◆ n_field_variables()

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

The number of field variables.

Definition at line 104 of file meshfree_interpolation.h.

References _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()

virtual void libMesh::MeshfreeInterpolation::prepare_for_use ( )
virtual

Prepares data structures for use.

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

Reimplemented in libMesh::RadialBasisInterpolation< KDDim, RBF >.

◆ print_info()

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

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)

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

Definition at line 111 of file meshfree_interpolation.h.

References _names.

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

Friends And Related Function Documentation

◆ operator<<

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

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

Member Data Documentation

◆ _communicator

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

◆ _names

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

◆ _parallelization_strategy

ParallelizationStrategy libMesh::MeshfreeInterpolation::_parallelization_strategy
protected

Definition at line 168 of file meshfree_interpolation.h.

◆ _src_pts

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

Definition at line 170 of file meshfree_interpolation.h.

Referenced by get_source_points().

◆ _src_vals

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

Definition at line 171 of file meshfree_interpolation.h.

Referenced by get_source_vals().


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