https://mooseframework.inl.gov
Postprocessor.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 #include "OutputInterface.h"
13 #include "NonADFunctorInterface.h"
14 #include "libmesh/parallel.h"
15 
16 class MooseObject;
17 
24  public NonADFunctorInterface,
25  public Moose::FunctorBase<Real>
26 {
27 public:
29 
30  Postprocessor(const MooseObject * moose_object);
31 
32 #ifdef MOOSE_KOKKOS_ENABLED
33 
36  Postprocessor(const Postprocessor & object, const Moose::Kokkos::FunctorCopy & key);
37 #endif
38 
46  virtual PostprocessorValue getValue() const = 0;
47 
64 
68  const std::string & PPName() const { return _pp_name; }
69 
70  virtual bool hasBlocks(SubdomainID /* id */) const override { return true; }
71 
72  bool supportsFaceArg() const override final { return true; }
73  bool supportsElemSideQpArg() const override final { return true; }
74 
75 protected:
77  const std::string & _pp_name;
78 
81 
82 private:
87  const PostprocessorValue & declareValue(const MooseObject & moose_object);
88 
95 
96  ValueType evaluate(const ElemArg & elem, const Moose::StateArg & state) const override final;
97  ValueType evaluate(const FaceArg & face, const Moose::StateArg & state) const override final;
98  ValueType evaluate(const ElemQpArg & qp, const Moose::StateArg & state) const override final;
99  ValueType evaluate(const ElemSideQpArg & elem_side_qp,
100  const Moose::StateArg & state) const override final;
101  ValueType evaluate(const ElemPointArg & elem_point,
102  const Moose::StateArg & state) const override final;
103  ValueType evaluate(const NodeArg & node, const Moose::StateArg & state) const override final;
104 
106  const Moose::StateArg & state) const override final;
108  const Moose::StateArg & state) const override final;
110  const Moose::StateArg & state) const override final;
111  GradientType evaluateGradient(const ElemSideQpArg & elem_side_qp,
112  const Moose::StateArg & state) const override final;
113  GradientType evaluateGradient(const ElemPointArg & elem_point,
114  const Moose::StateArg & state) const override final;
116  const Moose::StateArg & state) const override final;
117 
118  DotType evaluateDot(const ElemArg & elem, const Moose::StateArg & state) const override final;
119  DotType evaluateDot(const FaceArg & face, const Moose::StateArg & state) const override final;
120  DotType evaluateDot(const ElemQpArg & qp, const Moose::StateArg & state) const override final;
121  DotType evaluateDot(const ElemSideQpArg & elem_side_qp,
122  const Moose::StateArg & state) const override final;
123  DotType evaluateDot(const ElemPointArg & elem_point,
124  const Moose::StateArg & state) const override final;
125  DotType evaluateDot(const NodeArg & node, const Moose::StateArg & state) const override final;
126 
130  void evaluateDotWarning() const;
131 
134 };
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...
const std::string & PPName() const
Returns the name of the Postprocessor.
Definition: Postprocessor.h:68
void evaluateDotWarning() const
Internal method for giving a one-time warning for calling an evaluateDot() method.
bool supportsElemSideQpArg() const override final
Whether this functor supports evaluation with ElemSideQpArg.
Definition: Postprocessor.h:73
Postprocessor(const MooseObject *moose_object)
Definition: Postprocessor.C:27
Base class template for functor objects.
Definition: MooseFunctor.h:137
static InputParameters validParams()
Definition: Postprocessor.C:17
A class to provide an common interface to objects requiring "outputs" option.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
const PostprocessorValue & getCurrentValue() const
Definition: Postprocessor.h:63
const PostprocessorValue & declareValue(const MooseObject &moose_object)
Internal method to be used to declare the value and store it within _current_value in the constructor...
Definition: Postprocessor.C:50
typename FunctorReturnType< Real, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector...
Definition: MooseFunctor.h:149
ValueType evaluate(const ElemArg &elem, const Moose::StateArg &state) const override final
Evaluate the functor with a given element.
Definition: Postprocessor.C:74
A structure defining a "face" evaluation calling argument for Moose functors.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
const std::string & _pp_name
Post-processor name.
Definition: Postprocessor.h:77
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:230
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
A structure that is used to evaluate Moose functors logically at an element/cell center.
Argument for requesting functor evaluation at a quadrature point location in an element.
Base class for all Postprocessors.
Definition: Postprocessor.h:23
DotType evaluateDot(const ElemArg &elem, const Moose::StateArg &state) const override final
Evaluate the functor time derivative with a given element.
const MooseObject & _pp_moose_object
MOOSE object.
virtual PostprocessorValue getValue() const =0
This will get called to actually grab the final value the postprocessor has calculated.
bool supportsFaceArg() const override final
Whether this functor supports evaluation with FaceArg.
Definition: Postprocessor.h:72
State argument for evaluating functors.
virtual bool hasBlocks(SubdomainID) const override
Returns whether the functor is defined on this block.
Definition: Postprocessor.h:70
GradientType evaluateGradient(const ElemArg &elem, const Moose::StateArg &state) const override final
Evaluate the functor gradient with a given element.
Argument for requesting functor evaluation at quadrature point locations on an element side...