queso-0.53.0
|
Linear Lagrange interpolation surrogate. More...
#include <LinearLagrangeInterpolationSurrogate.h>
Public Member Functions | |
LinearLagrangeInterpolationSurrogate (const InterpolationSurrogateData< V, M > &data) | |
Constructor. More... | |
virtual | ~LinearLagrangeInterpolationSurrogate () |
virtual double | evaluate (const V &domainVector) const |
Evaluates value of the interpolant for the given domainVector. More... | |
unsigned int | n_coeffs () const |
The number of coeffs for interpolating. More... | |
Public Member Functions inherited from QUESO::InterpolationSurrogateBase< V, M > | |
InterpolationSurrogateBase (const InterpolationSurrogateData< V, M > &data) | |
Constructor. More... | |
virtual | ~InterpolationSurrogateBase () |
Public Member Functions inherited from QUESO::SurrogateBase< V > | |
SurrogateBase () | |
virtual | ~SurrogateBase () |
Protected Member Functions | |
void | compute_interval_indices (const V &domainVector, std::vector< unsigned int > &indices) const |
Helper function to get lower bound indices for each dimension. More... | |
void | compute_interval_values (const std::vector< unsigned int > &indices, std::vector< double > &x_min, std::vector< double > &x_max, std::vector< double > &values) const |
Helper function to populate bounding values for the intervals in each dimension. More... | |
double | eval_interpolant (const std::vector< double > &x_min, const std::vector< double > &x_max, const std::vector< double > &values, const V &domainVector) const |
Evaluate multidimensional linear Lagrange interpolant. More... | |
unsigned int | coordsToSingle (const std::vector< unsigned int > &indices) const |
Convert local indices to single "global" index. More... | |
void | singleToCoords (unsigned int global, std::vector< unsigned int > &indices) const |
Inverse of map computed in coordsToSingle. More... | |
double | tensor_product_lagrange (const std::vector< double > &x_min, const std::vector< double > &x_max, const std::vector< unsigned int > &indices, const V &domainVector) const |
Compute multidimensional Lagrange polynomial as tensor product of 1D polynomials. More... | |
double | lagrange_poly (double x0, double x1, double x, unsigned int index) const |
Evaluate a 1-D Lagrange polynomial at point x. More... | |
Private Member Functions | |
LinearLagrangeInterpolationSurrogate () | |
Additional Inherited Members | |
Protected Attributes inherited from QUESO::InterpolationSurrogateBase< V, M > | |
const InterpolationSurrogateData< V, M > & | m_data |
Linear Lagrange interpolation surrogate.
Aribritary dimension linear Lagrange interpolant. Uses a structured grid to interpolate values given by data passed to the constructor.
Definition at line 44 of file LinearLagrangeInterpolationSurrogate.h.
QUESO::LinearLagrangeInterpolationSurrogate< V, M >::LinearLagrangeInterpolationSurrogate | ( | const InterpolationSurrogateData< V, M > & | data | ) |
Constructor.
The data object should be already fully populated when constructing this object. The user can directly set values or use the InterpolationSurrogateBuilder object to populate the data.
Definition at line 37 of file LinearLagrangeInterpolationSurrogate.C.
|
inlinevirtual |
Definition at line 54 of file LinearLagrangeInterpolationSurrogate.h.
|
private |
|
protected |
Helper function to get lower bound indices for each dimension.
domainVector contains the current value at which want want to interpolate. We use that to figure out the bounding values in each dimension. Then we populate indices with the lower index.
Definition at line 66 of file LinearLagrangeInterpolationSurrogate.C.
References queso_assert_equal_to, and queso_assert_less.
|
protected |
Helper function to populate bounding values for the intervals in each dimension.
By convention, it is assumed that the indices vector contains the lower bound index. See compute_interval_indices.
Definition at line 83 of file LinearLagrangeInterpolationSurrogate.C.
References QUESO::InterpolationSurrogateHelper::coordToGlobal(), queso_assert_equal_to, and queso_error.
|
protected |
Convert local indices to single "global" index.
This is for handling the local ordering of an arbitrary dimensional linear Lagrange elements. The function will look like so we want a convenient way to map to a single integer. Then, we can order all our data this way and easily index into it. We can do this since each of is either 0 or 1.
Definition at line 166 of file LinearLagrangeInterpolationSurrogate.C.
References QUESO::InterpolationSurrogateHelper::coordToGlobal().
|
protected |
Evaluate multidimensional linear Lagrange interpolant.
This is just a tensor product of one-dimensional interpolants
Definition at line 139 of file LinearLagrangeInterpolationSurrogate.C.
References queso_assert_equal_to.
|
virtual |
Evaluates value of the interpolant for the given domainVector.
Implements QUESO::SurrogateBase< V >.
Definition at line 42 of file LinearLagrangeInterpolationSurrogate.C.
|
protected |
Evaluate a 1-D Lagrange polynomial at point x.
index tells us which of the two Lagrange functions to use. index must be 0 or 1.
Definition at line 209 of file LinearLagrangeInterpolationSurrogate.C.
References queso_assert, queso_assert_greater_equal, and queso_assert_less_equal.
|
inline |
The number of coeffs for interpolating.
Definition at line 60 of file LinearLagrangeInterpolationSurrogate.h.
References QUESO::InterpolationSurrogateBase< V, M >::m_data.
|
protected |
Inverse of map computed in coordsToSingle.
Definition at line 177 of file LinearLagrangeInterpolationSurrogate.C.
References QUESO::InterpolationSurrogateHelper::globalToCoord().
|
protected |
Compute multidimensional Lagrange polynomial as tensor product of 1D polynomials.
The indices vector contains the i,j,k,... values
Definition at line 188 of file LinearLagrangeInterpolationSurrogate.C.
References queso_assert_equal_to.