walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D > Class Template Reference

Detailed Description

template<typename DensityField_T, typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
class walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >

Class for evaluating the evolution of the mass of a simulation.

Mass Evaluation

Do not create objects of class MassEvaluation directly, better use one of the various 'makeMassEvaluation' functions below!

Template parameters:

  • DensityField_T: a scalar field that stores the density. If the density is not explicitly stored in a field but can be calculated from the data stored in another field, you do not have to create a density field but you can use a field adaptor.
  • Filter_T: the type of the evaluation filter (see Evaluation Filter in 'EvaluationFilter.h')

Parameters for setting up and controlling mass evaluation:

  • blocks: the block storage
  • fieldId: block data ID of the density field (might be a field adaptor)
  • filter: the evaluation filter that indicates which cells are processed
  • plot frequency: the plotting interval - used for saving the data to file. If set to '0', no plotting data is created.
  • log frequency: the logging interval - used for logging the data via the Logging singleton. If set to '0', no logging is performed.
  • filename: the name of the file that stores the data for plotting
  • domain normalization: In order to evaluate the mass, the density of a cell is multiplied with the volume of the cell. By default, the volume of a cell corresponds the the simulation space as given by the domain bounding box (blocks->getDomain()). However, you can overwrite the size of the domain via the domain normalization parameter. If you do so, the volume of each cell will correspond to this 'normalized' domain.
  • required and incompatible selectors

You do not have to specify an evaluation filter! If you do not specify any filter, all cells are processed and no cell is excluded.

If you want to use a flag field as evaluation filter, fitting 'makeMassEvaluation' functions already exist. These functions need an additional template parameter FlagField_T and you have to provide the block data ID of the flag field together with a set of flag UIDs that specify which cells need to be processed.

There also exist 'makeMassEvaluation' functions that take configuration file data as an additional parameter in order to parse the configuration file for setting up and controlling mass evaluation. The configuration file block looks like as follows:

{
plotFrequency [unsigned integer]; // the plot frequency
logFrequency [unsigned integer]; // the log frequency
filename [string]; // the name of the file that stores the data for plotting
domain [Vector3: <real,real,real>]; // domain normalization
}

Example:

{
plotFrequency 10;
logFrequency 1000;
filename Mass.txt;
domain <1,1,1>;
}

Note that the shared pointer returned by all 'makeMassEvaluation' functions can be captured by a SharedFunctor for immediate registration at a time loop (see field::makeSharedFunctor).

#include <MassEvaluation.h>

Public Member Functions

 MassEvaluation (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const Filter_T &filter, const uint_t plotFrequency, const uint_t logFrequency, const std::string &filename=internal::massEvaluationFilename, const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
 
 MassEvaluation (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const uint_t plotFrequency, const uint_t logFrequency, const std::string &filename=internal::massEvaluationFilename, const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
 
void setDomainNormalization (const Vector3< real_t > &d)
 
void operator() ()
 

Private Attributes

weak_ptr< StructuredBlockStorageblocks_
 
Filter_T filter_
 
uint_t executionCounter_
 
uint_t plotFrequency_
 
uint_t logFrequency_
 
std::string filename_
 
ConstBlockDataID fieldId_
 
Vector3< real_tdomainNormalization_
 
real_t initialMass_
 
real_t minMass_
 
real_t maxMass_
 
Set< SUID > requiredSelectors_
 
Set< SUID > incompatibleSelectors_
 

Constructor & Destructor Documentation

◆ MassEvaluation() [1/2]

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::MassEvaluation ( const weak_ptr< StructuredBlockStorage > &  blocks,
const ConstBlockDataID fieldId,
const Filter_T &  filter,
const uint_t  plotFrequency,
const uint_t  logFrequency,
const std::string &  filename = internal::massEvaluationFilename,
const Set< SUID > &  requiredSelectors = Set<SUID>::emptySet(),
const Set< SUID > &  incompatibleSelectors = Set<SUID>::emptySet() 
)
inline

◆ MassEvaluation() [2/2]

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::MassEvaluation ( const weak_ptr< StructuredBlockStorage > &  blocks,
const ConstBlockDataID fieldId,
const uint_t  plotFrequency,
const uint_t  logFrequency,
const std::string &  filename = internal::massEvaluationFilename,
const Set< SUID > &  requiredSelectors = Set<SUID>::emptySet(),
const Set< SUID > &  incompatibleSelectors = Set<SUID>::emptySet() 
)
inline

Member Function Documentation

◆ operator()()

template<typename DensityField_T , typename Filter_T , bool Pseudo2D>
void walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::operator()

◆ setDomainNormalization()

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
void walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::setDomainNormalization ( const Vector3< real_t > &  d)
inline

Member Data Documentation

◆ blocks_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
weak_ptr< StructuredBlockStorage > walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::blocks_
private

◆ domainNormalization_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
Vector3<real_t> walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::domainNormalization_
private

◆ executionCounter_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
uint_t walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::executionCounter_
private

◆ fieldId_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
ConstBlockDataID walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::fieldId_
private

◆ filename_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
std::string walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::filename_
private

◆ filter_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
Filter_T walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::filter_
private

◆ incompatibleSelectors_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
Set<SUID> walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::incompatibleSelectors_
private

◆ initialMass_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
real_t walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::initialMass_
private

◆ logFrequency_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
uint_t walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::logFrequency_
private

◆ maxMass_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
real_t walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::maxMass_
private

◆ minMass_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
real_t walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::minMass_
private

◆ plotFrequency_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
uint_t walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::plotFrequency_
private

◆ requiredSelectors_

template<typename DensityField_T , typename Filter_T = DefaultEvaluationFilter, bool Pseudo2D = false>
Set<SUID> walberla::field::MassEvaluation< DensityField_T, Filter_T, Pseudo2D >::requiredSelectors_
private

The documentation for this class was generated from the following file:
MassEvaluation(const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const Filter_T &filter, const uint_t plotFrequency, const uint_t logFrequency, const std::string &filename=internal::massEvaluationFilename, const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
Definition: MassEvaluation.h:130