21 "evaluated, otherwise data is set to a default value.");
26 "function expression that should evaluate to 0 if sample should NOT be evaluated.");
28 "Value to replace in data when sample is not evaluated.");
29 params.
addParam<std::vector<std::string>>(
30 "sampler_vars", std::vector<std::string>(),
"Vector of variables defined by sampler values.");
31 params.
addParam<std::vector<unsigned int>>(
"sampler_var_indices",
32 std::vector<unsigned int>(),
33 "Vector of indices defining the sampler column index " 34 "associated with the variables in 'sampler_vars'.");
36 "use_time",
true,
"Make time (t) variable available in the function expression.");
45 _function(this->template getParam<
std::string>(
"function")),
46 _default_value(this->template getParam<T>(
"default_value")),
48 this->template getParam<
std::string, unsigned
int>(
"sampler_vars",
"sampler_var_indices")),
49 _use_time(this->template getParam<bool>(
"use_time"))
52 std::stringstream
vars;
56 vars << sep << it.first;
57 if (it.second >= this->sampler().getNumberOfCols())
61 " must be smaller than the sampler number of columns (",
62 this->sampler().getNumberOfCols(),
70 _func_F = std::make_shared<SymFunction>();
102 _func_params[p] = row[_sampler_vars[p].second];
105 _func_params[_sampler_vars.size()] = this->_t;
113 val = _default_value;
const std::vector< std::pair< std::string, unsigned int > > _sampler_vars
Pairs between the variables in the function string and their associated sampler column index...
processor_id_type rank() const
const Parallel::Communicator & _communicator
This object is mainly meant for demonstration for eventual active learning algorithms, but could prove useful.
ConditionalSampleReporterTempl(const InputParameters ¶meters)
void paramError(const std::string ¶m, Args... args) const
static InputParameters validParams()
SymFunctionPtr _func_F
Parsed function pointer.
registerMooseObject("StochasticToolsApp", ConditionalSampleReporter)
const std::string & _function
User-inputted function string.
virtual bool needSample(const std::vector< Real > &row, dof_id_type local_ind, dof_id_type global_ind, T &val) override
This evaluates the inputted function to determine whether a multiapp solve is necessary/allowed, otherwise it replaces the "transferred" quantity with a default value.
bool _disable_fpoptimizer
static InputParameters validParams()
std::vector< GenericReal< is_ad > > _func_params
static InputParameters validParams()
void ErrorVector unsigned int
auto index_range(const T &sizable)
This is a base class for performing active learning routines, meant to be used in conjunction with Sa...
void setParserFeatureFlags(SymFunctionPtr &) const
const bool _use_time
Whether or not the function string includes a time variable.