jabble
Class Multigrid.VCycle

java.lang.Object
  extended by jabble.Evolver
      extended by jabble.Multigrid.VCycle
Enclosing class:
Multigrid

public class Multigrid.VCycle
extends Evolver


Field Summary
 
Fields inherited from class jabble.Evolver
constantsMap, dDirs, fieldArrayMap, fieldMap, grid, stopTrigger
 
Constructor Summary
Multigrid.VCycle()
           
 
Method Summary
protected  void calculateNewFields()
          Implements the multi grid method.
 void evolve(java.util.List<Slice> slices)
          Evolves the data in the list of slices of one time step.
 int evolve(java.util.List<Slice> slices, int maxIterations, Trigger stopTrigger)
          Evolves the slices using multi grid methods and the evolver given through the constructor.
 int getNPreviousSlicesNeeded()
          The number of slices needed by MultiGrid is the same number of slices needed by the evolver.
 java.lang.String toString()
          The String representation of the MultiGrid evolver, which include the toString() of the wrapped evolver.
 
Methods inherited from class jabble.Evolver
evolve, initializeFieldArray, initializeFieldArray, skipBoundaryPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Multigrid.VCycle

public Multigrid.VCycle()
Method Detail

getNPreviousSlicesNeeded

public int getNPreviousSlicesNeeded()
The number of slices needed by MultiGrid is the same number of slices needed by the evolver.

Overrides:
getNPreviousSlicesNeeded in class Evolver
Returns:
the slices needed by the evolver

evolve

public void evolve(java.util.List<Slice> slices)
Description copied from class: Evolver
Evolves the data in the list of slices of one time step.

An EllipticSolver will work by continuing to refine the solution at each iteration over the Grid. At each iteration, the solver will determine what was the best improvement (that is F[n](P) - F[n-1](P)) and if it's less than the truncation error it will return. The solver will not go past the maxIterations limit.

The solver will return the solution by modifying the data contained in the Slice, or by removing and adding Fields accordingly.

Overrides:
evolve in class Evolver
Parameters:
slices - The slices containing the data to work on; first slice is the most recent in time of iterations performed by the solver.

evolve

public int evolve(java.util.List<Slice> slices,
                  int maxIterations,
                  Trigger stopTrigger)
Evolves the slices using multi grid methods and the evolver given through the constructor.

Overrides:
evolve in class Evolver
Parameters:
slices - the slices with the data to evolve
maxIterations - the maximum number of iterations (on any grid)
stopTrigger - stop condition for the evolver
Returns:
the number of iteration actually performed

calculateNewFields

protected void calculateNewFields()
Implements the multi grid method.

Specified by:
calculateNewFields in class Evolver

toString

public java.lang.String toString()
The String representation of the MultiGrid evolver, which include the toString() of the wrapped evolver.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the evolver