SPH
Public Types | Public Member Functions | List of all members
TextOutput Class Reference

Output saving data to text (human readable) file. More...

#include <Output.h>

Inheritance diagram for TextOutput:
IOutput Polymorphic GnuplotOutput

Public Types

enum class  Options { DUMP_ALL = 1 << 0 , SCIENTIFIC = 1 << 1 }
 

Public Member Functions

 TextOutput (const OutputFile &fileMask, const std::string &runName, Flags< OutputQuantityFlag > quantities, Flags< Options > options=EMPTY_FLAGS)
 Creates a new text file output. More...
 
 ~TextOutput ()
 
TextOutputaddColumn (AutoPtr< ITextColumn > &&column)
 Adds a new column to be saved into the file. More...
 
virtual Expected< Pathdump (const Storage &storage, const Statistics &stats) override
 Saves data from particle storage into the file. More...
 
- Public Member Functions inherited from IOutput
 IOutput (const OutputFile &fileMask)
 Constructs output given the file name of the output. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Additional Inherited Members

- Protected Attributes inherited from IOutput
OutputFile paths
 

Detailed Description

Output saving data to text (human readable) file.

Definition at line 152 of file Output.h.

Member Enumeration Documentation

◆ Options

enum TextOutput::Options
strong
Enumerator
DUMP_ALL 

Dumps all quantity values from the storage; this overrides the list of selected particles.

SCIENTIFIC 

Writes all numbers in scientific format.

Definition at line 154 of file Output.h.

Constructor & Destructor Documentation

◆ TextOutput()

TextOutput::TextOutput ( const OutputFile fileMask,
const std::string &  runName,
Flags< OutputQuantityFlag quantities,
Flags< Options options = EMPTY_FLAGS 
)

Creates a new text file output.

Parameters
fileMaskPath where the file will be stored. Can contain wildcards, see IOutput constructor documentation.
runNameArbitrary label of the simulation, saved in the file header/
quantitiesList of quantities to store. Note that arbitrary quantities can be later added using addColumn.
optionsParameters of the file, see Options enum.

Definition at line 180 of file Output.cpp.

◆ ~TextOutput()

TextOutput::~TextOutput ( )
default

Member Function Documentation

◆ addColumn()

TextOutput & TextOutput::addColumn ( AutoPtr< ITextColumn > &&  column)

Adds a new column to be saved into the file.

Unless an option is specified in constructor, the file has no columns. All quantities must be explicitly added using this function. The column is added to the right end of the text file.

Parameters
columnNew column to save; see ITextColumn and derived classes
Returns
Reference to itself, allowing to queue calls

Definition at line 251 of file Output.cpp.

◆ dump()

Expected< Path > TextOutput::dump ( const Storage storage,
const Statistics stats 
)
overridevirtual

Saves data from particle storage into the file.

Returns the filename of the dump, generated from file mask given in constructor, or an error message in case writing the output file failed.

Implements IOutput.

Reimplemented in GnuplotOutput.

Definition at line 192 of file Output.cpp.


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