$extrastylesheet
Dakota
Version 6.2
|
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, 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 &c_l_bnds, const RealVector &c_u_bnds, const IntVector &di_l_bnds, const IntVector &di_u_bnds, const RealVector &dr_l_bnds, const RealVector &dr_u_bnds) |
void | rebuild_approximation (const BoolDeque &rebuild_deque) |
void | pop_approximation (bool save_surr_data) |
void | restore_approximation () |
bool | restore_available () |
queries the approximation for the ability to restore a previous increment | |
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 | |
void | clear_saved () |
clears saved data (from pop invocations) from an approximation interface | |
SharedApproxData & | shared_approximation () |
retrieve the SharedApproxData within an ApproximationInterface | |
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 (bool normalized=false) |
retrieve the approximation coefficients from each Approximation within an ApproximationInterface | |
void | approximation_coefficients (const RealVectorArray &approx_coeffs, bool normalized=false) |
set the approximation coefficients within each Approximation within an ApproximationInterface | |
const RealVector & | approximation_variances (const Variables &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 | sample_to_variables (const Real *sample_c_vars, size_t num_cv, Variables &vars) |
populate continuous variables within vars from sample_c_vars | |
void | update_pop_counts (const IntResponseMap &resp_map) |
append to the popCountStack within each of the functionSurfaces based on the active set definitions within resp_map | |
void | read_challenge_points (bool active_only) |
Load approximation test points from user challenge points file. | |
Private Attributes | |
IntSet | approxFnIndices |
for incomplete approximation sets, this array specifies the response function subset that is approximated | |
SharedApproxData | sharedData |
data that is shared among all functionSurfaces | |
std::vector< Approximation > | functionSurfaces |
list of approximations, one per response function | |
RealVectorArray | functionSurfaceCoeffs |
array of approximation coefficient vectors, one per response function | |
RealVector | functionSurfaceVariances |
vector of approximation variances, one value per response function | |
String | challengeFile |
data file for user-supplied challenge data (per interface, since may contain multiple responses) | |
unsigned short | challengeFormat |
tabular format of the challenge points file | |
bool | challengeActiveOnly |
whether to import active only | |
RealMatrix | challengePoints |
container for the challenge points data | |
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::actualModelVars, ApproximationInterface::approxFnIndices, Dakota::data_pairs, ApproximationInterface::functionSurfaces, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), ApproximationInterface::sample_to_variables(), 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, ApproximationInterface::actualModelVars, Dakota::data_pairs, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), ApproximationInterface::sample_to_variables(), 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 & | c_l_bnds, |
const RealVector & | c_u_bnds, | ||
const IntVector & | di_l_bnds, | ||
const IntVector & | di_u_bnds, | ||
const RealVector & | dr_l_bnds, | ||
const RealVector & | dr_u_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, SharedApproxData::build(), ApproximationInterface::challengeFile, ApproximationInterface::challengePoints, ApproximationInterface::functionSurfaces, ApproximationInterface::read_challenge_points(), SharedApproxData::set_bounds(), and ApproximationInterface::sharedData.
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, ApproximationInterface::functionSurfaces, SharedApproxData::rebuild(), and ApproximationInterface::sharedData.
void pop_approximation | ( | bool | save_surr_data | ) | [inline, protected, virtual] |
This function removes data provided by a previous append_approximation() call, possibly different numbers for each function, or as specified in pop_count, which is assumed to be the same for all functions.
Reimplemented from Interface.
References ApproximationInterface::approxFnIndices, ApproximationInterface::functionSurfaces, SharedApproxData::pop(), and ApproximationInterface::sharedData.
void restore_approximation | ( | ) | [inline, 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, ApproximationInterface::functionSurfaces, SharedApproxData::post_restore(), SharedApproxData::pre_restore(), and ApproximationInterface::sharedData.
void read_challenge_points | ( | bool | active_only | ) | [private] |
Load approximation test points from user challenge points file.
Challenge data defaults to active/inactive, but user can override to active only.
References ApproximationInterface::actualModelVars, ApproximationInterface::challengeActiveOnly, ApproximationInterface::challengeFile, ApproximationInterface::challengeFormat, ApproximationInterface::challengePoints, Variables::copy(), Dakota::copy_data(), Variables::cv(), Variables::div(), Variables::drv(), Variables::dsv(), ApproximationInterface::functionSurfaces, and Variables::tv().
Referenced by ApproximationInterface::build_approximation().
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::clear_saved(), ApproximationInterface::combine_approximation(), ApproximationInterface::finalize_approximation(), ApproximationInterface::map(), ApproximationInterface::minimum_points(), ApproximationInterface::mixed_add(), ApproximationInterface::pop_approximation(), ApproximationInterface::read_challenge_points(), ApproximationInterface::rebuild_approximation(), ApproximationInterface::recommended_points(), ApproximationInterface::restore_approximation(), ApproximationInterface::shallow_add(), ApproximationInterface::store_approximation(), ApproximationInterface::update_approximation(), and ApproximationInterface::update_pop_counts().