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

The CoarseGrainingIntervalWriter 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/CoarseGrainingIntervalWriter.hpp>

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

Public Member Functions

 CoarseGrainingIntervalWriter (alsfvm::shared_ptr< Writer > &writer, real timeInterval, int numberOfCoarseSaves, real endTime, int numberOfSkips)
 
virtual ~CoarseGrainingIntervalWriter ()
 
virtual void write (const volume::Volume &conservedVariables, const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation)
 write writes the data to disk More...
 
virtual real adjustTimestep (real dt, const simulator::TimestepInformation &timestepInformation) const
 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 CoarseGrainingIntervalWriter 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.

Note
this is used specifically for the coarse graining algorithm, and will save a number of timesteps around a "main" time. eg it will save

\[ T-n\Delta x, T-(n-1)\Delta x,\ldots,T-\Delta x, T, T+\Delta x,\ldots, T+n\Delta x \]

Constructor & Destructor Documentation

◆ CoarseGrainingIntervalWriter()

alsfvm::io::CoarseGrainingIntervalWriter::CoarseGrainingIntervalWriter ( alsfvm::shared_ptr< Writer > &  writer,
real  timeInterval,
int  numberOfCoarseSaves,
real  endTime,
int  numberOfSkips 
)
Parameters
writerthe underlying writer to actually use.
timeIntervalthe time interval (will save for every time n*timeInterval)
numberOfCoarseSavesthe number of saves around a time save (corresponds to $f$f in the explanation for the class)
endTimethe final time for the simulation.
numberOfSkipsthe number of timesteps to skip

◆ ~CoarseGrainingIntervalWriter()

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

Member Function Documentation

◆ adjustTimestep()

real alsfvm::io::CoarseGrainingIntervalWriter::adjustTimestep ( real  dt,
const simulator::TimestepInformation timestepInformation 
) const
virtual

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::CoarseGrainingIntervalWriter::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::CoarseGrainingIntervalWriter::write ( const volume::Volume conservedVariables,
const grid::Grid grid,
const simulator::TimestepInformation timestepInformation 
)
virtual

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: