Lorene::Evolution_std< TyT > Class Template Reference
Time evolution (<em><strong>under development</strong></em>)

Time evolution with partial storage (*** under development ***). More...

`#include <evolution.h>`

Inheritance diagram for Lorene::Evolution_std< TyT >:

## Public Member Functions

| Evolution_std (const TyT &initial_value, int nstored, int initial_j=0, double initial_time=0.)
| Constructor from initial value.
| Evolution_std (int nstored)
| Constructor without any initial value.
| Evolution_std (const Evolution_std< TyT > &t_in)
| Copy constructor.
virtual | ~Evolution_std ()
| Destructor.
virtual void | update (const TyT &new_value, int j, double time_j)
| Sets a new value at a given time step.
virtual void | operator= (const Evolution_std< TyT > &t_in)
| Assignement to another `Evolution_std`.
virtual void | operator= (const Evolution< TyT > &t_in)
| Assignement to a generic `Evolution`.
void | downdate (int j)
| Suppresses a stored value.
const TyT & | operator[] (int j) const
| Returns the value at time step j.
double | get_time (int j) const
| Returns the time t at time step j.
TyT | operator() (double t, int order=2) const
| Returns the value at time t, with a scheme of order `order`.
int | get_size () const
| Returns the member `size`.
int | j_min () const
| Returns the smaller time step j stored in `*this`.
int | j_max () const
| Returns the larger time step j stored in `*this`.
bool | is_known (int j) const
| Checks whether the value a given time step has been set.
TyT | time_derive (int j, int n=2) const
| Computes the time derivative at time step `j` by means of a n-th order scheme, from the values at steps `j`, `j-1`, ..., `j-n`.
void | save (const char *filename) const
| Saves `*this` in a formatted file.

## Protected Member Functions

int | position (int j) const
| Gives the position in the arrays `step`, `the_time` and `val` corresponding to the time step j.
int | next_position (int i) const
| Returns the next valid position (returns -1 if none is found).
int | previous_position (int i) const
| Returns the previous valid position (returns -1 if none is found).

## Protected Attributes

int | size
| Maximum number of stored time steps.
int * | step
| Array of time step indices (size = `size`).
double * | the_time
| Array of values of t at the various time steps (size = `size`).
TyT ** | val
| Array of pointers onto the values (size = `size`).
int | pos_jtop
| Position in the arrays `step`, `the_time` and `val` of the most evolved time step.

## Detailed Description

template<typename TyT>
class Lorene::Evolution_std< TyT >

Time evolution with partial storage (*** under development ***).

()

The template class `Evolution_std` has been devised to store and manipulate evolving quantities of any type, for instance `TyT` = `double` or `TyT` = `Scalar`. The quantity is stored only for a limited number of time steps (the n last ones). For a full storage, use instead the class `Evolution_full`.

Definition at line 371 of file evolution.h.

## Constructor & Destructor Documentation

## Evolution_std() [1/3]

template<typename TyT>

Lorene::Evolution_std< TyT >::Evolution_std | ( | const TyT & | initial_value,
|  | int | nstored,
|  | int | initial_j = 0,
|  | double | initial_time = 0. )

Constructor from initial value.

Parameters

  initial_value | value to be stored at time step `initial_j`
  initial_j | index `j` of first time step to be stored
  initial_time | time t corresponding to time step `initial_j`
  nstored | total number of time steps to be stored

Definition at line 93 of file evolution_std.C.

References Lorene::Evolution< TyT >::Evolution().

## Evolution_std() [2/3]

template<typename TyT>

Lorene::Evolution_std< TyT >::Evolution_std | ( | int | nstored | ) |

Constructor without any initial value.

Parameters

  nstored | total number of time steps to be stored

Definition at line 100 of file evolution_std.C.

References Lorene::Evolution< TyT >::Evolution().

## Evolution_std() [3/3]

template<typename TyT>

Lorene::Evolution_std< TyT >::Evolution_std | ( | const Evolution_std< TyT > & | t_in | ) |

Copy constructor.

Definition at line 106 of file evolution_std.C.

References Lorene::Evolution< TyT >::Evolution(), and Evolution_std().

## ~Evolution_std()

template<typename TyT>

Lorene::Evolution_std< TyT >::~Evolution_std | ( |  | ) |

virtual

Destructor.

Definition at line 119 of file evolution_std.C.

## Member Function Documentation

## downdate()

template<typename TyT>

void Lorene::Evolution< TyT >::downdate | ( | int | j | ) |

inherited

Suppresses a stored value.

Definition at line 244 of file evolution.C.

References is_known().

## get_size()

template<typename TyT>

int Lorene::Evolution< TyT >::get_size | ( |  | ) | const

inline inherited

Returns the member `size`.

Definition at line 205 of file evolution.h.

References size.

## get_time()

template<typename TyT>

double Lorene::Evolution< TyT >::get_time | ( | int | j | ) | const

inline inherited

Returns the time t at time step j.

Definition at line 199 of file evolution.h.

References position(), and the_time.

## is_known()

template<typename TyT>

bool Lorene::Evolution< TyT >::is_known | ( | int | j | ) | const

inherited

Checks whether the value a given time step has been set.

Parameters

  j | time step index

Returns
  `true` if the value at time step j is known, `false` otherwise

Definition at line 335 of file evolution.C.

References pos_jtop, step, and val.

## j_max()

template<typename TyT>

int Lorene::Evolution< TyT >::j_max | ( |  | ) | const

inherited

