Derived class within the interface class hierarchy for supporting approximations to simulation-based results. More...
Public Member Functions | |
ApproximationInterface (ProblemDescDB &problem_db, const Variables &am_vars, bool am_cache, const String &am_interface_id, size_t num_fns) | |
primary constructor | |
ApproximationInterface (const String &approx_type, const UShortArray &approx_order, const Variables &am_vars, bool am_cache, const String &am_interface_id, size_t num_fns, short data_order, short output_level) | |
alternate constructor for instantiations on the fly | |
~ApproximationInterface () | |
destructor | |
Protected Member Functions | |
void | map (const Variables &vars, const ActiveSet &set, Response &response, const bool asynch_flag=false) |
the function evaluator: provides an approximate "mapping" from the variables to the responses using functionSurfaces | |
int | minimum_points (bool constraint_flag) const |
returns the minimum number of samples required to build the functionSurfaces | |
int | recommended_points (bool constraint_flag) const |
returns the recommended number of samples recommended to build the functionSurfaces | |
void | approximation_function_indices (const IntSet &approx_fn_indices) |
set the (currently active) approximation function index set | |
void | update_approximation (const Variables &vars, const IntResponsePair &response_pr) |
void | update_approximation (const RealMatrix &samples, const IntResponseMap &resp_map) |
void | update_approximation (const VariablesArray &vars_array, const IntResponseMap &resp_map) |
void | append_approximation (const Variables &vars, const IntResponsePair &response_pr) |
void | append_approximation (const RealMatrix &samples, const IntResponseMap &resp_map) |
void | append_approximation (const VariablesArray &vars_array, const IntResponseMap &resp_map) |
void | build_approximation (const RealVector &lower_bnds, const RealVector &upper_bnds) |
void | rebuild_approximation (const BoolDeque &rebuild_deque) |
void | pop_approximation (bool save_surr_data) |
void | restore_approximation () |
bool | restore_available () |
void | finalize_approximation () |
finalizes the approximation by applying all trial increments | |
void | store_approximation () |
move the current approximation into storage for later combination | |
void | combine_approximation (short corr_type) |
combine the current approximation with one previously stored | |
void | clear_current () |
clears current data from an approximation interface | |
void | clear_all () |
clears all data from an approximation interface | |
std::vector< Approximation > & | approximations () |
retrieve the Approximations within an ApproximationInterface | |
const Pecos::SurrogateData & | approximation_data (size_t index) |
retrieve the approximation data from a particular Approximation within an ApproximationInterface | |
const RealVectorArray & | approximation_coefficients () |
retrieve the approximation coefficients from each Approximation within an ApproximationInterface | |
void | approximation_coefficients (const RealVectorArray &approx_coeffs) |
set the approximation coefficients within each Approximation within an ApproximationInterface | |
const RealVector & | approximation_variances (const RealVector &c_vars) |
retrieve the approximation variances from each Approximation within an ApproximationInterface | |
const IntResponseMap & | synch () |
recovers data from a series of asynchronous evaluations (blocking) | |
const IntResponseMap & | synch_nowait () |
recovers data from a series of asynchronous evaluations (nonblocking) | |
Private Member Functions | |
void | mixed_add (const Variables &vars, const Response &response, bool anchor) |
add variables/response data to functionSurfaces using a mixture of shallow and deep copies | |
void | mixed_add (const Real *c_vars, const Response &response, bool anchor) |
add variables/response data to functionSurfaces using a mixture of shallow and deep copies | |
void | shallow_add (const Variables &vars, const Response &response, bool anchor) |
add variables/response data to functionSurfaces using a shallow copy | |
void | update_pop_counts (const IntResponseMap &resp_map) |
update the popCount within each of the functionSurfaces based on the active set definitions within resp_map | |
Private Attributes | |
IntSet | approxFnIndices |
for incomplete approximation sets, this array specifies the response function subset that is approximated | |
std::vector< Approximation > | functionSurfaces |
list of approximations, one per response function | |
RealVectorArray | functionSurfaceCoeffs |
array of approximation coefficient vectors, one vector per response function | |
RealVector | functionSurfaceVariances |
vector of approximation variances, one value per response function | |
StringArray | diagnosticSet |
set of diagnostic metrics | |
Variables | actualModelVars |
copy of the actualModel variables object used to simplify conversion among differing variable views | |
bool | actualModelCache |
indicates usage of an evaluation cache by the actualModel | |
String | actualModelInterfaceId |
the interface id from the actualModel used for ordered PRPCache lookups | |
IntResponseMap | beforeSynchResponseMap |
bookkeeping map to catalogue responses generated in map() for use in synch() and synch_nowait(). This supports pseudo-asynchronous operations (approximate responses are always computed synchronously, but asynchronous virtual functions are supported through bookkeeping). |
Derived class within the interface class hierarchy for supporting approximations to simulation-based results.
ApproximationInterface provides an interface class for building a set of global/local/multipoint approximations and performing approximate function evaluations using them. It contains a list of Approximation objects, one for each response function.
void update_approximation | ( | const Variables & | vars, |
const IntResponsePair & | response_pr | ||
) | [protected, virtual] |
This function populates/replaces each Approximation::anchorPoint with the incoming variables/response data point.
Reimplemented from Interface.
References ApproximationInterface::actualModelCache, ApproximationInterface::actualModelInterfaceId, Dakota::data_pairs, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), and ApproximationInterface::shallow_add().
void update_approximation | ( | const RealMatrix & | samples, |
const IntResponseMap & | resp_map | ||
) | [protected, virtual] |
This function populates/replaces each Approximation::currentPoints with the incoming variables/response arrays.
Reimplemented from Interface.
References Dakota::abort_handler(), ApproximationInterface::actualModelCache, ApproximationInterface::actualModelInterfaceId, ApproximationInterface::approxFnIndices, Dakota::data_pairs, ApproximationInterface::functionSurfaces, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), and ApproximationInterface::shallow_add().
void update_approximation | ( | const VariablesArray & | vars_array, |
const IntResponseMap & | resp_map | ||
) | [protected, virtual] |
This function populates/replaces each Approximation::currentPoints with the incoming variables/response arrays.
Reimplemented from Interface.
References Dakota::abort_handler(), ApproximationInterface::actualModelCache, ApproximationInterface::actualModelInterfaceId, ApproximationInterface::approxFnIndices, Dakota::data_pairs, ApproximationInterface::functionSurfaces, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), and ApproximationInterface::shallow_add().
void append_approximation | ( | const Variables & | vars, |
const IntResponsePair & | response_pr | ||
) | [protected, virtual] |
This function appends to each Approximation::currentPoints with one incoming variables/response data point.
Reimplemented from Interface.
References ApproximationInterface::actualModelCache, ApproximationInterface::actualModelInterfaceId, ApproximationInterface::approxFnIndices, Dakota::data_pairs, ApproximationInterface::functionSurfaces, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), and ApproximationInterface::shallow_add().
void append_approximation | ( | const RealMatrix & | samples, |
const IntResponseMap & | resp_map | ||
) | [protected, virtual] |
This function appends to each Approximation::currentPoints with multiple incoming variables/response data points.
Reimplemented from Interface.
References Dakota::abort_handler(), ApproximationInterface::actualModelCache, ApproximationInterface::actualModelInterfaceId, Dakota::data_pairs, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), ApproximationInterface::shallow_add(), and ApproximationInterface::update_pop_counts().
void append_approximation | ( | const VariablesArray & | vars_array, |
const IntResponseMap & | resp_map | ||
) | [protected, virtual] |
This function appends to each Approximation::currentPoints with multiple incoming variables/response data points.
Reimplemented from Interface.
References Dakota::abort_handler(), ApproximationInterface::actualModelCache, ApproximationInterface::actualModelInterfaceId, Dakota::data_pairs, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), ApproximationInterface::shallow_add(), and ApproximationInterface::update_pop_counts().
void build_approximation | ( | const RealVector & | lower_bnds, |
const RealVector & | upper_bnds | ||
) | [protected, virtual] |
This function finds the coefficients for each Approximation based on the data passed through update_approximation() calls. The bounds are used only for graphics visualization.
Reimplemented from Interface.
References ApproximationInterface::approxFnIndices, ApproximationInterface::diagnosticSet, ApproximationInterface::functionSurfaces, and Interface::outputLevel.
void rebuild_approximation | ( | const BoolDeque & | rebuild_deque | ) | [protected, virtual] |
This function updates the coefficients for each Approximation based on data increments provided by {update,append}_approximation().
Reimplemented from Interface.
References ApproximationInterface::approxFnIndices, and ApproximationInterface::functionSurfaces.
void pop_approximation | ( | bool | save_surr_data | ) | [protected, virtual] |
This function removes data provided by a previous call to append_approximation().
Reimplemented from Interface.
References ApproximationInterface::approxFnIndices, and ApproximationInterface::functionSurfaces.
void restore_approximation | ( | ) | [protected, virtual] |
This function updates the coefficients for each Approximation based on data increments provided by {update,append}_approximation().
Reimplemented from Interface.
References ApproximationInterface::approxFnIndices, and ApproximationInterface::functionSurfaces.
bool restore_available | ( | ) | [protected, virtual] |
This function updates the coefficients for each Approximation based on data increments provided by {update,append}_approximation().
Reimplemented from Interface.
References ApproximationInterface::approxFnIndices, and ApproximationInterface::functionSurfaces.
std::vector<Approximation> functionSurfaces [private] |
list of approximations, one per response function
This formulation allows the use of mixed approximations (i.e., different approximations used for different response functions), although the input specification is not currently general enough to support it.
Referenced by ApproximationInterface::append_approximation(), ApproximationInterface::approximation_coefficients(), ApproximationInterface::approximation_data(), ApproximationInterface::approximation_variances(), ApproximationInterface::ApproximationInterface(), ApproximationInterface::approximations(), ApproximationInterface::build_approximation(), ApproximationInterface::clear_all(), ApproximationInterface::clear_current(), ApproximationInterface::combine_approximation(), ApproximationInterface::finalize_approximation(), ApproximationInterface::map(), ApproximationInterface::minimum_points(), ApproximationInterface::mixed_add(), ApproximationInterface::pop_approximation(), ApproximationInterface::rebuild_approximation(), ApproximationInterface::recommended_points(), ApproximationInterface::restore_approximation(), ApproximationInterface::restore_available(), ApproximationInterface::shallow_add(), ApproximationInterface::store_approximation(), ApproximationInterface::update_approximation(), and ApproximationInterface::update_pop_counts().