DOLFIN
DOLFIN C++ interface
Public Member Functions | Static Public Member Functions | List of all members
dolfin::TimeSeries Class Reference

#include <TimeSeries.h>

Inheritance diagram for dolfin::TimeSeries:
Inheritance graph
[legend]
Collaboration diagram for dolfin::TimeSeries:
Collaboration graph
[legend]

Public Member Functions

 TimeSeries (std::string name)
 
 TimeSeries (MPI_Comm mpi_comm, std::string name)
 
 ~TimeSeries ()
 Destructor.
 
void store (const GenericVector &vector, double t)
 
void store (const Mesh &mesh, double t)
 
void retrieve (GenericVector &vector, double t, bool interpolate=true) const
 
void retrieve (Mesh &mesh, double t) const
 
std::vector< double > vector_times () const
 
std::vector< double > mesh_times () const
 
void clear ()
 Clear time series.
 
std::string str (bool verbose) const
 Return informal string representation (pretty-print)
 
- Public Member Functions inherited from dolfin::Variable
 Variable ()
 Create unnamed variable.
 
 Variable (const std::string name, const std::string label)
 Create variable with given name and label.
 
 Variable (const Variable &variable)
 Copy constructor.
 
virtual ~Variable ()
 Destructor.
 
const Variableoperator= (const Variable &variable)
 Assignment operator.
 
void rename (const std::string name, const std::string label)
 Rename variable.
 
std::string name () const
 Return name.
 
std::string label () const
 Return label (description)
 
std::size_t id () const
 

Static Public Member Functions

static Parameters default_parameters ()
 Default parameter values.
 

Additional Inherited Members

- Public Attributes inherited from dolfin::Variable
Parameters parameters
 Parameters.
 

Detailed Description

This class stores a time series of objects to file(s) in a binary format which is efficient for reading and writing.

When objects are retrieved, the object stored at the time closest to the given time will be used.

A new time series will check if values have been stored to file before (for a series with the same name) and in that case reuse those values. If new values are stored, old values will be cleared.

Constructor & Destructor Documentation

◆ TimeSeries() [1/2]

dolfin::TimeSeries::TimeSeries ( std::string  name)
inline

Create empty time series

Arguments mpi_comm (MPI_Comm) An MPI communicator name (std::string) The time series name

◆ TimeSeries() [2/2]

TimeSeries::TimeSeries ( MPI_Comm  mpi_comm,
std::string  name 
)

Create empty time series

Arguments mpi_comm (MPI_Comm) An MPI communicator name (std::string) The time series name

Member Function Documentation

◆ mesh_times()

std::vector< double > TimeSeries::mesh_times ( ) const

Return array of sample times for meshes

Returns std::vector<double> The times.

◆ retrieve() [1/2]

void TimeSeries::retrieve ( GenericVector vector,
double  t,
bool  interpolate = true 
) const

Retrieve vector at given time

Arguments vector (GenericVector) The vector (values to be retrieved). t (double) The time. interpolate (bool) Optional argument: If true (default), interpolate time samples closest to t if t is not present.

◆ retrieve() [2/2]

void TimeSeries::retrieve ( Mesh mesh,
double  t 
) const

Retrieve mesh at given time

Arguments mesh (Mesh) The mesh (values to be retrieved). t (double) The time.

◆ store() [1/2]

void TimeSeries::store ( const GenericVector vector,
double  t 
)

Store vector at given time

Arguments vector (GenericVector) The vector to be stored. t (double) The time.

◆ store() [2/2]

void TimeSeries::store ( const Mesh mesh,
double  t 
)

Store mesh at given time

Arguments mesh (Mesh) The mesh to be stored. t (double) The time.

◆ vector_times()

std::vector< double > TimeSeries::vector_times ( ) const

Return array of sample times for vectors

Returns std::vector<double> The times.


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