https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ParsedScalarReporter.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
13
16{
18 params.suppressParameter<std::vector<std::string>>("vector_reporter_symbols");
19 params.addClassDescription("Applies parsed functions to scalar entries held in reporters.");
20 return params;
21}
22
24 : ParsedReporterBase(parameters),
25 _output_reporter(declareValueByName<Real>(getParam<std::string>("name"), REPORTER_MODE_ROOT))
26{
27 if (!parameters.isParamValid("scalar_reporter_names"))
28 paramError("scalar_reporter_names", "Required parameter when using ParsedScalarReporter.");
29}
30
31void
33{
34 for (const auto i : index_range(_scalar_reporter_data))
36
37 if (_use_t)
39
41}
registerMooseObject("MooseApp", ParsedScalarReporter)
const ReporterMode REPORTER_MODE_ROOT
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn't required or valid in the derived class...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another,...
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition MooseBase.h:457
Reporter containing operation between vectors from another Reporter.
const bool _use_t
whether time is part of the parsed expression
SymFunctionPtr _func_F
function parser object
std::vector< const Real * > _scalar_reporter_data
input scalar reporter vectors
static InputParameters validParams()
Reporter containing operation between scalars from another Reporter.
ParsedScalarReporter(const InputParameters &parameters)
virtual void finalize() override
Finalize.
static InputParameters validParams()
Real & _output_reporter
output scalar