opale.ode
Class TimeScheme

java.lang.Object
  |
  +--opale.tools.OpaleObject
        |
        +--opale.ode.ObjectODE
              |
              +--opale.ode.TimeScheme
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ExplicitEuler, Heun, ImplicitEuler, RK, ThetaScheme

public abstract class TimeScheme
extends ObjectODE

Abstract class to represent a time scheme. One method must be definined in the sub classes : the method void forward(Equation eq) that defines the time scheme.

Since:
Opale-ODE 0.1

Constructor Summary
TimeScheme()
           
 
Method Summary
 double dt()
          Get the current time step.
 void dt(double dt)
          Set the current time step.
 double dtmax()
          Get the maximum value for the first step dt.
 void dtmax(double dtm)
          Set the maximum value for the first step dt.
 double dtmin()
          Get the minimum value for the first step dt.
 void dtmin(double dtm)
          Set the minimum value for the first step dt.
abstract  void forward(Equation eq)
          This method is abstract.
 int getNstep()
          get the number of time step.
 Problem getPb()
          Get the problem for this time scheme.
 void init()
          Initialize the resolution (memory allocation, time step computing ...).
 DVect present()
          Get the present unknown.
 int readKeyWord(java.lang.String word, java.io.StreamTokenizer f, OpaleSet ode)
          Abstract method to read a key word in a file '*.ode'.
 void set(double t0, double t1)
          Set the time interval for the study.
 void setNstep(int n)
          Set the number of time step.
 void setPb(Problem pb)
          Associated a problem to tis Time scheme.
 void setStepsizeControl(StepsizeControl s)
          Set a step control method.
 double time()
          Returns the current time..
 double tmax()
          Returns final time.
 double tmin()
          Returns the initial time.
 boolean update()
          Met à jour le calcul (incrémente le pas de temps, stocke les inconnues...).
 void write(java.io.PrintWriter f, OpaleSet ode)
          Abstrcat method to write the current object in a stream.
 
Methods inherited from class opale.tools.OpaleObject
clone, getId, read, setId
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeScheme

public TimeScheme()
Method Detail

forward

public abstract void forward(Equation eq)
This method is abstract. It takes in argument an equation and it must compute the unknown at the current time (See present()). A l'entrée dans cette méthode pour le calcul du temps n, la méthode present() renvoie l'inconnue au temps n juste précédent.
Parameters:
Equation, - a equation.

present

public final DVect present()
Get the present unknown.

WARNING : the returned instance of DVect contains :


set

public final void set(double t0,
                      double t1)
Set the time interval for the study.
Parameters:
double - t0, initial time.
double - t1, final time.

setNstep

public final void setNstep(int n)
Set the number of time step. The minimum is 3 and it is impossible to choose less.
Parameters:
int - n, number of time step.

getNstep

public final int getNstep()
get the number of time step.
Returns:
int, number of time step.

setPb

public final void setPb(Problem pb)
Associated a problem to tis Time scheme. It is not possible to solve a problem without attach it to a time scheme.
Parameters:
Problem, - a problem.

getPb

public final Problem getPb()
Get the problem for this time scheme.
Returns:
Problem.

setStepsizeControl

public final void setStepsizeControl(StepsizeControl s)
Set a step control method.
Parameters:
StepsizeControl. -  

tmin

public final double tmin()
Returns the initial time.
Returns:
double, initial time.

tmax

public final double tmax()
Returns final time.
Returns:
double, final time.

dtmax

public final double dtmax()
Get the maximum value for the first step dt.
Returns:
double, the maximum value.
Since:
Opale-ODE 0.11

dtmin

public final double dtmin()
Get the minimum value for the first step dt.
Returns:
double, the minimum value.
Since:
Opale-ODE 0.11

dtmax

public final void dtmax(double dtm)
Set the maximum value for the first step dt.
Parameters:
double, - the maximum value.
Since:
Opale-ODE 0.11

dtmin

public final void dtmin(double dtm)
Set the minimum value for the first step dt.
Parameters:
double, - the minimum value.
Since:
Opale-ODE 0.11

dt

public final double dt()
Get the current time step.
Returns:
double, the time step.

dt

public final void dt(double dt)
Set the current time step.
Parameters:
double, - the time step.

time

public final double time()
Returns the current time..
Returns:
double, the current time.

init

public void init()
Initialize the resolution (memory allocation, time step computing ...). To call necessary before a resolution.

update

public boolean update()
Met à jour le calcul (incrémente le pas de temps, stocke les inconnues...). A appeller à chaque fin de calcul d'un pas de temps OBLIGATOIREMENT.

readKeyWord

public int readKeyWord(java.lang.String word,
                       java.io.StreamTokenizer f,
                       OpaleSet ode)
                throws java.io.IOException,
                       InvalidFormatException
Description copied from class: OpaleObject
Abstract method to read a key word in a file '*.ode'.
Overrides:
readKeyWord in class OpaleObject
Following copied from class: opale.tools.OpaleObject
Parameters:
String - s, key word to read.
StreamTokenizer - f, stream to read.
OpaleSet - session, the group of 'Opale' object
Returns:
int, 0 if the key word is correct, -1 otherwise.

write

public void write(java.io.PrintWriter f,
                  OpaleSet ode)
Description copied from class: OpaleObject
Abstrcat method to write the current object in a stream.
Overrides:
write in class OpaleObject
Following copied from class: opale.tools.OpaleObject
Parameters:
printWriter - f, a stream.
OpaleSet - session, the set of 'Opale' object.