SPH
|
Base class for conversion of quantities into the output data. More...
#include <Column.h>
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... | |
![]() | |
virtual | ~Polymorphic () |
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.
|
pure virtual |
Reads the value of the column and saves it into the storage, if possible.
storage | Particle storage where the value is stored |
value | Accumulated value, must be the same type as this column. Checked by assert. |
particleIdx | Index of accumulated particle; if larger than current size of the storage, the storage is resized accordingly. |
Exception | if value cannot be accumulated. |
Implemented in DamageColumn< TValue >, SmoothingLengthColumn, SecondDerivativeColumn< TValue >, DerivativeColumn< TValue >, ValueColumn< TValue >, TimeColumn, and ParticleNumberColumn.
|
pure virtual |
Returns the value of the output column for given particle.
storage | Storage containing all particle data |
stats | Holds simulation time as well as additional solver-specific statistics. |
particleIdx | Index of the particle to evaluate. |
Exception | if value cannot be evaluated, i.e. invalid particle index, quantity not stored, etc. |
|
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 >.
|
pure virtual |
Returns the value type of the column.
Implemented in TimeColumn, ParticleNumberColumn, DamageColumn< TValue >, SmoothingLengthColumn, SecondDerivativeColumn< TValue >, DerivativeColumn< TValue >, and ValueColumn< TValue >.