queso-0.53.0
|
Build interpolation-based surrogate. More...
#include <InterpolationSurrogateBuilder.h>
Public Member Functions | |
InterpolationSurrogateBuilder (InterpolationSurrogateDataSet< V, M > &data) | |
Constructor. More... | |
virtual | ~InterpolationSurrogateBuilder () |
void | build_values () |
Execute the user's model and populate m_values for the given n_points. More... | |
Public Member Functions inherited from QUESO::SurrogateBuilderBase< V > | |
SurrogateBuilderBase () | |
virtual | ~SurrogateBuilderBase () |
virtual void | evaluate_model (const V &domainVector, std::vector< double > &values)=0 |
Protected Member Functions | |
void | partition_work () |
Partition the workload of model evaluations across the subenvironments. More... | |
void | set_work_bounds (unsigned int &n_begin, unsigned int &n_end) const |
Set the starting and ending global indices for the current subenvironment. More... | |
void | sync_data (std::vector< unsigned int > &local_n, std::vector< double > &local_values, InterpolationSurrogateData< V, M > &data) |
Take the local values computed from each process and communicate. More... | |
void | set_domain_vector (unsigned int n, V &domain_vector) const |
Provide the spatial coordinates for the global index n. More... | |
void | compute_strides (std::vector< int > &strides) const |
Helper function to compute strides needed for MPI_Gatherv. More... | |
const InterpolationSurrogateData< V, M > & | get_default_data () const |
Helper function to grab representative dataset from m_data. More... | |
Protected Attributes | |
InterpolationSurrogateDataSet < V, M > & | m_data |
std::vector< int > | m_njobs |
Cache the amount of work for each subenvironment. More... | |
Private Member Functions | |
InterpolationSurrogateBuilder () | |
Build interpolation-based surrogate.
Interpolation surrogates assume a structured grid. So, given the domain and the number of equally space points desired in each dimension, this class will handle calling the user's model to populate the values needed by the surrogate objects. User should subclass this object and implement the evaluate_model method.
Definition at line 43 of file InterpolationSurrogateBuilder.h.
QUESO::InterpolationSurrogateBuilder< V, M >::InterpolationSurrogateBuilder | ( | InterpolationSurrogateDataSet< V, M > & | data | ) |
Constructor.
We do not take a const& to the data because we want to compute and set the values directly.
Definition at line 40 of file InterpolationSurrogateBuilder.C.
References QUESO::InterpolationSurrogateBuilder< V, M >::partition_work().
|
inlinevirtual |
Definition at line 52 of file InterpolationSurrogateBuilder.h.
|
private |
void QUESO::InterpolationSurrogateBuilder< V, M >::build_values | ( | ) |
Execute the user's model and populate m_values for the given n_points.
Definition at line 82 of file InterpolationSurrogateBuilder.C.
References it.
|
protected |
Helper function to compute strides needed for MPI_Gatherv.
Definition at line 202 of file InterpolationSurrogateBuilder.C.
|
inlineprotected |
Helper function to grab representative dataset from m_data.
We only grab the first data set since the environments are guaranteed to be consistent by the nature of constructing an InterpolationSurrogateDataSet.
Definition at line 89 of file InterpolationSurrogateBuilder.h.
References QUESO::InterpolationSurrogateBuilder< V, M >::m_data.
|
protected |
Partition the workload of model evaluations across the subenvironments.
Definition at line 49 of file InterpolationSurrogateBuilder.C.
References queso_assert_equal_to.
Referenced by QUESO::InterpolationSurrogateBuilder< V, M >::InterpolationSurrogateBuilder().
|
protected |
Provide the spatial coordinates for the global index n.
Definition at line 188 of file InterpolationSurrogateBuilder.C.
References dim, and QUESO::InterpolationSurrogateHelper::globalToCoord().
|
protected |
Set the starting and ending global indices for the current subenvironment.
This environment will evaluate the model for indices [n_begin,n_end)
Definition at line 126 of file InterpolationSurrogateBuilder.C.
|
protected |
Take the local values computed from each process and communicate.
The end result will be that all processes have all the data. I.e. m_values will be completely populated on all processes. This is done on the InterpolationSurrogateData passed to the function.
Definition at line 139 of file InterpolationSurrogateBuilder.C.
References QUESO::MpiComm::Gatherv(), QUESO::InterpolationSurrogateData< V, M >::get_paramDomain(), QUESO::InterpolationSurrogateData< V, M >::n_values(), QUESO::InterpolationSurrogateData< V, M >::set_value(), and QUESO::InterpolationSurrogateData< V, M >::sync_values().
|
protected |
Definition at line 59 of file InterpolationSurrogateBuilder.h.
Referenced by QUESO::InterpolationSurrogateBuilder< V, M >::get_default_data().
|
protected |
Cache the amount of work for each subenvironment.
Definition at line 62 of file InterpolationSurrogateBuilder.h.