23 params.
addRequiredParam<std::vector<UserObjectName>>(
"model",
"Name of POD surrogate models.");
25 params.addRequiredParam<SamplerName>(
"sampler",
26 "Sampler to use for evaluating surrogate models.");
27 params.addParam<
bool>(
30 "True to output value of parameter values from samples (this may be VERY large).");
31 params.addRequiredParam<std::string>(
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;
std::vector< VectorPostprocessorValue * > _value_vector
Vectors containing results of sampling model.
static InputParameters validParams()
Sampler & _sampler
Sampler for evaluating surrogate model.
A tool for output Sampler data.
static InputParameters validParams()
void gather(const unsigned int root_id, const T &send_data, std::vector< T, A > &recv) const
virtual void initialize() override
std::vector< VectorPostprocessorValue * > _sample_vector
Vector containing all the sample points for each parameter.
std::vector< Real > getNextLocalRow()
unsigned int size() const
dof_id_type getLocalRowBegin() const
std::string _variable_name
Name of the variable this tester operates on.
const Parallel::Communicator & _communicator
dof_id_type getNumberOfLocalRows() const
virtual const std::string & name() const
virtual void execute() override
registerMooseObject("StochasticToolsTestApp", PODSurrogateTester)
PODSurrogateTester(const InputParameters ¶meters)
static InputParameters validParams()
const bool _output_samples
Where or not to output all the samples used.
VectorPostprocessorValue & declareVector(const std::string &vector_name)
dof_id_type getLocalRowEnd() const
MultiMooseEnum _to_compute
The type of the post-processor value which needs to be extracted.
unsigned int get(unsigned int i) const
Interface for objects that need to use samplers.
virtual void finalize() override
std::vector< PODReducedBasisSurrogate * > _model
Pointers to surrogate model.
static InputParameters validParams()
dof_id_type getNumberOfCols() const