queso-0.53.0
|
#include <InterpolationSurrogateHelper.h>
Public Member Functions | |
InterpolationSurrogateHelper () | |
~InterpolationSurrogateHelper () | |
Static Public Member Functions | |
static unsigned int | coordToGlobal (const std::vector< unsigned int > &coord_indices, const std::vector< unsigned int > &n_points) |
Map coordinate indices to a singal global index. More... | |
static void | globalToCoord (unsigned int global, const std::vector< unsigned int > &n_points, std::vector< unsigned int > &coord_indices) |
Inverse of coordToGlobal map. More... | |
Static Private Member Functions | |
static unsigned int | compute_npoints_factor (const std::vector< unsigned int > &n_points, unsigned int term) |
Helper function. More... | |
Definition at line 33 of file InterpolationSurrogateHelper.h.
|
inline |
Definition at line 37 of file InterpolationSurrogateHelper.h.
|
inline |
Definition at line 39 of file InterpolationSurrogateHelper.h.
|
staticprivate |
Helper function.
coordToGlobal computes: i + j*n_points[0] + k*n_points[0]*n_points[1] + ... To compute inverse we need the product of n_points terms, depending on which term we are computing. So, given n_points and the current term, we compute the correct number of products of n_points.
Definition at line 95 of file InterpolationSurrogateHelper.C.
Referenced by globalToCoord().
|
static |
Map coordinate indices to a singal global index.
e.g. in 3-D, you pass in i,j,k and the n_points in each of the 3 directions. This function will return the corresponding global index to which the value at i,j,k can be indexed. Ordering must be consistent between coord_indices and n_points. Must be ordered in increasing dimension. e.g. x,y,z,... The user shouldn't need to call this method, this is public mainly to facilitate testing.
Definition at line 34 of file InterpolationSurrogateHelper.C.
References dim, queso_assert_equal_to, and queso_assert_less.
Referenced by QUESO::LinearLagrangeInterpolationSurrogate< V, M >::compute_interval_values(), QUESO::LinearLagrangeInterpolationSurrogate< V, M >::coordsToSingle(), and globalToCoord().
|
static |
Inverse of coordToGlobal map.
Given the global index and the n_points in each direction, we back out the coordinate indices and return them in coord_indices.
Definition at line 68 of file InterpolationSurrogateHelper.C.
References compute_npoints_factor(), coordToGlobal(), dim, and queso_assert_equal_to.
Referenced by QUESO::InterpolationSurrogateBuilder< V, M >::set_domain_vector(), and QUESO::LinearLagrangeInterpolationSurrogate< V, M >::singleToCoords().