ivutils
|
Class for interpolation (set of indices in some array and coefficients). More...
#include <transfer.h>
Public Member Functions | |
Interpolation () | |
default constructor | |
Interpolation (index_t ind) | |
constructor from a single index | |
Interpolation (const Interpolation &other) | |
copy constructor | |
Interpolation & | operator= (const Interpolation &other) |
reference copy | |
Interpolation (const std::map< index_t, coef_t > &cmap) | |
constructor from a map {ind, coeff} | |
int | remap (const std::map< index_t, index_t > &cmap) |
Calculates buffer indices from mesh indices indices according to the map. | |
template<class sh_it , class c_it > | |
Interpolation (index_t m_ind_, index_t n_, sh_it shifts_, c_it coeffs_, int managed) | |
constructor from shifts and coeffs input iterators using data copy: managed is a dummy and assumed to be positive | |
Interpolation (index_t m_ind_, index_t n_, typename Interpolation::shift_it shifts_, typename Interpolation::coeff_it coeffs_) | |
specialization for vector input iterators uses pencil referencing (no data copy) | |
template<class T > | |
int | add_to (const T &c1, std::map< index_t, coef_t > &cmap) const |
record indices and coefficients to a map (key - index, value - coefficient) all coefficients are multiplied by c1 | |
int | copy_to (std::vector< index_t > &vsh, std::vector< coef_t > &vcf) const |
record indices and coefficiens to corresponding vectors | |
template<class T > | |
T | get_value (const T *ptr) const |
gets the value associated with the interpolation entry | |
template<class T > | |
T | get_value_bind (const T *ptr) const |
gets the value associated with the interpolation entry using bind indices | |
size_t | data_size () const |
For variable size interpolations returns the size of the result, otherwise 1. | |
size_t | vec_data_size () const |
For variable size interpolations returns the size of the vectorized part in number of vectors, otherwise 0. | |
void | set_fix_data_sizes (size_t _vector_size, size_t _scalar_size) |
Added for compatibility reasons. Does nothing. | |
coef_t | get_time () const |
For time interpolations returns the time. | |
int | get_tgradient () const |
For vector time interpolations returns time gradient along the vector. | |
Protected Attributes | |
index_t | m_ind |
all indices are shifted from this index. m_ind is always non-negative | |
pencil< index_t, std::vector< index_t > > | shifts |
interpolation indices (shifted from m_ind), referencing the main grid | |
pencil< coef_t, std::vector< coef_t > > | coeffs |
interpolation coefficients | |
Class for interpolation (set of indices in some array and coefficients).
Indices and coefficients are recorded in a vector This vector could be stored in this class or in some external class, which records other interpolations to this vector as well (see InterpPacker) coef_tt is type for interpolation coefficients (for example, double or complex) index_t is type for array indexation (int for 32-bit architecture)
|
inline |
Calculates buffer indices from mesh indices indices according to the map.
Unfound indices are not changed.