SPH
Public Member Functions | List of all members
QuantityMeans Class Reference

Returns means of given scalar quantity. More...

#include <Integrals.h>

Inheritance diagram for QuantityMeans:
IIntegral< MinMaxMean > Polymorphic

Public Member Functions

 QuantityMeans (const QuantityId id, const Optional< Size > bodyId=NOTHING)
 Computes mean of quantity values. More...
 
 QuantityMeans (AutoPtr< IUserQuantity > &&func, const Optional< Size > bodyId=NOTHING)
 Computes mean of user-defined function. More...
 
virtual MinMaxMean evaluate (const Storage &storage) const override
 Computes the integral quantity using particles in the storage. More...
 
virtual std::string getName () const override
 Returns the name of the integral. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Returns means of given scalar quantity.

By default means are computed from all particles, optionally only from particles of given body. Storage must contain quantity of given ID, checked by assert.

Definition at line 181 of file Integrals.h.

Constructor & Destructor Documentation

◆ QuantityMeans() [1/2]

QuantityMeans::QuantityMeans ( const QuantityId  id,
const Optional< Size bodyId = NOTHING 
)
explicit

Computes mean of quantity values.

Parameters
idQuantity ID of average quantity
bodyIdOptional body index; by default all particles are averaged.

Definition at line 152 of file Integrals.cpp.

◆ QuantityMeans() [2/2]

QuantityMeans::QuantityMeans ( AutoPtr< IUserQuantity > &&  func,
const Optional< Size bodyId = NOTHING 
)
explicit

Computes mean of user-defined function.

Definition at line 156 of file Integrals.cpp.

Member Function Documentation

◆ evaluate()

MinMaxMean QuantityMeans::evaluate ( const Storage storage) const
overridevirtual

Computes the integral quantity using particles in the storage.

Storage must contain quantites relevant to the integral implementation. Generally positions, masses and density must be present.

Implements IIntegral< MinMaxMean >.

Definition at line 160 of file Integrals.cpp.

◆ getName()

virtual std::string QuantityMeans::getName ( ) const
inlineoverridevirtual

Returns the name of the integral.

Needed to label the integral in logs, GUI etc.

Implements IIntegral< MinMaxMean >.

Definition at line 197 of file Integrals.h.


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