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 27 of file PorousFlowSumQuantity.h.

Constructor & Destructor Documentation

◆ PorousFlowSumQuantity()

PorousFlowSumQuantity::PorousFlowSumQuantity ( const InputParameters &  parameters)

Definition at line 23 of file PorousFlowSumQuantity.C.

24  : GeneralUserObject(parameters), _total(0.0)
25 {
26 }
Real _total
This holds the sum.

◆ ~PorousFlowSumQuantity()

PorousFlowSumQuantity::~PorousFlowSumQuantity ( )
virtual

Definition at line 28 of file PorousFlowSumQuantity.C.

28 {}

Member Function Documentation

◆ add()

void PorousFlowSumQuantity::add ( Real  contrib)

Adds contrib to _total.

Parameters
contribthe amount to add to _total

Definition at line 37 of file PorousFlowSumQuantity.C.

Referenced by PorousFlowLineSink::computeQpResidual().

38 {
39  _total += contrib;
40 }
Real _total
This holds the sum.

◆ execute()

void PorousFlowSumQuantity::execute ( )
overridevirtual

Does nothing.

Definition at line 48 of file PorousFlowSumQuantity.C.

49 {
50 }

◆ finalize()

void PorousFlowSumQuantity::finalize ( )
overridevirtual

Does MPI gather on _total.

Definition at line 53 of file PorousFlowSumQuantity.C.

54 {
55  gatherSum(_total);
56 }
Real _total
This holds the sum.

◆ getValue()

Real PorousFlowSumQuantity::getValue ( ) const
virtual

Returns _total.

Definition at line 59 of file PorousFlowSumQuantity.C.

Referenced by PorousFlowPlotQuantity::getValue().

60 {
61  return _total;
62 }
Real _total
This holds the sum.

◆ initialize()

void PorousFlowSumQuantity::initialize ( )
overridevirtual

Does nothing.

Definition at line 43 of file PorousFlowSumQuantity.C.

44 {
45 }

◆ zero()

void PorousFlowSumQuantity::zero ( )

Sets _total = 0.

Definition at line 31 of file PorousFlowSumQuantity.C.

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

32 {
33  _total = 0.0;
34 }
Real _total
This holds the sum.

Member Data Documentation

◆ _total

Real PorousFlowSumQuantity::_total
protected

This holds the sum.

Definition at line 56 of file PorousFlowSumQuantity.h.

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


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