www.mooseframework.org
RichardsSumQuantity.C
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 #include "RichardsSumQuantity.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<GeneralUserObject>();
15 
16  return params;
17 }
18 
19 RichardsSumQuantity::RichardsSumQuantity(const InputParameters & parameters)
20  : GeneralUserObject(parameters), _total(0)
21 {
22 }
23 
25 
26 void
28 {
29  _total = 0;
30 }
31 
32 void
34 {
35  _total += contrib;
36 }
37 
38 void
40 {
41 }
42 
43 void
45 {
46 }
47 
48 void
50 {
51  gatherSum(_total);
52 }
53 
54 Real
56 {
57  return _total;
58 }
Real _total
this holds the sum
void zero()
sets _total = 0
virtual void execute()
does nothing
void add(Real contrib)
adds contrib to _total
virtual void initialize()
does nothing
virtual void finalize()
does MPI gather on _total
virtual Real getValue() const
returns _total
InputParameters validParams< RichardsSumQuantity >()
RichardsSumQuantity(const InputParameters &parameters)