Returns the larger time step j stored in `*this`.

Definition at line 482 of file evolution.C.

References pos_jtop, and step.

## j_min()

template<typename TyT>

int Lorene::Evolution< TyT >::j_min | ( |  | ) | const

inherited

Returns the smaller time step j stored in `*this`.

Definition at line 463 of file evolution.C.

References pos_jtop, and step.

## next_position()

template<typename TyT>

int Lorene::Evolution< TyT >::next_position | ( | int | i | ) | const

protected inherited

Returns the next valid position (returns -1 if none is found).

Definition at line 302 of file evolution.C.

References pos_jtop, and step.

## operator()()

template<typename TyT>

TyT Lorene::Evolution< TyT >::operator() | ( | double | t,
|  | int | order = 2 ) const

inherited

Returns the value at time t, with a scheme of order `order`.

Definition at line 370 of file evolution.C.

References j_min(), next_position(), pos_jtop, position(), previous_position(), the_time, and val.

## operator=() [1/2]

template<typename TyT>

void Lorene::Evolution_std< TyT >::operator= | ( | const Evolution< TyT > & | t_in | ) |

virtual

Assignement to a generic `Evolution`.

Reimplemented from Lorene::Evolution< TyT >.

Definition at line 161 of file evolution_std.C.

References Lorene::Evolution< TyT >::Evolution().

## operator=() [2/2]

template<typename TyT>

void Lorene::Evolution_std< TyT >::operator= | ( | const Evolution_std< TyT > & | t_in | ) |

virtual

Assignement to another `Evolution_std`.

Definition at line 129 of file evolution_std.C.

References Evolution_std(), Lorene::Evolution< TyT >::pos_jtop, Lorene::Evolution< TyT >::size, Lorene::Evolution< TyT >::step, Lorene::Evolution< TyT >::the_time, and Lorene::Evolution< TyT >::val.

## operator[]()

template<typename TyT>

const TyT & Lorene::Evolution< TyT >::operator[] | ( | int | j | ) | const

inherited

Returns the value at time step j.

Definition at line 360 of file evolution.C.

References position(), and val.

## position()

template<typename TyT>

int Lorene::Evolution< TyT >::position | ( | int | j | ) | const

protected inherited

Gives the position in the arrays `step`, `the_time` and `val` corresponding to the time step j.

Definition at line 273 of file evolution.C.

References pos_jtop, and step.

## previous_position()

template<typename TyT>

int Lorene::Evolution< TyT >::previous_position | ( | int | i | ) | const

protected inherited

Returns the previous valid position (returns -1 if none is found).

Definition at line 318 of file evolution.C.

References pos_jtop, and step.

## save()

template<typename TyT>

void Lorene::Evolution< TyT >::save | ( | const char * | filename | ) | const

inherited

Saves `*this` in a formatted file.

If `TyT` = `double`, this file is readable by 2-D plotting software (e.g. Xmgrace) to produce a curve of the time evolution.

Parameters

  filename | name of the file: this file will be created in the working directory.

Definition at line 589 of file evolution.C.

References pos_jtop, size, step, the_time, and val.

## time_derive()

template<typename TyT>

TyT Lorene::Evolution< TyT >::time_derive | ( | int | j,
|  | int | n = 2 ) const

inherited

Computes the time derivative at time step `j` by means of a n-th order scheme, from the values at steps `j`, `j-1`, ..., `j-n`.

Parameters

  j | [input] : value of the time step at which the time derivative is required
  n | [input] : order of the time scheme (default value=2); if n=0, then the `Evolution` is considered to be stationary and a null value is returned.

Returns
  time derivative at time step `j`

Definition at line 504 of file evolution.C.

References operator[](), position(), step, the_time, and val.

## update()

template<typename TyT>

void Lorene::Evolution_std< TyT >::update | ( | const TyT & | new_value,
|  | int | j,
|  | double | time_j )

virtual

Sets a new value at a given time step.

If the size of the arrays of stored values (members `step`, `the_time`, `val`) is not sufficient, this method suppresses the oldest stored value.

Implements Lorene::Evolution< TyT >.

Definition at line 171 of file evolution_std.C.

References Lorene::Evolution< TyT >::is_known(), Lorene::Evolution< TyT >::pos_jtop, Lorene::Evolution< TyT >::position(), Lorene::Evolution< TyT >::size, Lorene::Evolution< TyT >::step, Lorene::Evolution< TyT >::the_time, and Lorene::Evolution< TyT >::val.

## Member Data Documentation

## pos_jtop

template<typename TyT>

int Lorene::Evolution< TyT >::pos_jtop

protected inherited

Position in the arrays `step`, `the_time` and `val` of the most evolved time step.

Definition at line 142 of file evolution.h.

## size

template<typename TyT>

int Lorene::Evolution< TyT >::size

protected inherited

Maximum number of stored time steps.

Definition at line 128 of file evolution.h.

## step

template<typename TyT>

int* Lorene::Evolution< TyT >::step

protected inherited

Array of time step indices (size = `size`).

Definition at line 131 of file evolution.h.

## the_time

template<typename TyT>

double* Lorene::Evolution< TyT >::the_time

protected inherited

Array of values of t at the various time steps (size = `size`).

Definition at line 134 of file evolution.h.

## val

template<typename TyT>

TyT** Lorene::Evolution< TyT >::val

protected inherited

Array of pointers onto the values (size = `size`).

Definition at line 137 of file evolution.h.

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

- evolution.h
- evolution_std.C