https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PostprocessorInterface.h
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
10#pragma once
11
12// Standard includes
13#include <string>
14
15// MOOSE includes
16#include "MooseTypes.h"
17
18// Forward Declarations
19class FEProblemBase;
20class InputParameters;
21class PostprocessorName;
22class MooseObject;
23
24#define usingPostprocessorInterfaceMembers \
25 using PostprocessorInterface::getPostprocessorValue; \
26 using PostprocessorInterface::getPostprocessorValueOld; \
27 using PostprocessorInterface::getPostprocessorValueOlder; \
28 using PostprocessorInterface::coupledPostprocessors
29
35{
36public:
37 PostprocessorInterface(const MooseObject * moose_object);
38
40
41#ifdef MOOSE_KOKKOS_ENABLED
46 const Moose::Kokkos::FunctorCopy & key);
47#endif
48
50
52
66 const PostprocessorValue & getPostprocessorValue(const std::string & param_name,
67 const unsigned int index = 0) const;
68 const PostprocessorValue & getPostprocessorValueOld(const std::string & param_name,
69 const unsigned int index = 0) const;
70 const PostprocessorValue & getPostprocessorValueOlder(const std::string & param_name,
71 const unsigned int index = 0) const;
72 // doco-normal-methods-end
73
75
77
89 virtual const PostprocessorValue &
90 getPostprocessorValueByName(const PostprocessorName & name) const;
91 const PostprocessorValue & getPostprocessorValueOldByName(const PostprocessorName & name) const;
92 const PostprocessorValue & getPostprocessorValueOlderByName(const PostprocessorName & name) const;
94
104 bool isDefaultPostprocessorValue(const std::string & param_name,
105 const unsigned int index = 0) const;
106
115 bool hasPostprocessor(const std::string & param_name, const unsigned int index = 0) const;
116
124 bool hasPostprocessorByName(const PostprocessorName & name) const;
125
132 std::size_t coupledPostprocessors(const std::string & param_name) const;
133
142 const PostprocessorName & getPostprocessorName(const std::string & param_name,
143 const unsigned int index = 0) const;
144
145protected:
149 virtual void addPostprocessorDependencyHelper(const PostprocessorName & /* name */) const {}
150
151private:
154
157
160
162 mutable std::map<PostprocessorName, std::unique_ptr<PostprocessorValue>> _default_values;
163
168 const PostprocessorName &
169 getPostprocessorNameInternal(const std::string & param_name,
170 const unsigned int index,
171 const bool allow_default_value = true) const;
172
177 const PostprocessorValue & getPostprocessorValueInternal(const std::string & param_name,
178 unsigned int index,
179 std::size_t t_index) const;
180 const PostprocessorValue & getPostprocessorValueByNameInternal(const PostprocessorName & name,
181 std::size_t t_index) const;
183
189 bool isDefaultPostprocessorValueByName(const PostprocessorName & name) const;
190
194 PostprocessorValue getDefaultPostprocessorValueByName(const PostprocessorName & name) const;
195
200 void checkParam(const std::string & param_name,
201 const unsigned int index = std::numeric_limits<unsigned int>::max()) const;
202
206 bool postprocessorsAdded() const;
207};
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
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 &param_name, const unsigned int index=0) const
const PostprocessorName & getPostprocessorNameInternal(const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
Internal method for getting the PostprocessorName associated with a paremeter.
bool isDefaultPostprocessorValue(const std::string &param_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 &param_name) const
Returns number of Postprocessors coupled under parameter name.
const PostprocessorName & getPostprocessorName(const std::string &param_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 &param_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 &param_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 &param_name, const unsigned int index=0) const
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.
const PostprocessorValue & getPostprocessorValueOldByName(const PostprocessorName &name) const
const PostprocessorValue & getPostprocessorValue(const std::string &param_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 &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
Checks the parameters relating to a Postprocessor.