23 params.
addRequiredParam<std::vector<UserObjectName>>(
"model",
"Name of POD surrogate models.");
26 "Sampler to use for evaluating surrogate models.");
30 "True to output value of parameter values from samples (this may be VERY large).");
32 "variable_name",
"The name of the variable this prostprocessor is supposed to operate on.");
33 MultiMooseEnum pptype(
"nodal_max=0 nodal_min=1 nodal_l1=2 nodal_l2=3 nodal_linf=4");
35 "to_compute", pptype,
"The global data the postprocessor should compute.");
42 _sampler(getSampler(
"sampler")),
43 _output_samples(getParam<bool>(
"output_samples")),
44 _variable_name(getParam<
std::string>(
"variable_name")),
47 const auto & model_names = getParam<std::vector<UserObjectName>>(
"model");
48 _model.reserve(model_names.size());
51 for (
unsigned int model_i = 0; model_i < model_names.size(); ++model_i)
54 _model.push_back(&getSurrogateModelByName<PODReducedBasisSurrogate>(model_names[model_i]));
83 unsigned int n_models =
_model.size();
91 for (
unsigned int m = 0; m < n_models; ++m)
93 _model[m]->evaluateSolution(data);
94 for (
unsigned int ppi = 0; ppi < n_pp; ++ppi)
96 unsigned int idx = m * n_pp + ppi;
registerMooseObject("StochasticToolsTestApp", PODSurrogateTester)
static InputParameters validParams()
const std::string & name() const
unsigned int get(unsigned int i) const
void push_back(const std::string &names)
unsigned int size() const
A tool for output Sampler data.
std::string _variable_name
Name of the variable this tester operates on.
std::vector< VectorPostprocessorValue * > _sample_vector
Vector containing all the sample points for each parameter.
Sampler & _sampler
Sampler for evaluating surrogate model.
const bool _output_samples
Where or not to output all the samples used.
MultiMooseEnum _to_compute
The type of the post-processor value which needs to be extracted.
virtual void finalize() override
virtual void execute() override
std::vector< VectorPostprocessorValue * > _value_vector
Vectors containing results of sampling model.
virtual void initialize() override
static InputParameters validParams()
PODSurrogateTester(const InputParameters ¶meters)
std::vector< PODReducedBasisSurrogate * > _model
Pointers to surrogate model.
static InputParameters validParams()
std::vector< Real > getNextLocalRow()
dof_id_type getNumberOfLocalRows() const
dof_id_type getLocalRowEnd() const
dof_id_type getLocalRowBegin() const
dof_id_type getNumberOfCols() const
Interface for objects that need to use samplers.
static InputParameters validParams()
void gather(const unsigned int root_id, const T &send_data, std::vector< T, A > &recv) const
VectorPostprocessorValue & declareVector(const std::string &vector_name)
const Parallel::Communicator & _communicator