Alsvinn  0.5.3
The fast FVM simulator with UQ support
Public Member Functions | List of all members
alsfvm::io::FixedIntervalWriter Class Reference

The FixedIntervalWriter class is a decorator for another writer. Its purpose is to only call the underlying Writer object at fixed time intervals. More...

#include <alsfvm/io/FixedIntervalWriter.hpp>

Inheritance diagram for alsfvm::io::FixedIntervalWriter:
alsfvm::io::Writer alsfvm::integrator::TimestepAdjuster

Public Member Functions

 FixedIntervalWriter (alsfvm::shared_ptr< Writer > &writer, real timeInterval, real endTime, bool writeInitialTimestep=true, real startTime=0)
 
virtual ~FixedIntervalWriter ()
 
virtual void write (const volume::Volume &conservedVariables, const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation) override
 write writes the data to disk More...
 
virtual real adjustTimestep (real dt, const simulator::TimestepInformation &timestepInformation) const override
 adjustTimestep returns the new timestep that the simulator should use More...
 
virtual void finalize (const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation) override
 This method should be called at the end of the simulation. More...
 
- Public Member Functions inherited from alsfvm::io::Writer
virtual ~Writer ()
 
void addAttributes (const std::string &nameOfAttributes, const boost::property_tree::ptree &attributes)
 

Additional Inherited Members

- Static Public Member Functions inherited from alsfvm::io::Writer
static std::string getClassName ()
 
- Protected Attributes inherited from alsfvm::io::Writer
std::map< std::string, boost::property_tree::ptree > attributesMap
 

Detailed Description

The FixedIntervalWriter class is a decorator for another writer. Its purpose is to only call the underlying Writer object at fixed time intervals.

This class is useful if you only want to save every x seconds of simulation.

Constructor & Destructor Documentation

◆ FixedIntervalWriter()

alsfvm::io::FixedIntervalWriter::FixedIntervalWriter ( alsfvm::shared_ptr< Writer > &  writer,
real  timeInterval,
real  endTime,
bool  writeInitialTimestep = true,
real  startTime = 0 
)
Parameters
writerthe underlying writer to actually use.
timeIntervalthe time interval (will save for every time n*timeInterval)
endTimethe final time for the simulation.
writeInitialTimestepwrite the initial timestep
startTimethe start time to start writing

◆ ~FixedIntervalWriter()

virtual alsfvm::io::FixedIntervalWriter::~FixedIntervalWriter ( )
inlinevirtual

Member Function Documentation

◆ adjustTimestep()

real alsfvm::io::FixedIntervalWriter::adjustTimestep ( real  dt,
const simulator::TimestepInformation timestepInformation 
) const
overridevirtual

adjustTimestep returns the new timestep that the simulator should use

Parameters
dtthe current timestep being used
timestepInformationtimesteps information
Returns
the new timestep

Implements alsfvm::integrator::TimestepAdjuster.

◆ finalize()

void alsfvm::io::FixedIntervalWriter::finalize ( const grid::Grid grid,
const simulator::TimestepInformation timestepInformation 
)
overridevirtual

This method should be called at the end of the simulation.

Reimplemented from alsfvm::io::Writer.

◆ write()

void alsfvm::io::FixedIntervalWriter::write ( const volume::Volume conservedVariables,
const grid::Grid grid,
const simulator::TimestepInformation timestepInformation 
)
overridevirtual

write writes the data to disk

Parameters
conservedVariablesthe conservedVariables to write
gridthe grid that is used (describes the whole domain)
timestepInformation

Implements alsfvm::io::Writer.


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