|
LORENE
|
Time evolution. More...
#include <evolution.h>
Public Member Functions | |
| virtual | ~Evolution () |
| Destructor. More... | |
| virtual void | update (const TyT &new_value, int j, double time_j)=0 |
| Sets a new value at a given time step. More... | |
| void | downdate (int j) |
| Suppresses a stored value. More... | |
| virtual void | operator= (const Evolution< TyT > &t_in) |
| Assignement. More... | |
| const TyT & | operator[] (int j) const |
| Returns the value at time step j. More... | |
| double | get_time (int j) const |
| Returns the time t at time step j. More... | |
| TyT | operator() (double t, int order=2) const |
Returns the value at time t, with a scheme of order order. More... | |
| TyT | extrapolate (double t, int order=1) const |
Returns the extrapolated value, with a scheme of order order. More... | |
| int | get_size () const |
Returns the member size. More... | |
| int | j_min () const |
Returns the smaller time step j stored in *this. More... | |
| int | j_max () const |
Returns the larger time step j stored in *this. More... | |
| bool | is_known (int j) const |
| Checks whether the value a given time step has been set. More... | |
| 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. More... | |
| void | save (const char *filename) const |
Saves *this in a formatted file. More... | |
Protected Member Functions | |
| Evolution (const TyT &initial_value, int initial_j, double initial_time, int initial_size) | |
| Constructor from some initial value. More... | |
| Evolution (int initial_size) | |
| Constructor without any initial value. More... | |
| Evolution (const Evolution< TyT > &t_in) | |
| Copy constructor. More... | |
| int | position (int j) const |
Gives the position in the arrays step, the_time and val corresponding to the time step j. More... | |
| int | next_position (int i) const |
| Returns the next valid position (returns -1 if none is found) More... | |
| int | previous_position (int i) const |
| Returns the previous valid position (returns -1 if none is found) More... | |
Protected Attributes | |
| int | size |
| Maximum number of stored time steps. More... | |
| int * | step |
Array of time step indices (size = size). More... | |
| double * | the_time |
Array of values of t at the various time steps (size = size). More... | |
| TyT ** | val |
Array of pointers onto the values (size = size). More... | |
| int | pos_jtop |
Position in the arrays step, the_time and val of the most evolved time step. More... | |
Time evolution.
()
The template class Evolution has been devised to store and manipulate evolving quantities of any type, for instance TyT = double or TyT = Scalar.
Evolution is an abstract base class for classes Evolution_full and Evolution_std.
Definition at line 123 of file evolution.h.
|
protected |
Constructor from some initial value.
Definition at line 131 of file evolution.C.
|
protected |
Constructor without any initial value.
Definition at line 158 of file evolution.C.
|
protected |
Copy constructor.
Definition at line 182 of file evolution.C.
|
virtual |
Destructor.
Definition at line 218 of file evolution.C.
| void Lorene::Evolution< TyT >::downdate | ( | int | j | ) |
Suppresses a stored value.
Definition at line 248 of file evolution.C.
| TyT Lorene::Evolution< TyT >::extrapolate | ( | double | t, |
| int | order = 1 |
||
| ) | const |
Returns the extrapolated value, with a scheme of order order.
Definition at line 467 of file evolution.C.
|
inline |
Returns the member size.
Definition at line 211 of file evolution.h.
|
inline |
Returns the time t at time step j.
Definition at line 202 of file evolution.h.
| bool Lorene::Evolution< TyT >::is_known | ( | int | j | ) | const |
Checks whether the value a given time step has been set.
| j | time step index |
true if the value at time step j is known, false otherwise Definition at line 339 of file evolution.C.
| int Lorene::Evolution< TyT >::j_max | ( | ) | const |
Returns the larger time step j stored in *this.
Definition at line 564 of file evolution.C.
| int Lorene::Evolution< TyT >::j_min | ( | ) | const |
Returns the smaller time step j stored in *this.
Definition at line 545 of file evolution.C.
|
protected |
Returns the next valid position (returns -1 if none is found)
Definition at line 306 of file evolution.C.
| TyT Lorene::Evolution< TyT >::operator() | ( | double | t, |
| int | order = 2 |
||
| ) | const |
Returns the value at time t, with a scheme of order order.
Definition at line 374 of file evolution.C.
|
virtual |
Assignement.
Reimplemented in Lorene::Evolution_std< TyT >, Lorene::Evolution_std< Lorene::Sym_tensor >, Lorene::Evolution_std< double >, Lorene::Evolution_std< Lorene::Scalar >, Lorene::Evolution_std< Lorene::Vector >, Lorene::Evolution_full< TyT >, and Lorene::Evolution_full< Lorene::Tbl >.
Definition at line 239 of file evolution.C.
| const TyT & Lorene::Evolution< TyT >::operator[] | ( | int | j | ) | const |
Returns the value at time step j.
Definition at line 364 of file evolution.C.
|
protected |
Gives the position in the arrays step, the_time and val corresponding to the time step j.
Definition at line 277 of file evolution.C.
|
protected |
Returns the previous valid position (returns -1 if none is found)
Definition at line 322 of file evolution.C.
| void Lorene::Evolution< TyT >::save | ( | const char * | filename | ) | const |
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.
| filename | name of the file: this file will be created in the working directory. |
Definition at line 671 of file evolution.C.
| TyT Lorene::Evolution< 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.
| 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. |
j Definition at line 586 of file evolution.C.
|
pure virtual |
Sets a new value at a given time step.
Implemented in Lorene::Evolution_std< TyT >, Lorene::Evolution_std< Lorene::Sym_tensor >, Lorene::Evolution_std< double >, Lorene::Evolution_std< Lorene::Scalar >, Lorene::Evolution_std< Lorene::Vector >, Lorene::Evolution_full< TyT >, and Lorene::Evolution_full< Lorene::Tbl >.
|
protected |
Position in the arrays step, the_time and val of the most evolved time step.
Definition at line 145 of file evolution.h.
|
protected |
Maximum number of stored time steps.
Definition at line 131 of file evolution.h.
|
protected |
Array of time step indices (size = size).
Definition at line 134 of file evolution.h.
|
protected |
Array of values of t at the various time steps (size = size).
Definition at line 137 of file evolution.h.
|
protected |
Array of pointers onto the values (size = size).
Definition at line 140 of file evolution.h.