SPH
Public Member Functions | List of all members
ValueColumn< TValue > Class Template Reference

Returns values of given quantity as stored in storage. More...

#include <Column.h>

Inheritance diagram for ValueColumn< TValue >:
ITextColumn Polymorphic

Public Member Functions

 ValueColumn (const QuantityId id)
 
virtual Dynamic evaluate (const Storage &storage, const Statistics &UNUSED(stats), const Size particleIdx) const override
 
virtual void accumulate (Storage &storage, const Dynamic value, const Size particleIdx) const override
 Reads the value of the column and saves it into the storage, if possible. More...
 
virtual std::string getName () const override
 Returns a name of the column. More...
 
virtual ValueEnum getType () const override
 Returns the value type of the column. More...
 
- Public Member Functions inherited from ITextColumn
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...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

template<typename TValue>
class ValueColumn< TValue >

Returns values of given quantity as stored in storage.

This is the most common column. Most columns for quantities can be added using OutputQuantityFlag, however if additional quantities need to be saved, it can be done using:

TextOutput output(outputPath, "run name", EMPTY_FLAGS);
// add temperature (scalar quantity)
// add surface normal (vector quantity)
INLINE AutoPtr< T > makeAuto(TArgs &&... args)
Definition: AutoPtr.h:124
const EmptyFlags EMPTY_FLAGS
Definition: Flags.h:16
@ TEMPERATURE
Temperature, always a scalar quantity.
@ SURFACE_NORMAL
Vector approximating surface normal.
Output saving data to text (human readable) file.
Definition: Output.h:152
Returns values of given quantity as stored in storage.
Definition: Column.h:73

Definition at line 73 of file Column.h.

Constructor & Destructor Documentation

◆ ValueColumn()

template<typename TValue >
ValueColumn< TValue >::ValueColumn ( const QuantityId  id)
inlineexplicit

Definition at line 78 of file Column.h.

Member Function Documentation

◆ accumulate()

template<typename TValue >
virtual void ValueColumn< TValue >::accumulate ( Storage storage,
const Dynamic  value,
const Size  particleIdx 
) const
inlineoverridevirtual

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.
Todo:
must also resize derivaties, or avoid resizing

Implements ITextColumn.

Definition at line 92 of file Column.h.

◆ evaluate()

template<typename TValue >
virtual Dynamic ValueColumn< TValue >::evaluate ( const Storage storage,
const Statistics UNUSEDstats,
const Size  particleIdx 
) const
inlineoverridevirtual

Definition at line 81 of file Column.h.

◆ getName()

template<typename TValue >
virtual std::string ValueColumn< TValue >::getName ( ) const
inlineoverridevirtual

Returns a name of the column.

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

Implements ITextColumn.

Definition at line 102 of file Column.h.

◆ getType()

template<typename TValue >
virtual ValueEnum ValueColumn< TValue >::getType ( ) const
inlineoverridevirtual

Returns the value type of the column.

Implements ITextColumn.

Definition at line 106 of file Column.h.


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