SPH
Public Member Functions | List of all members
ITextColumn Class Referenceabstract

Base class for conversion of quantities into the output data. More...

#include <Column.h>

Inheritance diagram for ITextColumn:
Polymorphic DamageColumn< TValue > DerivativeColumn< TValue > ParticleNumberColumn SecondDerivativeColumn< TValue > SmoothingLengthColumn TimeColumn ValueColumn< TValue >

Public Member Functions

virtual Dynamic evaluate (const Storage &storage, const Statistics &stats, const Size particleIdx) const =0
 Returns the value of the output column for given particle. More...
 
virtual void accumulate (Storage &storage, const Dynamic value, const Size particleIdx) const =0
 Reads the value of the column and saves it into the storage, if possible. More...
 
virtual std::string getName () const =0
 Returns a name of the column. More...
 
virtual ValueEnum getType () const =0
 Returns the value type of the column. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Base class for conversion of quantities into the output data.

When TextOutput is selected, this represents a single column of values in the file, hence the name. Ordinarily, we need to store the quantity values and their derivatives directly, derived classes ValueColumn and DerivativeColumn can be used for this purpose. Other implementations can be used to store values that are not directly saved in any quantity, such as smoothing lenghts (they are actually stored as 4th component of the position vectors), or actual values of stress tensor (quantity contains undamaged values).

The class can also be used to save arbitrary data, such as particle index, current time of the simulation, etc. This can be useful when using the output files in additional scripts, for example when creating plots in Gnuplot.

Todo:
There should also be a conversion from code units to user-selected output units

Definition at line 30 of file Column.h.

Member Function Documentation

◆ accumulate()

virtual void ITextColumn::accumulate ( Storage storage,
const Dynamic  value,
const Size  particleIdx 
) const
pure virtual

Reads the value of the column and saves it into the storage, if possible.

Parameters
storageParticle storage where the value is stored
valueAccumulated value, must be the same type as this column. Checked by assert.
particleIdxIndex of accumulated particle; if larger than current size of the storage, the storage is resized accordingly.
Exceptions
Exceptionif value cannot be accumulated.

Implemented in DamageColumn< TValue >, SmoothingLengthColumn, SecondDerivativeColumn< TValue >, DerivativeColumn< TValue >, ValueColumn< TValue >, TimeColumn, and ParticleNumberColumn.

◆ evaluate()

virtual Dynamic ITextColumn::evaluate ( const Storage storage,
const Statistics stats,
const Size  particleIdx 
) const
pure virtual

Returns the value of the output column for given particle.

Parameters
storageStorage containing all particle data
statsHolds simulation time as well as additional solver-specific statistics.
particleIdxIndex of the particle to evaluate.
Exceptions
Exceptionif value cannot be evaluated, i.e. invalid particle index, quantity not stored, etc.

◆ getName()

virtual std::string ITextColumn::getName ( ) const
pure virtual

Returns a name of the column.

The name is printed in the header of the output file.

Implemented in TimeColumn, ParticleNumberColumn, DamageColumn< TValue >, SmoothingLengthColumn, SecondDerivativeColumn< TValue >, DerivativeColumn< TValue >, and ValueColumn< TValue >.

◆ getType()

virtual ValueEnum ITextColumn::getType ( ) const
pure virtual

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