queso-0.57.1
|
#include <InterpolationSurrogateBase.h>
Public Member Functions | |
InterpolationSurrogateData (const BoxSubset< V, M > &domain, const std::vector< unsigned int > &n_points) | |
~InterpolationSurrogateData () | |
const BoxSubset< V, M > & | get_paramDomain () const |
const std::vector< unsigned int > & | get_n_points () const |
const std::vector< double > & | get_values () const |
std::vector< double > & | get_values () |
double | get_value (unsigned int n) const |
unsigned int | n_values () const |
void | set_values (std::vector< double > &values) |
Set all values. Dimension must be consistent with internal m_values. More... | |
void | set_value (unsigned int n, double value) |
unsigned int | dim () const |
Dimension of parameter space. More... | |
double | x_min (unsigned int dim) const |
Lower bound of domain along dimension dim. More... | |
double | x_max (unsigned int dim) const |
Upper bound of domain along dimension dim. More... | |
double | spacing (unsigned int dim) const |
Spacing between points along dimension dim. More... | |
double | get_x (unsigned int dim, unsigned int index) const |
Get spatial coordinate value at the node index along coordinate direction dim. More... | |
void | sync_values (unsigned int root) |
Sync values across all processors from root processor. More... | |
Private Member Functions | |
InterpolationSurrogateData () | |
void | check_dim_consistency () const |
Helper function for constructor. More... | |
void | init_values (const std::vector< unsigned int > &n_points) |
Helper function for sizing m_values. More... | |
void | check_domain_bounds () const |
Helper function for checking domain extent. More... | |
Private Attributes | |
const BoxSubset< V, M > & | m_domain |
Parameter domain over which we use surrogate. More... | |
const std::vector< unsigned int > & | m_n_points |
vector to store number of points in each coordinate direction More... | |
std::vector< double > | m_values |
vector to store values to be interpolated More... | |
Definition at line 34 of file InterpolationSurrogateBase.h.
QUESO::InterpolationSurrogateData< V, M >::InterpolationSurrogateData | ( | const BoxSubset< V, M > & | domain, |
const std::vector< unsigned int > & | n_points | ||
) |
Definition at line 40 of file InterpolationSurrogateData.C.
References QUESO::InterpolationSurrogateData< V, M >::check_dim_consistency(), QUESO::InterpolationSurrogateData< V, M >::check_domain_bounds(), QUESO::InterpolationSurrogateData< V, M >::init_values(), and QUESO::InterpolationSurrogateData< V, M >::m_n_points.
|
inline |
Definition at line 43 of file InterpolationSurrogateData.h.
|
private |
|
private |
Helper function for constructor.
Definition at line 56 of file InterpolationSurrogateData.C.
References dim.
Referenced by QUESO::InterpolationSurrogateData< V, M >::InterpolationSurrogateData().
|
private |
Helper function for checking domain extent.
Definition at line 88 of file InterpolationSurrogateData.C.
References QUESO::queso_isfinite().
Referenced by QUESO::InterpolationSurrogateData< V, M >::InterpolationSurrogateData().
|
inline |
Dimension of parameter space.
Definition at line 72 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::m_domain.
Referenced by QUESO::InterpolationSurrogateData< V, M >::x_max(), and QUESO::InterpolationSurrogateData< V, M >::x_min().
|
inline |
Definition at line 48 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::m_n_points.
Referenced by QUESO::InterpolationSurrogateIOASCII< V, M >::write().
|
inline |
Definition at line 45 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::m_domain.
Referenced by QUESO::InterpolationSurrogateBuilder< V, M >::sync_data(), and QUESO::InterpolationSurrogateIOASCII< V, M >::write().
|
inline |
Definition at line 57 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::m_values.
Referenced by QUESO::InterpolationSurrogateIOASCII< V, M >::write().
|
inline |
Definition at line 51 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::m_values.
|
inline |
Definition at line 54 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::m_values.
double QUESO::InterpolationSurrogateData< V, M >::get_x | ( | unsigned int | dim, |
unsigned int | index | ||
) | const |
Get spatial coordinate value at the node index along coordinate direction dim.
Definition at line 125 of file InterpolationSurrogateData.C.
|
private |
Helper function for sizing m_values.
Definition at line 75 of file InterpolationSurrogateData.C.
Referenced by QUESO::InterpolationSurrogateData< V, M >::InterpolationSurrogateData().
|
inline |
Definition at line 61 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::m_values.
Referenced by QUESO::InterpolationSurrogateBuilder< V, M >::sync_data(), and QUESO::InterpolationSurrogateIOASCII< V, M >::write().
void QUESO::InterpolationSurrogateData< V, M >::set_value | ( | unsigned int | n, |
double | value | ||
) |
Definition at line 107 of file InterpolationSurrogateData.C.
Referenced by QUESO::InterpolationSurrogateBuilder< V, M >::sync_data().
void QUESO::InterpolationSurrogateData< V, M >::set_values | ( | std::vector< double > & | values | ) |
Set all values. Dimension must be consistent with internal m_values.
This does a full copy of the values vector. This is mainly for testing, users are encouraged to use the InterpolationSurrogateBuilder.
Definition at line 99 of file InterpolationSurrogateData.C.
double QUESO::InterpolationSurrogateData< V, M >::spacing | ( | unsigned int | dim | ) | const |
Spacing between points along dimension dim.
Definition at line 115 of file InterpolationSurrogateData.C.
References dim.
void QUESO::InterpolationSurrogateData< V, M >::sync_values | ( | unsigned int | root | ) |
Sync values across all processors from root processor.
m_values may only be set on one processor, so this method is used for MPI_Bcast'ing those values to all processors. This calls MPI_Bcast, which is collective, so this MUST be called from all processors in env.fullComm().
Definition at line 134 of file InterpolationSurrogateData.C.
References QUESO::MpiComm::Bcast().
Referenced by QUESO::InterpolationSurrogateBuilder< V, M >::sync_data().
|
inline |
Upper bound of domain along dimension dim.
Definition at line 80 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::dim(), and QUESO::InterpolationSurrogateData< V, M >::m_domain.
Referenced by QUESO::InterpolationSurrogateIOASCII< V, M >::write().
|
inline |
Lower bound of domain along dimension dim.
Definition at line 76 of file InterpolationSurrogateData.h.
References QUESO::InterpolationSurrogateData< V, M >::dim(), and QUESO::InterpolationSurrogateData< V, M >::m_domain.
Referenced by QUESO::InterpolationSurrogateIOASCII< V, M >::write().
|
private |
Parameter domain over which we use surrogate.
Definition at line 110 of file InterpolationSurrogateData.h.
Referenced by QUESO::InterpolationSurrogateData< V, M >::dim(), QUESO::InterpolationSurrogateData< V, M >::get_paramDomain(), QUESO::InterpolationSurrogateData< V, M >::x_max(), and QUESO::InterpolationSurrogateData< V, M >::x_min().
|
private |
vector to store number of points in each coordinate direction
We assume that the spacing in each coordinate direction is constant so we only need to know the number of points.
Definition at line 115 of file InterpolationSurrogateData.h.
Referenced by QUESO::InterpolationSurrogateData< V, M >::get_n_points(), and QUESO::InterpolationSurrogateData< V, M >::InterpolationSurrogateData().
|
private |
vector to store values to be interpolated
These will be stored in a particular ordering. Helper functions will provide mapping between grid coordinates and a global coordinate; the global coordinate will be used to index into the values.
Definition at line 123 of file InterpolationSurrogateData.h.
Referenced by QUESO::InterpolationSurrogateData< V, M >::get_value(), QUESO::InterpolationSurrogateData< V, M >::get_values(), and QUESO::InterpolationSurrogateData< V, M >::n_values().