www.mooseframework.org
PorousFlowSumQuantity.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef POROUSFLOWSUMQUANTITY_H
9 #define POROUSFLOWSUMQUANTITY_H
10 
11 #include "GeneralUserObject.h"
12 
14 
15 template <>
16 InputParameters validParams<PorousFlowSumQuantity>();
17 
25 class PorousFlowSumQuantity : public GeneralUserObject
26 {
27 public:
28  PorousFlowSumQuantity(const InputParameters & parameters);
29  virtual ~PorousFlowSumQuantity();
30 
32  void zero();
33 
38  void add(Real contrib);
39 
41  virtual void initialize() override;
42 
44  virtual void execute() override;
45 
47  virtual void finalize() override;
48 
50  virtual Real getValue() const;
51 
52 protected:
54  Real _total;
55 };
56 
57 #endif /* POROUSFLOWSUMQUANTITY_H */
void add(Real contrib)
adds contrib to _total
virtual void initialize() override
does nothing
InputParameters validParams< PorousFlowSumQuantity >()
PorousFlowSumQuantity(const InputParameters &parameters)
void zero()
sets _total = 0
virtual Real getValue() const
returns _total
Sums into _total This is used, for instance, to record the total mass flowing into a borehole...
Real _total
this holds the sum
virtual void finalize() override
does MPI gather on _total
virtual void execute() override
does nothing