LORENE
|
Time evolution with full storage (*** under development ***). More...
#include <evolution.h>
Public Member Functions | |
Evolution_full (const TyT &initial_value, int initial_j=0, double initial_time=0., int fact_resize_i=2) | |
Constructor from initial value. More... | |
Evolution_full (int fact_resize_i=2) | |
Constructor without any initial value. More... | |
Evolution_full (const Evolution_full< TyT > &t_in) | |
Copy constructor. More... | |
virtual | ~Evolution_full () |
Destructor. More... | |
virtual void | update (const TyT &new_value, int j, double time_j) |
Sets a new value at a given time step. More... | |
virtual void | operator= (const Evolution_full< TyT > &t_in) |
Assignement to another Evolution_full . More... | |
virtual void | operator= (const Evolution< TyT > &t_in) |
Assignement to a generic Evolution . More... | |
void | downdate (int j) |
Suppresses a stored value. 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... | |
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 | |
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... | |
Private Attributes | |
int | fact_resize |
Factor by which the size size of the arrays val and the_time are to be multiplied when their limits have been reached. More... | |
Time evolution with full storage (*** under development ***).
()
The template class Evolution_full
has been devised to store and manipulate evolving quantities of any type, for instance TyT
= double
or TyT
= Scalar
. The quantity is stored at all time steps since the beginning of the time evolution. For large objects, this might result in some memory problem. The class Evolution_std
, which stores only a limited number of time steps, is to be prefered then.
Definition at line 270 of file evolution.h.
Lorene::Evolution_full< TyT >::Evolution_full | ( | const TyT & | initial_value, |
int | initial_j = 0 , |
||
double | initial_time = 0. , |
||
int | fact_resize_i = 2 |
||
) |
Constructor from initial value.
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 |
fact_resize_i | factor by which the size size of the arrays val and the_time are to be multiplied when their limits have been reached. |
Definition at line 95 of file evolution_full.C.
Lorene::Evolution_full< TyT >::Evolution_full | ( | int | fact_resize_i = 2 | ) |
Constructor without any initial value.
fact_resize_i | factor by which the size size of the arrays val and the_time are to be multiplied when their limits have been reached. |
Definition at line 103 of file evolution_full.C.
Lorene::Evolution_full< TyT >::Evolution_full | ( | const Evolution_full< TyT > & | t_in | ) |
Copy constructor.
Definition at line 110 of file evolution_full.C.
|
virtual |
Destructor.
Definition at line 123 of file evolution_full.C.
|
inherited |
Suppresses a stored value.
Definition at line 244 of file evolution.C.
|
inlineinherited |
Returns the member size
.
Definition at line 205 of file evolution.h.
|
inlineinherited |
Returns the time t at time step j.
Definition at line 199 of file evolution.h.
|
inherited |
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 335 of file evolution.C.
|
inherited |
Returns the larger time step j stored in *this
.
Definition at line 482 of file evolution.C.
|
inherited |
Returns the smaller time step j stored in *this
.
Definition at line 463 of file evolution.C.
|
protectedinherited |
Returns the next valid position (returns -1 if none is found)
Definition at line 302 of file evolution.C.
|
inherited |
Returns the value at time t, with a scheme of order order
.
Definition at line 370 of file evolution.C.
|
virtual |
Assignement to another Evolution_full
.
Definition at line 132 of file evolution_full.C.
|
virtual |
Assignement to a generic Evolution
.
Reimplemented from Lorene::Evolution< TyT >.
Definition at line 166 of file evolution_full.C.
|
inherited |
Returns the value at time step j.
Definition at line 360 of file evolution.C.
|
protectedinherited |
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.
|
protectedinherited |
Returns the previous valid position (returns -1 if none is found)
Definition at line 318 of file evolution.C.
|
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.
filename | name of the file: this file will be created in the working directory. |
Definition at line 589 of file evolution.C.
|
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
.
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 504 of file evolution.C.
|
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, it is increased by multiplication by fact_resize
.
Implements Lorene::Evolution< TyT >.
Definition at line 176 of file evolution_full.C.
|
private |
Factor by which the size size
of the arrays val
and the_time
are to be multiplied when their limits have been reached.
Definition at line 294 of file evolution.h.
|
protectedinherited |
Position in the arrays step
, the_time
and val
of the most evolved time step.
Definition at line 142 of file evolution.h.
|
protectedinherited |
Maximum number of stored time steps.
Definition at line 128 of file evolution.h.
|
protectedinherited |
Array of time step indices (size = size
).
Definition at line 131 of file evolution.h.
|
protectedinherited |
Array of values of t at the various time steps (size = size
).
Definition at line 134 of file evolution.h.
|
protectedinherited |
Array of pointers onto the values (size = size
).
Definition at line 137 of file evolution.h.