https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Moose::Kokkos::Postprocessor Class Referenceabstract

#include <KokkosPostprocessor.h>

Inheritance diagram for Moose::Kokkos::Postprocessor:
[legend]

Public Types

using FunctorType = FunctorBase< Real >
 
using ValueType = Real
 
using GradientType = typename FunctorReturnType< Real, FunctorEvaluationKind::Gradient >::type
 This rigmarole makes it so that a user can create functors that return containers (std::vector, std::array). More...
 
using DotType = ValueType
 

Public Member Functions

 Postprocessor (const MooseObject *moose_object)
 
 Postprocessor (const Postprocessor &object)
 Copy constructor for parallel dispatch. More...
 
virtual PostprocessorValue getValue () const =0
 This will get called to actually grab the final value the postprocessor has calculated. More...
 
const PostprocessorValuegetCurrentValue () const
 
const std::string & PPName () const
 Returns the name of the Postprocessor. More...
 
virtual bool hasBlocks (SubdomainID) const override
 Returns whether the functor is defined on this block. More...
 
bool supportsFaceArg () const override final
 Whether this functor supports evaluation with FaceArg. More...
 
bool supportsElemSideQpArg () const override final
 Whether this functor supports evaluation with ElemSideQpArg. More...
 
void buildOutputHideVariableList (std::set< std::string > variable_names)
 Builds hide lists for output objects NOT listed in the 'outputs' parameter. More...
 
const std::set< OutputName > & getOutputs ()
 Get the list of output objects that this class is restricted. More...
 
FunctorReturnType< Real, FET >::type genericEvaluate (const Space &r, const State &state) const
 Perform a generic evaluation based on the supplied template argument FET and supplied spatial and temporal arguments. More...
 
const MooseFunctorName & functorName () const
 Return the functor name. More...
 
virtual void residualSetup () override
 
virtual void jacobianSetup () override
 
virtual void timestepSetup () override
 
virtual void customSetup (const ExecFlagType &exec_type) override
 
void setCacheClearanceSchedule (const std::set< ExecFlagType > &clearance_schedule)
 Set how often to clear the functor evaluation cache. More...
 
virtual bool isExtrapolatedBoundaryFace (const FaceInfo &, const Elem *, const StateArg &) const
 Returns whether this (sided) face is an extrapolated boundary face for this functor. More...
 
bool isInternalFace (const FaceInfo &) const
 Returns true if the face is an internal face. More...
 
virtual bool isConstant () const
 Returns true if this functor is a constant. More...
 
virtual bool hasFaceSide (const FaceInfo &fi, const bool fi_elem_side) const override
 
void checkFace (const Moose::FaceArg &face) const
 Examines the incoming face argument. More...
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 Same as their evaluate overloads with the same arguments but allows for caching implementation. More...
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateGradient overloads with the same arguments but allows for caching implementation. More...
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateDot overloads with the same arguments but allows for caching implementation. More...
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation. More...
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 

Static Public Member Functions

static InputParameters validParams ()
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 Helper to look up a functor name through the input parameter keys. More...
 

Protected Member Functions

std::string deduceFunctorName (const std::string &name) const
 Small helper to look up a functor name through the input parameter keys. More...
 
template<typename T >
const Moose::Functor< T > & getFunctor (const std::string &name)
 Retrieves a functor from the subproblem. More...
 
template<typename T >
const Moose::Functor< T > & getFunctor (const std::string &name, THREAD_ID tid)
 Retrieves a functor from the subproblem. More...
 
template<typename T >
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem)
 Retrieves a functor from the passed-in subproblem. More...
 
template<typename T >
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 Retrieves a functor from the passed-in subproblem. More...
 
bool isFunctor (const std::string &name) const
 Checks the subproblem for the given functor. More...
 
bool isFunctor (const std::string &name, const SubProblem &subproblem) const
 Checks the passed-in subproblem for the given functor. More...
 
Moose::ElemArg makeElemArg (const Elem *elem, bool correct_skewnewss=false) const
 Helper method to create an elemental argument for a functor that includes whether to perform skewness corrections. More...
 
template<typename T >
void checkFunctorSupportsSideIntegration (const std::string &name, bool qp_integration)
 Throws error if the functor does not support the requested side integration. More...
 
template<typename T >
const Moose::Functor< T > & getFunctorByName (const std::string &name)
 Retrieves a functor from the subproblem. More...
 
Functor evaluation routines

These methods are all for evaluating functors with different kinds of spatial arguments.

Each of these methods also takes a state argument. For a description of the state argument, please see the StateArg doxygen

virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 Evaluate the functor gradient-dot with a given element. More...
 
virtual GradientType evaluateGradDot (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemPointArg &, const StateArg &) const
 Evaluate the functor gradient-dot with a given element and point. More...
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 

Protected Attributes

const std::string & _pp_name
 Post-processor name. More...
 
const PostprocessorValue_current_value
 The current value, which is the Reporter value that changes when we execute UOs in the problem. More...
 

Detailed Description

Definition at line 17 of file KokkosPostprocessor.h.

Member Typedef Documentation

◆ DotType

using Moose::FunctorBase< Real >::DotType = ValueType
inherited

Definition at line 150 of file MooseFunctor.h.

◆ FunctorType

Definition at line 140 of file MooseFunctor.h.

◆ GradientType

This rigmarole makes it so that a user can create functors that return containers (std::vector, std::array).

