Lorene::Evolution< TyT > Class Template Reference
[Time evolution (under development)]

Time evolution (*** under development ***). More...

#include <evolution.h>

Inheritance diagram for Lorene::Evolution< TyT >:
Lorene::Evolution_full< TyT > Lorene::Evolution_std< TyT >

List of all members.

Public Member Functions

virtual ~Evolution ()
 Destructor.
virtual void update (const TyT &new_value, int j, double time_j)=0
 Sets a new value at a given time step.
void downdate (int j)
 Suppresses a stored value.
virtual void operator= (const Evolution< TyT > &t_in)
 Assignement.
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, .
void save (const char *filename) const
 Saves *this in a formatted file.

Protected Member Functions

 Evolution (const TyT &initial_value, int initial_j, double initial_time, int initial_size)
 Constructor from some initial value.
 Evolution (int initial_size)
 Constructor without any initial value.
 Evolution (const Evolution< TyT > &t_in)
 Copy constructor.
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< TyT >

Time evolution (*** under development ***).

()

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 120 of file evolution.h.


Constructor & Destructor Documentation

template<typename TyT>
Lorene::Evolution< TyT >::Evolution ( const TyT &  initial_value,
int  initial_j,
double  initial_time,
int  initial_size 
) [inline, protected]
template<typename TyT>
Lorene::Evolution< TyT >::Evolution ( int  initial_size  )  [inline, protected]

Constructor without any initial value.

Definition at line 154 of file evolution.C.

References Lorene::Evolution< TyT >::size, Lorene::Evolution< TyT >::step, Lorene::Evolution< TyT >::the_time, and Lorene::Evolution< TyT >::val.

template<typename TyT>
Lorene::Evolution< TyT >::Evolution ( const Evolution< TyT > &  t_in  )  [inline, protected]
template<typename TyT >
Lorene::Evolution< TyT >::~Evolution (  )  [inline, virtual]

Member Function Documentation

template<typename TyT >
void Lorene::Evolution< TyT >::downdate ( int  j  )  [inline]
template<typename TyT>
int Lorene::Evolution< TyT >::get_size (  )  const [inline]

Returns the member size.

Definition at line 205 of file evolution.h.

template<typename TyT>
double Lorene::Evolution< TyT >::get_time ( int  j  )  const [inline]

Returns the time t at time step j.

Definition at line 199 of file evolution.h.

template<typename TyT >
bool Lorene::Evolution< TyT >::is_known ( int  j  )  const [inline]

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 Lorene::Evolution< TyT >::pos_jtop, Lorene::Evolution< TyT >::step, and Lorene::Evolution< TyT >::val.

template<typename TyT >
int Lorene::Evolution< TyT >::j_max (  )  const [inline]

Returns the larger time step j stored in *this.

Definition at line 482 of file evolution.C.

References Lorene::Evolution< TyT >::pos_jtop, and Lorene::Evolution< TyT >::step.

template<typename TyT >
int Lorene::Evolution< TyT >::j_min (  )  const [inline]

Returns the smaller time step j stored in *this.

Definition at line 463 of file evolution.C.

References Lorene::Evolution< TyT >::pos_jtop, and Lorene::Evolution< TyT >::step.

template<typename TyT >
int Lorene::Evolution< TyT >::next_position ( int  i  )  const [inline, protected]

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

Definition at line 302 of file evolution.C.

References Lorene::Evolution< TyT >::pos_jtop, and Lorene::Evolution< TyT >::step.

template<typename TyT >
TyT Lorene::Evolution< TyT >::operator() ( double  t,
int  order = 2 
) const [inline]
template<typename TyT>
void Lorene::Evolution< TyT >::operator= ( const Evolution< TyT > &  t_in  )  [inline, virtual]
template<typename TyT >
const TyT & Lorene::Evolution< TyT >::operator[] ( int  j  )  const [inline]

Returns the value at time step j.

Definition at line 360 of file evolution.C.

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

template<typename TyT >
int Lorene::Evolution< TyT >::position ( int  j  )  const [inline, protected]

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 Lorene::Evolution< TyT >::pos_jtop, and Lorene::Evolution< TyT >::step.

template<typename TyT >
int Lorene::Evolution< TyT >::previous_position ( int  i  )  const [inline, protected]

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

Definition at line 318 of file evolution.C.

References Lorene::Evolution< TyT >::pos_jtop, and Lorene::Evolution< TyT >::step.

template<typename TyT >
void Lorene::Evolution< TyT >::save ( const char *  filename  )  const [inline]

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 Lorene::Evolution< TyT >::pos_jtop, Lorene::Evolution< TyT >::size, Lorene::Evolution< TyT >::step, Lorene::Evolution< TyT >::the_time, and Lorene::Evolution< TyT >::val.

template<typename TyT >
TyT Lorene::Evolution< TyT >::time_derive ( int  j,
int  n = 2 
) const [inline]

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 Lorene::Evolution< TyT >::operator[](), Lorene::Evolution< TyT >::position(), Lorene::Evolution< TyT >::step, Lorene::Evolution< TyT >::the_time, and Lorene::Evolution< TyT >::val.

template<typename TyT>
virtual void Lorene::Evolution< TyT >::update ( const TyT &  new_value,
int  j,
double  time_j 
) [pure virtual]

Member Data Documentation

template<typename TyT>
int Lorene::Evolution< TyT >::pos_jtop [protected]

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

Definition at line 142 of file evolution.h.

template<typename TyT>
int Lorene::Evolution< TyT >::size [protected]

Maximum number of stored time steps.

Definition at line 128 of file evolution.h.

template<typename TyT>
int* Lorene::Evolution< TyT >::step [protected]

Array of time step indices (size = size).

Definition at line 131 of file evolution.h.

template<typename TyT>
double* Lorene::Evolution< TyT >::the_time [protected]

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

Definition at line 134 of file evolution.h.

template<typename TyT>
TyT** Lorene::Evolution< TyT >::val [protected]

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:

Generated on 7 Dec 2019 for LORENE by  doxygen 1.6.1