TimeSeries

class dolfin.cpp.fem.TimeSeries(*args)

Bases: dolfin.cpp.common.Variable

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.

Create empty time series

Arguments
name (str)
The time series name
compressed (bool)
Use compressed file format (default false)
store_connectivity (bool)
Store all computed connectivity (default false)
clear()

Clear time series

static default_parameters()

Default parameter values

static filename_data(*args)

Return filename for data

Arguments
series_name (str)
The time series name
type_name (str)
The type of data
index (int)
The index
compressed (bool)
True if compressed file format
Returns
str
The filename
static filename_times(*args)

Return filename for times

Arguments
series_name (str)
The time series name
type_name (str)
The type of data
compressed (bool)
True if compressed file format
Returns
str
The filename
mesh_times()

Return array of sample times for meshes

Returns
numpy.array(float)
The times.
retrieve()

Overloaded versions

  • retrieve(vector, t, interpolate=true)

    Retrieve vector at given time

    Arguments
    vector (GenericVector)

    The vector (values to be retrieved).

    t (float)

    The time.

    interpolate (bool)

    Optional argument: If true (default), interpolate time samples closest to t if t is not present.

  • retrieve(mesh, t)

    Retrieve mesh at given time

    Arguments
    mesh (Mesh)

    The mesh (values to be retrieved).

    t (float)

    The time.

store()

Overloaded versions

  • store(vector, t)

    Store vector at given time

    Arguments
    vector (GenericVector)

    The vector to be stored.

    t (float)

    The time.

  • store(mesh, t)

    Store mesh at given time

    Arguments
    mesh (Mesh)

    The mesh to be stored.

    t (float)

    The time.

thisown

The membership flag

vector_times()

Return array of sample times for vectors

Returns
numpy.array(float)
The times.