This logic will make it such that if a user requests a functor type T that is a container of algebraic types, for example Reals, then the GradientType will be a container of the gradients of those algebraic types, in this example VectorValue<Reals>. So if T is std::vector<Real>, then GradientType will be std::vector<VectorValue<Real>>. As another example: T = std::array<VectorValue<Real>, 1> -> GradientType = std::array<TensorValue<Real>, 1>

Definition at line 149 of file MooseFunctor.h.

◆ ValueType

using Moose::FunctorBase< Real >::ValueType = Real
inherited

Definition at line 141 of file MooseFunctor.h.

Constructor & Destructor Documentation

◆ Postprocessor() [1/2]

Moose::Kokkos::Postprocessor::Postprocessor ( const MooseObject moose_object)

◆ Postprocessor() [2/2]

Moose::Kokkos::Postprocessor::Postprocessor ( const Postprocessor object)

Copy constructor for parallel dispatch.

Member Function Documentation

◆ buildOutputHideVariableList()

void OutputInterface::buildOutputHideVariableList ( std::set< std::string >  variable_names)
inherited

Builds hide lists for output objects NOT listed in the 'outputs' parameter.

Parameters
variable_namesA set of variables for which the 'outputs' parameter controls

By default this is called by the constructor and passes the block name as the list of variables. This needs to be called explicitly if the build_list flag is set to False in the constructor. The latter cases is needed by the Material object to work correctly with the automatic material output capability.

Definition at line 68 of file OutputInterface.C.

Referenced by ReporterTransferInterface::hideVariableHelper(), and OutputInterface::OutputInterface().

69 {
70  // Set of available names
71  const std::set<OutputName> & avail = _oi_output_warehouse.getOutputNames();
72 
73  // Check for 'none'; hide variables on all outputs
74  if (_oi_outputs.find("none") != _oi_outputs.end())
75  for (const auto & name : avail)
76  _oi_output_warehouse.addInterfaceHideVariables(name, variable_names);
77 
78  // Check for empty and 'all' in 'outputs' parameter; do not perform any variable restrictions in
79  // these cases
80  else if (_oi_outputs.empty() || _oi_outputs.find("all") != _oi_outputs.end())
81  return;
82 
83  // Limit the variable output to Output objects listed
84  else
85  {
86  // Create a list of outputs where the variable should be hidden
87  std::set<OutputName> hide;
88  std::set_difference(avail.begin(),
89  avail.end(),
90  _oi_outputs.begin(),
91  _oi_outputs.end(),
92  std::inserter(hide, hide.begin()));
93 
94  // If 'outputs' is specified add the object name to the list of items to hide
95  for (const auto & name : hide)
96  _oi_output_warehouse.addInterfaceHideVariables(name, variable_names);
97  }
98 }
OutputWarehouse & _oi_output_warehouse
Reference to the OutputWarehouse for populating the Output object hide lists.
std::set< OutputName > _oi_outputs
The set of Output object names listed in the &#39;outputs&#39; parameter.
const std::set< OutputName > & getOutputNames()
Get a complete set of all output object names.
void addInterfaceHideVariables(const std::string &output_name, const std::set< std::string > &variable_names)
Insert variable names for hiding via the OutoutInterface.

◆ checkFace()

void Moose::FunctorBase< Real >::checkFace ( const Moose::FaceArg face) const
inherited

Examines the incoming face argument.

If the face argument producer (residual object, postprocessor, etc.) did not indicate a sidedness to the face, e.g. if the face_side member of the FaceArg is nullptr, then we may "modify" the sidedness of the argument if we are only defined on one side of the face. If the face argument producer has indicated a sidedness and we are not defined on that side, then we will error

Parameters
faceThe face argument created by the face argument producer, likely a residual object
Returns
A face with possibly changed sidedness depending on whether we aren't defined on both sides of the face

Definition at line 738 of file MooseFunctor.h.

743 {
744 #if DEBUG
745  const Elem * const elem = face.face_side;
746  const FaceInfo * const fi = face.fi;
747  mooseAssert(fi, "face info should be non-null");
748  bool check_elem_def = false;
749  bool check_neighbor_def = false;
750  // We check if the functor is defined on both sides of the face
751  if (!elem)
752  {
753  if (!hasFaceSide(*fi, true))
754  check_neighbor_def = true;
755  else if (!hasFaceSide(*fi, false))
756  check_elem_def = true;
757  }
758  else if (elem == fi->elemPtr())
759  check_elem_def = true;
760  else
761  {
762  mooseAssert(elem == fi->neighborPtr(), "This has to match something");
763  check_neighbor_def = true;
764  }
765 
766  if (check_elem_def && !hasFaceSide(*fi, true))
767  {
768  std::string additional_message = "It is not defined on the neighbor side either.";
769  if (hasFaceSide(*fi, false))
770  additional_message = "It is however defined on the neighbor side.";
771  additional_message += " Face centroid: " + Moose::stringify(fi->faceCentroid());
773  " is not defined on the element side of the face information, but a face argument "
774  "producer "
775  "(e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
776  additional_message);
777  }
778  if (check_neighbor_def && !hasFaceSide(*fi, false))
779  {
780  std::string additional_message = "It is not defined on the element side either.";
781  if (hasFaceSide(*fi, true))
782  additional_message = "It is however defined on the element side.";
783  additional_message += " Face centroid: " + Moose::stringify(fi->faceCentroid());
784  mooseError(
786  " is not defined on the neighbor side of the face information, but a face argument "
787  "producer (e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
788  additional_message);
789  }
790 #endif
791 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const libMesh::Elem * face_side
A member that can be used to indicate whether there is a sidedness to this face.
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
Definition: FaceInfo.h:75
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:37
const Elem * neighborPtr() const
Definition: FaceInfo.h:88
MooseFunctorName _functor_name
name of the functor
Definition: MooseFunctor.h:570
const FaceInfo * fi
a face information object which defines our location in space
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
const Elem * elemPtr() const
Definition: FaceInfo.h:86
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
Definition: MooseFunctor.h:982

