www.mooseframework.org
Postprocessor.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
39  virtual PostprocessorValue getValue() const = 0;
40 
57 
61  const std::string & PPName() const { return _pp_name; }
62 
63  virtual bool hasBlocks(SubdomainID /* id */) const override { return true; }
64 
65  bool supportsFaceArg() const override final { return true; }
66  bool supportsElemSideQpArg() const override final { return true; }
67 
68 protected:
70  const std::string & _pp_name;
71 
74 
75 private:
80  const PostprocessorValue & declareValue(const MooseObject & moose_object);
81 
88 
89  ValueType evaluate(const ElemArg & elem, const Moose::StateArg & state) const override final;
90  ValueType evaluate(const FaceArg & face, const Moose::StateArg & state) const override final;
91  ValueType evaluate(const ElemQpArg & qp, const Moose::StateArg & state) const override final;
92  ValueType evaluate(const ElemSideQpArg & elem_side_qp,
93  const Moose::StateArg & state) const override final;
94  ValueType evaluate(const ElemPointArg & elem_point,
95  const Moose::StateArg & state) const override final;
96  ValueType evaluate(const NodeArg & node, const Moose::StateArg & state) const override final;
97 
99  const Moose::StateArg & state) const override final;
101  const Moose::StateArg & state) const override final;
103  const Moose::StateArg & state) const override final;
104  GradientType evaluateGradient(const ElemSideQpArg & elem_side_qp,
105  const Moose::StateArg & state) const override final;
106  GradientType evaluateGradient(const ElemPointArg & elem_point,
107  const Moose::StateArg & state) const override final;
109  const Moose::StateArg & state) const override final;
110 
111  DotType evaluateDot(const ElemArg & elem, const Moose::StateArg & state) const override final;
112  DotType evaluateDot(const FaceArg & face, const Moose::StateArg & state) const override final;
113  DotType evaluateDot(const ElemQpArg & qp, const Moose::StateArg & state) const override final;
114  DotType evaluateDot(const ElemSideQpArg & elem_side_qp,
115  const Moose::StateArg & state) const override final;
116  DotType evaluateDot(const ElemPointArg & elem_point,
117  const Moose::StateArg & state) const override final;
118  DotType evaluateDot(const NodeArg & node, const Moose::StateArg & state) const override final;
119 
123  void evaluateDotWarning() const;
124 
127 };
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:61
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:66
Postprocessor(const MooseObject *moose_object)
Definition: Postprocessor.C:30
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:56
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:41
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:65
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:33
const std::string & _pp_name
Post-processor name.
Definition: Postprocessor.h:70
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:191
const PostprocessorValue & _current_value
The current value, which is the Reporter value that changes when we execute UOs in the problem...
Definition: Postprocessor.h:73
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:65
State argument for evaluating functors.
virtual bool hasBlocks(SubdomainID) const override
Returns whether the functor is defined on this block.
Definition: Postprocessor.h:63
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...