opale.ode
Class Problem

java.lang.Object
  |
  +--opale.tools.OpaleObject
        |
        +--opale.ode.ObjectODE
              |
              +--opale.ode.Problem
All Implemented Interfaces:
java.lang.Cloneable

public final class Problem
extends ObjectODE

This class represents an ODE problem. An instance of this class must be associated (UML sens) to an instance of th class TimeScheme and to an instance of Equation.

The method solve() runs the resolution of the problem

Since:
Opale-ODE 0.1

Field Summary
 boolean PRINT
           
 
Constructor Summary
Problem()
          Initialize an one dimensional problem.
Problem(int dim)
          Constructs a problem with a given dimension.
 
Method Summary
 int dim()
          get the dimension problem.
 Equation getEqn()
          Returns the equation of this problem.
 DVect getInit()
          Returns the initial condition.
 int getNStep()
          Returns the number of step computed, -1 if the problem is not solved.
 TimeScheme getTS()
          Get the time scheme of this problem.
 java.lang.String printSol()
          Get the solution in a formatted String.
 int readKeyWord(java.lang.String word, java.io.StreamTokenizer f, OpaleSet ode)
          Read a problem in a File
 void setEqn(Equation eq)
          Associate an equation to this problem.
 void setInit(DVect init)
          Set the initial condition.
 void setTS(TimeScheme sch)
          Set a time scheme for the resolution of this problem.
 void solve()
          Runs the resolution after verifying all the elments (time schem, equation...).
 double[][] toArray()
          Get the solution in two dimensionnal array of double tab[dim+1][N+1].
 java.lang.String toString()
          Return the string "Problem of ODE".
 double[][] toTab()
          Get the solution in two dimensionnal array of double tab[dim+1][N+1].
 void write(java.io.PrintWriter f, OpaleSet ode)
          Write a problem in a text file.
 void writeSol(WFile wf)
           
 
Methods inherited from class opale.tools.OpaleObject
clone, getId, read, setId
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRINT

public final boolean PRINT
Constructor Detail

Problem

public Problem()
Initialize an one dimensional problem.

Problem

public Problem(int dim)
Constructs a problem with a given dimension.
Parameters:
int - dim, la dimension du problème.
Method Detail

solve

public void solve()
Runs the resolution after verifying all the elments (time schem, equation...).

printSol

public java.lang.String printSol()
Get the solution in a formatted String. The first column is the time, and the others the values x, y, z of the solution
Returns:
String, the solution.

toTab

public double[][] toTab()
Get the solution in two dimensionnal array of double tab[dim+1][N+1].
dim is the dimension of the problem ; N is the number of time step.
t[0][j],0 <= j <= N represent the time steps ; t[i>=1][j],0 <= j <= N represent the composants of the solution.
Returns:
double[][], the solution , null if the problem is not solved.

toArray

public double[][] toArray()
Get the solution in two dimensionnal array of double tab[dim+1][N+1].
dim is the dimension of the problem ; N is the number of time step.
t[0][j],0 <= j <= N represent the time steps ; t[i>=1][j],0 <= j <= N represent the composants of the solution.
Returns:
double[][], the solution , null if the problem is not solved.
Since:
Opale-ode 0.13

writeSol

public void writeSol(WFile wf)

dim

public int dim()
get the dimension problem.
Returns:
int, the dimension.

setInit

public void setInit(DVect init)
Set the initial condition.
Parameters:
DVect, - the vector for the initial condition.

getInit

public DVect getInit()
Returns the initial condition.
Returns:
DVect, a vector.

getNStep

public int getNStep()
Returns the number of step computed, -1 if the problem is not solved.
Returns:
int
Since:
Opale-ODE 0.12.

setEqn

public void setEqn(Equation eq)
Associate an equation to this problem. The method verifies if the equation and the problem have same dimension.
Parameters:
Equation, - an equation.

getEqn

public Equation getEqn()
Returns the equation of this problem.
Returns:
Equation, the equation.

setTS

public void setTS(TimeScheme sch)
Set a time scheme for the resolution of this problem.
Parameters:
TimeScheme, - a time scheme.

getTS

public TimeScheme getTS()
Get the time scheme of this problem.
Returns:
TimeScheme, the time scheme.

readKeyWord

public int readKeyWord(java.lang.String word,
                       java.io.StreamTokenizer f,
                       OpaleSet ode)
                throws java.io.IOException,
                       InvalidFormatException
Read a problem in a File
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)
           throws InvalidFormatException
Write a problem in a text file.
Overrides:
write in class OpaleObject
Following copied from class: opale.tools.OpaleObject
Parameters:
printWriter - f, a stream.
OpaleSet - session, the set of 'Opale' object.

toString

public java.lang.String toString()
Return the string "Problem of ODE". Not very interesting !!
Overrides:
toString in class java.lang.Object