◆ checkFunctorSupportsSideIntegration()

template<typename T >
void FunctorInterface::checkFunctorSupportsSideIntegration ( const std::string &  name,
bool  qp_integration 
)
protectedinherited

Throws error if the functor does not support the requested side integration.

Parameters
[in]nameName of functor or functor parameter
[in]qp_integrationTrue if performing qp integration, false if face info

Definition at line 261 of file FunctorInterface.h.

262 {
263  const std::string functor_name = deduceFunctorName(name);
264  const auto & functor = getFunctor<T>(name);
265  if (qp_integration)
266  {
267  if (!functor.supportsElemSideQpArg())
268  mooseError("Quadrature point integration was requested, but the functor '",
269  functor_name,
270  "' does not support this.");
271  }
272  else
273  {
274  if (!functor.supportsFaceArg())
275  mooseError("Face info integration was requested, but the functor '",
276  functor_name,
277  "' does not support this.");
278  }
279 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
static std::string deduceFunctorName(const std::string &name, const InputParameters &params)
Helper to look up a functor name through the input parameter keys.

◆ customSetup()

void Moose::FunctorBase< Real >::customSetup ( const ExecFlagType exec_type)
overridevirtualinherited

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 845 of file MooseFunctor.h.

846 {
847  if (_clearance_schedule.count(exec_type))
848  clearCacheData();
849 }
void clearCacheData()
clear cache data
Definition: MooseFunctor.h:795
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:520

◆ deduceFunctorName() [1/2]

std::string FunctorInterface::deduceFunctorName ( const std::string &  name,
const InputParameters params 
)
staticinherited

Helper to look up a functor name through the input parameter keys.

Parameters
nameThe input parameter name that we are trying to deduce the functor name for
paramsThe input parameters object that we will be checking for parameters named name
Returns
The functor name

Definition at line 39 of file FunctorInterface.C.

Referenced by FunctorInterface::checkFunctorSupportsSideIntegration(), FunctorInterface::deduceFunctorName(), FunctorInterface::getFunctor(), and FunctorInterface::isFunctor().

40 {
41  if (params.isParamValid(name))
42  {
43  if (params.have_parameter<MooseFunctorName>(name))
44  return params.get<MooseFunctorName>(name);
45  // variables, functor material properties, functions, and post-processors are also functors
46  else if (params.have_parameter<MaterialPropertyName>(name))
47  return params.get<MaterialPropertyName>(name);
48  else if (params.have_parameter<VariableName>(name))
49  return params.get<VariableName>(name);
50  else if (params.have_parameter<std::vector<VariableName>>(name))
51  {
52  const auto & var_names = params.get<std::vector<VariableName>>(name);
53  if (var_names.size() != 1)
54  mooseError("We only support a single variable name for retrieving a functor");
55  return var_names[0];
56  }
57  else if (params.have_parameter<NonlinearVariableName>(name))
58  return params.get<NonlinearVariableName>(name);
59  else if (params.have_parameter<FunctionName>(name))
60  return params.get<FunctionName>(name);
61  else if (params.have_parameter<PostprocessorName>(name))
62  return params.get<PostprocessorName>(name);
63  else
64  mooseError("Invalid parameter type for retrieving a functor");
65  }
66  else
67  return name;
68 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ deduceFunctorName() [2/2]

std::string FunctorInterface::deduceFunctorName ( const std::string &  name) const
protectedinherited

Small helper to look up a functor name through the input parameter keys.

Definition at line 71 of file FunctorInterface.C.

72 {
73  return deduceFunctorName(name, _fi_params);
74 }
const InputParameters & _fi_params
Parameters of the object with this interface.
static std::string deduceFunctorName(const std::string &name, const InputParameters &params)
Helper to look up a functor name through the input parameter keys.

◆ dot() [1/6]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::dot ( const ElemArg elem,
const StateArg state 
) const
inherited

Same as their evaluateDot overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 896 of file MooseFunctor.h.

897 {
898  return evaluateDot(elem, state);
899 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391

◆ dot() [2/6]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::dot ( const FaceArg face,
const StateArg state 
) const
inherited

Definition at line 903 of file MooseFunctor.h.

904 {
905  checkFace(face);
906  return evaluateDot(face, state);
907 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:738

◆ dot() [3/6]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::dot ( const ElemQpArg qp,
const StateArg state 
) const
inherited

Definition at line 911 of file MooseFunctor.h.

912 {
913  return evaluateDot(elem_qp, state);
914 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391

◆ dot() [4/6]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::dot ( const ElemSideQpArg qp,
const StateArg state 
) const
inherited

Definition at line 918 of file MooseFunctor.h.

919 {
920  return evaluateDot(elem_side_qp, state);
921 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391

◆ dot() [5/6]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::dot ( const ElemPointArg elem_point,
const StateArg state 
) const
inherited

Definition at line 925 of file MooseFunctor.h.

926 {
927  return evaluateDot(elem_point, state);
928 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391

◆ dot() [6/6]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::dot ( const NodeArg node,
const StateArg state 
) const
inherited

Definition at line 932 of file MooseFunctor.h.

933 {
934  return evaluateDot(node, state);
935 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391

◆ evaluateGradDot() [1/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const ElemArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

Evaluate the functor gradient-dot with a given element.

Some example implementations of this method could compute an element-average or evaluate at the element centroid

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 445 of file MooseFunctor.h.

446  {
447  mooseError("Element gradient-dot not implemented for functor " + functorName());
448  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:176

◆ evaluateGradDot() [2/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const FaceArg ,
const StateArg  
) const
inlineprotectedvirtualinherited
Parameters
faceSee the FaceArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient-dot evaluated at the requested state and space

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 455 of file MooseFunctor.h.

456  {
457  mooseError("Face gradient-dot not implemented for functor " + functorName());
458  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:176

◆ evaluateGradDot() [3/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const ElemQpArg ,
const StateArg  
) const
inlineprotectedvirtualinherited
Parameters
qpSee the ElemQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient-dot evaluated at the requested state and space

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 465 of file MooseFunctor.h.

466  {
467  mooseError("Element quadrature point gradient-dot not implemented for functor " +
468  functorName());
469  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:176

◆ evaluateGradDot() [4/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const ElemSideQpArg ,
const StateArg  
) const
inlineprotectedvirtualinherited
Parameters
side_qpSee the ElemSideQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient-dot evaluated at the requested state and space

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 476 of file MooseFunctor.h.

477  {
478  mooseError("Element side quadrature point gradient-dot not implemented for functor " +
479  functorName());
480  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:176

◆ evaluateGradDot() [5/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const ElemPointArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

Evaluate the functor gradient-dot with a given element and point.

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 485 of file MooseFunctor.h.

486  {
487  mooseError("Element-point gradient-dot not implemented for functor " + functorName());
488  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:176

◆ evaluateGradDot() [6/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const NodeArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 490 of file MooseFunctor.h.

491  {
492  mooseError("Gradient-dot at node not implemented for functor " + functorName());
493  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:176

◆ functorName()

const MooseFunctorName& Moose::FunctorBase< Real >::functorName ( ) const
inlineinherited

Return the functor name.

Definition at line 176 of file MooseFunctor.h.

176 { return _functor_name; }
MooseFunctorName _functor_name
name of the functor
Definition: MooseFunctor.h:570

◆ genericEvaluate()

FunctorReturnType< Real , FET >::type Moose::FunctorBase< Real >::genericEvaluate ( const Space &  r,
const State &  state 
) const
inherited

Perform a generic evaluation based on the supplied template argument FET and supplied spatial and temporal arguments.

Definition at line 993 of file MooseFunctor.h.

994 {
995  if constexpr (FET == FunctorEvaluationKind::Value)
996  return (*this)(r, state);
997  else if constexpr (FET == FunctorEvaluationKind::Gradient)
998  return gradient(r, state);
999  else if constexpr (FET == FunctorEvaluationKind::Dot)
1000  return dot(r, state);
1001  else
1002  return gradDot(r, state);
1003 }
GradientType gradDot(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation...
Definition: MooseFunctor.h:939
DotType dot(const ElemArg &elem, const StateArg &state) const
Same as their evaluateDot overloads with the same arguments but allows for caching implementation...
Definition: MooseFunctor.h:896
GradientType gradient(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradient overloads with the same arguments but allows for caching implementatio...
Definition: MooseFunctor.h:853

◆ getCurrentValue()

const PostprocessorValue& Postprocessor::getCurrentValue ( ) const
inlineinherited
Returns
The "current" value of this Postprocessor.

Your sanity would tell you... why not just call getValue()? Well - the intention of getValue() is to be called by the problem when the UserObjects are executed, and not by other things. This enables the control of when this Postprocessor is updated, which could be very important. If the implementation of getValue() is such that it actually computes a new value (instead of one that is called in finalize()), you could potentially call getValue() and not get the value as it was at the last time this PP was executed.

What this does instead is gives you the value that was last set as this PP was executed by the problem. That is, the value that every object that uses the PostprocessorInterface will get you.

Definition at line 63 of file Postprocessor.h.

Referenced by Postprocessor::evaluate().

63 { return _current_value; }
const PostprocessorValue & _current_value
The current value, which is the Reporter value that changes when we execute UOs in the problem...
Definition: Postprocessor.h:80

◆ getFunctor() [1/4]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctor ( const std::string &  name)
protectedinherited

Retrieves a functor from the subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the functor parameter name, not the actual name of the functor created in the input file
Returns
The functor

Definition at line 217 of file FunctorInterface.h.

Referenced by MaterialFunctorConverterTempl< T >::MaterialFunctorConverterTempl().

218 {
219  mooseAssert(_fi_subproblem, "This must be non-null");
220  return getFunctor<T>(name, *_fi_subproblem, _fi_tid);
221 }
std::string name(const ElemQuality q)
SubProblem *const _fi_subproblem
Pointer to subproblem if the subproblem pointer parameter was set.
const THREAD_ID _fi_tid
Current threaded it.

◆ getFunctor() [2/4]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctor ( const std::string &  name,
THREAD_ID  tid 
)
protectedinherited

Retrieves a functor from the subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the functor parameter name, not the actual name of the functor created in the input file
tidThe thread ID used to retrieve the functor from this interface's subproblem
Returns
The functor

Definition at line 209 of file FunctorInterface.h.

210 {
211  mooseAssert(_fi_subproblem, "This must be non-null");
212  return getFunctor<T>(name, *_fi_subproblem, tid);
213 }
std::string name(const ElemQuality q)
SubProblem *const _fi_subproblem
Pointer to subproblem if the subproblem pointer parameter was set.

◆ getFunctor() [3/4]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctor ( const std::string &  name,
SubProblem subproblem 
)
protectedinherited

Retrieves a functor from the passed-in subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the functor parameter name, not the actual name of the functor created in the input file
subproblemThe subproblem to query for the functor
Returns
The functor

Definition at line 202 of file FunctorInterface.h.

203 {
204  return getFunctor<T>(name, subproblem, _fi_tid);
205 }
std::string name(const ElemQuality q)
const THREAD_ID _fi_tid
Current threaded it.

◆ getFunctor() [4/4]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctor ( const std::string &  name,
SubProblem subproblem,
THREAD_ID  tid 
)
protectedinherited

Retrieves a functor from the passed-in subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the functor parameter name, not the actual name of the functor created in the input file
subproblemThe subproblem to query for the functor
tidThe thread ID used to retrieve the functor from the subproblem
Returns
The functor

Definition at line 193 of file FunctorInterface.h.

194 {
195  // Check if the supplied parameter is a valid input parameter key
196  std::string functor_name = deduceFunctorName(name);
197  return getFunctorByName<T>(functor_name, subproblem, tid);
198 }
static std::string deduceFunctorName(const std::string &name, const InputParameters &params)
Helper to look up a functor name through the input parameter keys.

◆ getFunctorByName()

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctorByName ( const std::string &  name)
protectedinherited

Retrieves a functor from the subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the actual name of the functor created in the input file
Returns
The functor

Definition at line 225 of file FunctorInterface.h.

226 {
227  mooseAssert(_fi_subproblem, "This must be non-null");
228  return getFunctorByName<T>(name, *_fi_subproblem, _fi_tid);
229 }
std::string name(const ElemQuality q)
SubProblem *const _fi_subproblem
Pointer to subproblem if the subproblem pointer parameter was set.
const THREAD_ID _fi_tid
Current threaded it.

◆ getOutputs()

const std::set< OutputName > & OutputInterface::getOutputs ( )
inherited

Get the list of output objects that this class is restricted.

Returns
A set of OutputNames

Definition at line 101 of file OutputInterface.C.

102 {
103  return _oi_outputs;
104 }
std::set< OutputName > _oi_outputs
The set of Output object names listed in the &#39;outputs&#39; parameter.

◆ getValue()

virtual PostprocessorValue Postprocessor::getValue ( ) const
pure virtualinherited

This will get called to actually grab the final value the postprocessor has calculated.

Note that this should only be called by internal methods, namely the problem that actually sets the value globally for other things to use. If you want the value outside of one of these external methods, you should use getCurrentValue().

Implemented in LibtorchControlValuePostprocessor, TimeExtremeValue, RelativeSolutionDifferenceNorm, Receiver, RelativeDifferencePostprocessor, VectorPostprocessorComparison, PostprocessorComparison, ElementW1pError, MFEMComplexVectorPeriodAveragedPostprocessor, MFEMVectorBoundaryFluxIntegralPostprocessor, MFEMVectorFEInnerProductIntegralPostprocessor, DiscreteVariableResidualNorm, NumNonlinearIterations, ScalarL2Error, NodalVariableValue, TagVectorSum, LinearCombinationPostprocessor, MFEML2Error, MFEMVectorL2Error, ElementExtremeMaterialPropertyTempl< is_ad >, FindValueOnLine, ElementalVariableValue, GreaterThanLessThanPostprocessor, MemoryUsage, SideIntegralPostprocessor, ElementIntegralPostprocessor, FunctionValuePostprocessor, InternalSideIntegralPostprocessor, NumDOFs, NumMeshDivisions, NumTimeSteps, PointValue, SideDiffusiveFluxAverageTempl< is_ad >, AverageVariableChange, CumulativeValuePostprocessor, ElementAverageValue, InterfaceDiffusiveFluxAverageTempl< is_ad >, InterfaceIntegralPostprocessor, NodalL2Norm, NumPositions, SideAverageValue, AverageElementSize, ChangeOverFixedPointPostprocessor, ChangeOverTimePostprocessor, DifferencePostprocessor, ElementAverageMaterialPropertyTempl< is_ad >, ElementH1SemiError, ElementMaxLevelPostProcessor, ElementVectorL2Error, NumFixedPointIterations, ParsedPostprocessor, SideAverageMaterialPropertyTempl< is_ad >, ChainControlDataPostprocessor, NearestNodeNumber, NodalL2Error, NodalMaxValue, NodalSum, NumElements, NumFailedTimeSteps, NumNodes, NumResidualEvaluations, PercentChangePostprocessor, PseudoTimestep, Residual, SideAverageFunctorPostprocessor, TimePostprocessor, TimestepSize, KokkosExtremeValueBase< KokkosElementVariablePostprocessor >, KokkosExtremeValueBase< KokkosSideVariablePostprocessor >, KokkosExtremeValueBase< KokkosNodalVariablePostprocessor >, ExtremeValueBase< ElementPostprocessor >, ExtremeValueBase< ElementVariablePostprocessor >, ExtremeValueBase< NodalVariablePostprocessor >, ExtremeValueBase< SideVariablePostprocessor >, KokkosNodalL2Norm, KokkosSumPostprocessor, ConstantPostprocessor, FunctionElementAverage, FunctionSideAverage, InterfaceAverageVariableValuePostprocessor, MatrixSymmetryCheck, NodalMaxValueId, ScalarVariable, ScalePostprocessor, TimeIntegratedPostprocessor, ElementL2FunctorErrorTempl< is_ad >, ElementSidesL2Norm, NumVars, AverageNodalVariableValue, ElementL2Difference, NumLinearIterations, NumRelationshipManagers, PerfGraphData, SumPostprocessor, VariableResidual, VectorPostprocessorComponent, VectorPostprocessorReductionValue, KokkosNodalMaxValueId, KokkosNodalSum, ElementL2Error, EmptyPostprocessor, ElementArrayL2Norm, and ElementL2Norm.

◆ gradDot() [1/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradDot ( const ElemArg elem,
const StateArg state 
) const
inherited

Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 939 of file MooseFunctor.h.

940 {
941  return evaluateGradDot(elem, state);
942 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

◆ gradDot() [2/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradDot ( const FaceArg face,
const StateArg state 
) const
inherited

Definition at line 946 of file MooseFunctor.h.

947 {
948  checkFace(face);
949  return evaluateGradDot(face, state);
950 }
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:738
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

◆ gradDot() [3/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradDot ( const ElemQpArg qp,
const StateArg state 
) const
inherited

Definition at line 954 of file MooseFunctor.h.

955 {
956  return evaluateGradDot(elem_qp, state);
957 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

◆ gradDot() [4/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradDot ( const ElemSideQpArg qp,
const StateArg state 
) const
inherited

Definition at line 961 of file MooseFunctor.h.

962 {
963  return evaluateGradDot(elem_side_qp, state);
964 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

◆ gradDot() [5/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradDot ( const ElemPointArg elem_point,
const StateArg state 
) const
inherited

Definition at line 968 of file MooseFunctor.h.

969 {
970  return evaluateGradDot(elem_point, state);
971 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

◆ gradDot() [6/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradDot ( const NodeArg node,
const StateArg state 
) const
inherited

Definition at line 975 of file MooseFunctor.h.

976 {
977  return evaluateGradDot(node, state);
978 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

◆ gradient() [1/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradient ( const ElemArg elem,
const StateArg state 
) const
inherited

Same as their evaluateGradient overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 853 of file MooseFunctor.h.

854 {
855  return evaluateGradient(elem, state);
856 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ gradient() [2/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradient ( const FaceArg face,
const StateArg state 
) const
inherited

Definition at line 860 of file MooseFunctor.h.

861 {
862  checkFace(face);
863  return evaluateGradient(face, state);
864 }
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:738
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ gradient() [3/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradient ( const ElemQpArg qp,
const StateArg state 
) const
inherited

Definition at line 868 of file MooseFunctor.h.

869 {
870  return evaluateGradient(elem_qp, state);
871 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ gradient() [4/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradient ( const ElemSideQpArg qp,
const StateArg state 
) const
inherited

Definition at line 875 of file MooseFunctor.h.

876 {
877  return evaluateGradient(elem_side_qp, state);
878 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ gradient() [5/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradient ( const ElemPointArg elem_point,
const StateArg state 
) const
inherited

Definition at line 882 of file MooseFunctor.h.

883 {
884  return evaluateGradient(elem_point, state);
885 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ gradient() [6/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::gradient ( const NodeArg node,
const StateArg state 
) const
inherited

Definition at line 889 of file MooseFunctor.h.

890 {
891  return evaluateGradient(node, state);
892 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ hasBlocks()

virtual bool Postprocessor::hasBlocks ( SubdomainID  ) const
inlineoverridevirtualinherited

Returns whether the functor is defined on this block.

Reimplemented from Moose::FunctorBase< Real >.

Definition at line 70 of file Postprocessor.h.

70 { return true; }

◆ hasFaceSide()

bool Moose::FunctorBase< Real >::hasFaceSide ( const FaceInfo fi,
const bool  fi_elem_side 
) const
overridevirtualinherited

Implements FaceArgInterface.

Reimplemented in Moose::FunctorEnvelope< Real >, InternalSideIntegralVariablePostprocessor, InterfaceIntegralVariableValuePostprocessor, SideIntegralVariablePostprocessor, SideIntegralFunctorPostprocessorTempl< is_ad >, and SideIntegralFunctorPostprocessorTempl< false >.

Definition at line 982 of file MooseFunctor.h.

983 {
984  if (fi_elem_side)
985  return hasBlocks(fi.elem().subdomain_id());
986  else
987  return fi.neighborPtr() && hasBlocks(fi.neighbor().subdomain_id());
988 }
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.
Definition: MooseFunctor.h:243
const Elem & elem() const
Definition: FaceInfo.h:85
const Elem * neighborPtr() const
Definition: FaceInfo.h:88
const Elem & neighbor() const
Definition: FaceInfo.h:220

◆ isConstant()

virtual bool Moose::FunctorBase< Real >::isConstant ( ) const
inlinevirtualinherited

Returns true if this functor is a constant.

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 266 of file MooseFunctor.h.

266 { return false; }

◆ isExtrapolatedBoundaryFace()

virtual bool Moose::FunctorBase< Real >::isExtrapolatedBoundaryFace ( const FaceInfo ,
const Elem *  ,
const StateArg  
) const
inlinevirtualinherited

Returns whether this (sided) face is an extrapolated boundary face for this functor.

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 253 of file MooseFunctor.h.

254  {
255  mooseError("not implemented");
256  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311

◆ isFunctor() [1/2]

bool FunctorInterface::isFunctor ( const std::string &  name) const
protectedinherited

Checks the subproblem for the given functor.

This will not query default functors potentially stored in this object, e.g. this method will return false if the user passed an int or real to the functor param in the input file

Parameters
nameThe name of the functor to check. This should match the functor parameter name, not the actual name of the functor created in the input file
Returns
Whether the subproblem has the specified functor

Definition at line 124 of file FunctorInterface.C.

125 {
126  mooseAssert(_fi_subproblem, "This must be non-null");
127  return isFunctor(name, *_fi_subproblem);
128 }
SubProblem *const _fi_subproblem
Pointer to subproblem if the subproblem pointer parameter was set.
bool isFunctor(const std::string &name) const
Checks the subproblem for the given functor.

◆ isFunctor() [2/2]

bool FunctorInterface::isFunctor ( const std::string &  name,
const SubProblem subproblem 
) const
protectedinherited

Checks the passed-in subproblem for the given functor.

This will not query default functors potentially stored in this object, e.g. this method will return false if the user passed an int or real to the functor param in the input file

Parameters
nameThe name of the functor to check. This should match the functor parameter name, not the actual name of the functor created in the input file
subproblemThe subproblem to query for the functor
Returns
Whether the subproblem has the specified functor

Definition at line 115 of file FunctorInterface.C.

116 {
117  // Check if the supplied parameter is a valid input parameter key
118  std::string functor_name = deduceFunctorName(name);
119 
120  return subproblem.hasFunctor(functor_name, _fi_tid);
121 }
bool hasFunctor(const std::string &name, const THREAD_ID tid) const
checks whether we have a functor corresponding to name on the thread id tid
Definition: SubProblem.C:1275
const THREAD_ID _fi_tid
Current threaded it.
static std::string deduceFunctorName(const std::string &name, const InputParameters &params)
Helper to look up a functor name through the input parameter keys.

◆ isInternalFace()

bool Moose::FunctorBase< Real >::isInternalFace ( const FaceInfo fi) const
inherited

Returns true if the face is an internal face.

Definition at line 575 of file MooseFunctor.h.

576 {
577  if (!fi.neighborPtr())
578  return false;
579 
580  return hasBlocks(fi.elem().subdomain_id()) && hasBlocks(fi.neighborPtr()->subdomain_id());
581 }
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.
Definition: MooseFunctor.h:243
const Elem & elem() const
Definition: FaceInfo.h:85
const Elem * neighborPtr() const
Definition: FaceInfo.h:88

◆ jacobianSetup()

void Moose::FunctorBase< Real >::jacobianSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 837 of file MooseFunctor.h.

838 {
840  clearCacheData();
841 }
const ExecFlagType EXEC_NONLINEAR
Definition: Moose.C:33
void clearCacheData()
clear cache data
Definition: MooseFunctor.h:795
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:520

◆ makeElemArg()

Moose::ElemArg FunctorInterface::makeElemArg ( const Elem *  elem,
bool  correct_skewnewss = false 
) const
protectedinherited

◆ operator()() [1/6]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::operator() ( const ElemArg elem,
const StateArg state 
) const
inherited

Same as their evaluate overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 603 of file MooseFunctor.h.

604 {
605  if (_always_evaluate)
606  return evaluate(elem, state);
607 
608  mooseAssert(state.state == 0,
609  "Cached evaluations are only currently supported for the current state.");
610 
611  return queryFVArgCache(_elem_arg_to_value, elem);
612 }
ValueType queryFVArgCache(std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
check a finite volume spatial argument cache and if invalid then evaluate
Definition: MooseFunctor.h:586
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const=0
Evaluate the functor with a given element.
std::map< ElemArg, ValueType > _elem_arg_to_value
Map from element arguments to their cached evaluations.
Definition: MooseFunctor.h:561
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:523

◆ operator()() [2/6]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::operator() ( const FaceArg face,
const StateArg state 
) const
inherited

Definition at line 616 of file MooseFunctor.h.

617 {
618  checkFace(face_in);
619 
620  if (_always_evaluate)
621  return evaluate(face_in, state);
622 
623  mooseAssert(state.state == 0,
624  "Cached evaluations are only currently supported for the current state.");
625 
626  return queryFVArgCache(_face_arg_to_value, face_in);
627 }
std::map< FaceArg, ValueType > _face_arg_to_value
Map from face arguments to their cached evaluations.
Definition: MooseFunctor.h:564
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:738
ValueType queryFVArgCache(std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
check a finite volume spatial argument cache and if invalid then evaluate
Definition: MooseFunctor.h:586
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const=0
Evaluate the functor with a given element.
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:523

◆ operator()() [3/6]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::operator() ( const ElemQpArg qp,
const StateArg state 
) const
inherited

Definition at line 662 of file MooseFunctor.h.

663 {
664  if (_always_evaluate)
665  return evaluate(elem_qp, state);
666 
667  const auto elem_id = elem_qp.elem->id();
668  if (elem_id != _current_qp_map_key)
669  {
670  _current_qp_map_key = elem_id;
672  }
673  auto & qp_data = *_current_qp_map_value;
674  const auto qp = elem_qp.qp;
675  const auto * const qrule = elem_qp.qrule;
676  mooseAssert(qrule, "qrule must be non-null");
677 
678  return queryQpCache(qp, *qrule, qp_data, elem_qp, state);
679 }
dof_id_type _current_qp_map_key
Current key for qp map cache.
Definition: MooseFunctor.h:529
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value
Current value for qp map cache.
Definition: MooseFunctor.h:532
ValueType queryQpCache(unsigned int qp, const libMesh::QBase &qrule, std::vector< std::pair< bool, Real >> &qp_cache_data, const SpaceArg &space, const StateArg &state) const
check a qp cache and if invalid then evaluate
Definition: MooseFunctor.h:632
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const=0
Evaluate the functor with a given element.
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:523
std::unordered_map< dof_id_type, std::vector< std::pair< bool, ValueType > > > _qp_to_value
Cached element quadrature point functor property evaluations.
Definition: MooseFunctor.h:539

◆ operator()() [4/6]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::operator() ( const ElemSideQpArg qp,
const StateArg state 
) const
inherited

Definition at line 683 of file MooseFunctor.h.

684 {
685  if (_always_evaluate)
686  return evaluate(elem_side_qp, state);
687 
688  const Elem * const elem = elem_side_qp.elem;
689  mooseAssert(elem, "elem must be non-null");
690  const auto elem_id = elem->id();
691  if (elem_id != _current_side_qp_map_key)
692  {
693  _current_side_qp_map_key = elem_id;
695  }
696  auto & side_qp_data = *_current_side_qp_map_value;
697  const auto side = elem_side_qp.side;
698  const auto qp = elem_side_qp.qp;
699  const auto * const qrule = elem_side_qp.qrule;
700  mooseAssert(qrule, "qrule must be non-null");
701 
702  // Check and see whether we even have sized for this side
703  if (side >= side_qp_data.size())
704  side_qp_data.resize(elem->n_sides());
705 
706  // Ok we were sized enough for our side
707  auto & qp_data = side_qp_data[side];
708  return queryQpCache(qp, *qrule, qp_data, elem_side_qp, state);
709 }
std::unordered_map< dof_id_type, std::vector< std::vector< std::pair< bool, ValueType > > > > _side_qp_to_value
Cached element quadrature point functor property evaluations.
Definition: MooseFunctor.h:558
ValueType queryQpCache(unsigned int qp, const libMesh::QBase &qrule, std::vector< std::pair< bool, Real >> &qp_cache_data, const SpaceArg &space, const StateArg &state) const
check a qp cache and if invalid then evaluate
Definition: MooseFunctor.h:632
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const=0
Evaluate the functor with a given element.
dof_id_type _current_side_qp_map_key
Current key for side-qp map cache.
Definition: MooseFunctor.h:545
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
Current value for side-qp map cache.
Definition: MooseFunctor.h:548
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:523

◆ operator()() [5/6]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::operator() ( const ElemPointArg elem_point,
const StateArg state 
) const
inherited

Definition at line 713 of file MooseFunctor.h.

714 {
715  return evaluate(elem_point, state);
716 }
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const=0
Evaluate the functor with a given element.

◆ operator()() [6/6]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::operator() ( const NodeArg node,
const StateArg state 
) const
inherited

Definition at line 730 of file MooseFunctor.h.

731 {
732  mooseAssert(node.subdomain_ids, "Subdomain IDs must be supplied to the node argument");
733  return evaluate(node, state);
734 }
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const=0
Evaluate the functor with a given element.

◆ PPName()

const std::string& Postprocessor::PPName ( ) const
inlineinherited

Returns the name of the Postprocessor.

Definition at line 68 of file Postprocessor.h.

68 { return _pp_name; }
const std::string & _pp_name
Post-processor name.
Definition: Postprocessor.h:77

◆ residualSetup()

void Moose::FunctorBase< Real >::residualSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 829 of file MooseFunctor.h.

830 {
831  if (_clearance_schedule.count(EXEC_LINEAR))
832  clearCacheData();
833 }
const ExecFlagType EXEC_LINEAR
Definition: Moose.C:31
void clearCacheData()
clear cache data
Definition: MooseFunctor.h:795
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:520

◆ setCacheClearanceSchedule()

void Moose::FunctorBase< Real >::setCacheClearanceSchedule ( const std::set< ExecFlagType > &  clearance_schedule)
inherited

Set how often to clear the functor evaluation cache.

Definition at line 720 of file MooseFunctor.h.

721 {
722  if (clearance_schedule.count(EXEC_ALWAYS))
723  _always_evaluate = true;
724 
725  _clearance_schedule = clearance_schedule;
726 }
const ExecFlagType EXEC_ALWAYS
Definition: Moose.C:51
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:523
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:520

◆ supportsElemSideQpArg()

bool Postprocessor::supportsElemSideQpArg ( ) const
inlinefinaloverridevirtualinherited

Whether this functor supports evaluation with ElemSideQpArg.

Implements Moose::FunctorBase< Real >.

Definition at line 73 of file Postprocessor.h.

73 { return true; }

◆ supportsFaceArg()

bool Postprocessor::supportsFaceArg ( ) const
inlinefinaloverridevirtualinherited

Whether this functor supports evaluation with FaceArg.

Implements Moose::FunctorBase< Real >.

Definition at line 72 of file Postprocessor.h.

72 { return true; }

◆ timestepSetup()

void Moose::FunctorBase< Real >::timestepSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Reimplemented in Function, NumNonlinearIterations, and MemoryUsage.

Definition at line 821 of file MooseFunctor.h.

822 {
824  clearCacheData();
825 }
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:37
void clearCacheData()
clear cache data
Definition: MooseFunctor.h:795
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:520

◆ validParams()

static InputParameters Moose::Kokkos::Postprocessor::validParams ( )
static

Member Data Documentation

◆ _current_value

const PostprocessorValue& Postprocessor::_current_value
protectedinherited

The current value, which is the Reporter value that changes when we execute UOs in the problem.

Definition at line 80 of file Postprocessor.h.

Referenced by Postprocessor::getCurrentValue().

◆ _pp_name

const std::string& Postprocessor::_pp_name
protectedinherited

Post-processor name.

Definition at line 77 of file Postprocessor.h.

Referenced by Postprocessor::declareValue(), and Postprocessor::PPName().


The documentation for this class was generated from the following file: