www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
PorousFlowSumQuantity Class Reference

Sums into _total This is used, for instance, to record the total mass flowing into a borehole. More...

#include <PorousFlowSumQuantity.h>

Inheritance diagram for PorousFlowSumQuantity:
[legend]

Public Member Functions

 PorousFlowSumQuantity (const InputParameters &parameters)
 
virtual ~PorousFlowSumQuantity ()
 
void zero ()
 sets _total = 0 More...
 
void add (Real contrib)
 adds contrib to _total More...
 
virtual void initialize () override
 does nothing More...
 
virtual void execute () override
 does nothing More...
 
virtual void finalize () override
 does MPI gather on _total More...
 
virtual Real getValue () const
 returns _total More...
 

Protected Attributes

Real _total
 this holds the sum More...
 

Detailed Description

Sums into _total This is used, for instance, to record the total mass flowing into a borehole.

This is a suboptimal setup because it requires a const_cast of a PorousFlowSumQuantity object in order to do the summing

Definition at line 25 of file PorousFlowSumQuantity.h.

Constructor & Destructor Documentation

PorousFlowSumQuantity::PorousFlowSumQuantity ( const InputParameters &  parameters)

Definition at line 19 of file PorousFlowSumQuantity.C.

20  : GeneralUserObject(parameters), _total(0.0)
21 {
22 }
Real _total
this holds the sum
PorousFlowSumQuantity::~PorousFlowSumQuantity ( )
virtual

Definition at line 24 of file PorousFlowSumQuantity.C.

24 {}

Member Function Documentation

void PorousFlowSumQuantity::add ( Real  contrib)

adds contrib to _total

Parameters
contribthe amount to add to _total

Definition at line 33 of file PorousFlowSumQuantity.C.

Referenced by PorousFlowLineSink::computeQpResidual().

34 {
35  _total += contrib;
36 }
Real _total
this holds the sum
void PorousFlowSumQuantity::execute ( )
overridevirtual

does nothing

Definition at line 44 of file PorousFlowSumQuantity.C.

45 {
46 }
void PorousFlowSumQuantity::finalize ( )
overridevirtual

does MPI gather on _total

Definition at line 49 of file PorousFlowSumQuantity.C.

50 {
51  gatherSum(_total);
52 }
Real _total
this holds the sum
Real PorousFlowSumQuantity::getValue ( ) const
virtual

returns _total

Definition at line 55 of file PorousFlowSumQuantity.C.

Referenced by PorousFlowPlotQuantity::getValue().

56 {
57  return _total;
58 }
Real _total
this holds the sum
void PorousFlowSumQuantity::initialize ( )
overridevirtual

does nothing

Definition at line 39 of file PorousFlowSumQuantity.C.

40 {
41 }
void PorousFlowSumQuantity::zero ( )

sets _total = 0

Definition at line 27 of file PorousFlowSumQuantity.C.

Referenced by PorousFlowLineSink::addPoints(), and PorousFlowLineSink::PorousFlowLineSink().

28 {
29  _total = 0.0;
30 }
Real _total
this holds the sum

Member Data Documentation

Real PorousFlowSumQuantity::_total
protected

this holds the sum

Definition at line 54 of file PorousFlowSumQuantity.h.

Referenced by add(), finalize(), getValue(), and zero().


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