19 params.
addClassDescription(
"Sets a value of a scalar variable based on a surrogate model.");
20 params.
addRequiredParam<UserObjectName>(
"model",
"Name of surrogate models.");
23 "Parameter values at which the surrogate is evaluated. Accepts scalar variables, "
24 "postprocessors, and real numbers.");
36 const auto parameter_names = getParam<std::vector<std::string>>(
"parameters");
38 for (
unsigned int j = 0; j <
_n_params; ++j)
40 const auto name = parameter_names[j];
57 std::stringstream ss(
name);
65 " is not a scalar variable, postprocessor, or real number");
81 for (
unsigned int j = 0; j <
_n_scalar; ++j)
84 for (
unsigned int j = 0; j <
_n_pp; ++j)
87 for (
unsigned int j = 0; j <
_n_real; ++j)
const std::vector< double > x
registerMooseObject("StochasticToolsApp", SurrogateModelScalarAux)
static InputParameters validParams()
virtual bool hasScalarVariable(const std::string &var_name) const override
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
bool hasPostprocessorValueByName(const PostprocessorName &name) const
const std::string & name() const
void paramError(const std::string ¶m, Args... args) const
const VariableValue & sln() const
virtual const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name) const
FEProblemBase & _sc_fe_problem
Interface for objects that need to use samplers.
static InputParameters validParams()
Sets a value of a scalar variable based on a surrogate model.
void initialSetup() override
const SurrogateModel & _model
Pointers to surrogate model.
std::vector< const PostprocessorValue * > _pp_params
the pp parameters that _model is evaluated at
std::vector< unsigned int > _real_indices
static InputParameters validParams()
std::vector< unsigned int > _scalar_var_indices
std::vector< unsigned int > _pp_indices
std::vector< Real > _real_params
the real parameters that _model is evaluated at
virtual Real computeValue() override
std::vector< const Real * > _scalar_var_params
the real parameters that _model is evaluated at
unsigned int _n_params
number of parameters
SurrogateModelScalarAux(const InputParameters ¶meters)
virtual Real evaluate(const std::vector< Real > &x) const
Evaluate surrogate model given a row of parameters.