22 : _ppi_moose_object(*moose_object),
23 _ppi_params(_ppi_moose_object.parameters()),
24 _ppi_feproblem(*_ppi_params.getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base"))
29 : _ppi_moose_object(*problem),
30 _ppi_params(_ppi_moose_object.parameters()),
31 _ppi_feproblem(*problem)
35#ifdef MOOSE_KOKKOS_ENABLED
38 : _ppi_moose_object(object._ppi_moose_object),
39 _ppi_params(object._ppi_params),
40 _ppi_feproblem(object._ppi_feproblem)
47 const unsigned int index )
const
54 const unsigned int index )
const
61 const unsigned int index )
const
86 const unsigned int index )
const
100 std::istringstream ss(name);
101 Real real_value = -std::numeric_limits<Real>::max();
102 return (ss >> real_value && ss.eof());
110 Real real_value = -std::numeric_limits<Real>::max();
111 std::istringstream ss(name);
118 const unsigned int index )
const
122 "Cannot call hasPostprocessor() until all Postprocessors have been constructed.");
132 "Cannot call hasPostprocessorByName() until all Postprocessors have been constructed.");
145 return _ppi_params.
get<std::vector<PostprocessorName>>(param_name).size();
150 const std::string & param_name,
151 const unsigned int index )
const
153 const bool check_index = index != std::numeric_limits<unsigned int>::max();
157 "When getting a Postprocessor, failed to get a parameter with the name \"",
160 "\n\nKnown parameters:\n",
165 if (check_index && index > 0)
167 "A Postprocessor was requested with index ",
169 " but a single Postprocessor is coupled.");
173 const auto & names =
_ppi_params.
get<std::vector<PostprocessorName>>(param_name);
174 if (check_index && names.size() <= index)
176 "A Postprocessor was requested with index ",
180 " Postprocessors are coupled.");
185 "Supplied parameter with name \"",
189 "\" is not an expected type for getting a Postprocessor.\n\n",
190 "Allowed types are \"PostprocessorName\" and \"std::vector<PostprocessorName>\".");
194const PostprocessorName &
196 const unsigned int index )
const
201const PostprocessorName &
203 const std::string & param_name,
204 const unsigned int index,
205 const bool allow_default_value )
const
211 :
_ppi_params.
get<std::vector<PostprocessorName>>(param_name)[index];
215 std::stringstream oss;
216 oss <<
"Cannot get the name associated with PostprocessorName parameter \"" << param_name
219 oss <<
" at index " << index;
220 oss <<
",\nbecause said parameter is a default Postprocessor value.";
230 std::size_t t_index)
const
241 const auto & value_ref =
242 *
_default_values.emplace(name, std::make_unique<PostprocessorValue>(value))
244 mooseAssert(value == value_ref,
"Inconsistent default value");
250 param_name,
"A Postprocessor with the name \"", name,
"\" was not found.");
257 std::size_t t_index)
const
259 mooseAssert(t_index < 3,
"Invalid time index");
Real PostprocessorValue
various MOOSE typedefs
const ReporterMode REPORTER_MODE_ROOT
bool isTaskComplete(const std::string &task) const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
const InputParameters & parameters() const
Get the parameters of the object.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Every object that can be built by the factory should be derived from this class.
Interface class for classes which interact with Postprocessors.
virtual void addPostprocessorDependencyHelper(const PostprocessorName &) const
Helper for deriving classes to override to add dependencies when a Postprocessor is requested.
bool isDefaultPostprocessorValueByName(const PostprocessorName &name) const
const PostprocessorValue & getPostprocessorValueOlderByName(const PostprocessorName &name) const
static InputParameters validParams()
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
Holds the default postprocessor values that are requested (key is PostprocessorName)
const PostprocessorValue & getPostprocessorValueOlder(const std::string ¶m_name, const unsigned int index=0) const
const PostprocessorName & getPostprocessorNameInternal(const std::string ¶m_name, const unsigned int index, const bool allow_default_value=true) const
Internal method for getting the PostprocessorName associated with a paremeter.
PostprocessorInterface(const MooseObject *moose_object)
bool isDefaultPostprocessorValue(const std::string ¶m_name, const unsigned int index=0) const
Determine whether or not the Postprocessor is a default value.
PostprocessorValue getDefaultPostprocessorValueByName(const PostprocessorName &name) const
std::size_t coupledPostprocessors(const std::string ¶m_name) const
Returns number of Postprocessors coupled under parameter name.
const PostprocessorName & getPostprocessorName(const std::string ¶m_name, const unsigned int index=0) const
Get the name of a postprocessor.
virtual const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name) const
Retrieve the value of the Postprocessor.
bool hasPostprocessor(const std::string ¶m_name, const unsigned int index=0) const
Determine if the Postprocessor data exists.
const FEProblemBase & _ppi_feproblem
Reference the the FEProblemBase class.
const PostprocessorValue & getPostprocessorValueInternal(const std::string ¶m_name, unsigned int index, std::size_t t_index) const
Internal methods for getting Postprocessor values.
const PostprocessorValue & getPostprocessorValueByNameInternal(const PostprocessorName &name, std::size_t t_index) const
bool hasPostprocessorByName(const PostprocessorName &name) const
Determine if the Postprocessor data exists.
const PostprocessorValue & getPostprocessorValueOld(const std::string ¶m_name, const unsigned int index=0) const
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
bool postprocessorsAdded() const
const InputParameters & _ppi_params
PostprocessorInterface Parameters.
const PostprocessorValue & getPostprocessorValueOldByName(const PostprocessorName &name) const
const PostprocessorValue & getPostprocessorValue(const std::string ¶m_name, const unsigned int index=0) const
doco-normal-methods-begin Retrieve the value of a Postprocessor or one of it's old or older values
void checkParam(const std::string ¶m_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
Checks the parameters relating to a Postprocessor.
A ReporterName that represents a Postprocessor.
bool hasReporterValue(const ReporterName &reporter_name) const
Return True if a Reporter value with the given type and name have been created.
const T & getReporterValue(const ReporterName &reporter_name, const MooseObject &consumer, const ReporterMode &mode, const std::size_t time_index=0) const
Method for returning read only references to Reporter values.