jabble
Class FAS

java.lang.Object
  extended by jabble.Evolver
      extended by jabble.Multigrid
          extended by jabble.FAS

public abstract class FAS
extends Multigrid

Implements FAS (Full Approximation Storage).

The FAS V-Cycle algorithm

Given Lu=f, where L is a non-linear differential operator, u the unknown field and f a given field, the FAS V-Cycle algorithm is defined as:

uh = FASVCycle(uh, h, N, f h, v1, v2):

  1. If N == 2, solve Lh uh = f h and return uh.
  2. uh = Relax(uh, h, N, f h, v1);
    relax v1 times.
  3. u2h = I2huh;
    compute u for the coarser grid.
  4. f 2h = I2hf h; + Lh uh - I2hh Lh uh;
    compute f for the coarser grid.
  5. u2h = VCycle(u2h, 2h, N/2, f 2h, v1, v2);
    recursive call.
  6. uh = uh + I h2h ( u2h - I2hh uh );
    calculate and add correction.
  7. uh = Relax(uh, h, N, f h, v2);
    relax v2 times.
  8. Return uh.

where:

In the Jabble framework, this class will take care of this algorithm and rely on a first Evolver to implement the Relax for steps 2 and 7, and a second Evolver (possibly the same as the first) for the exact solution at step 1. Therefore, to use an object of this class, one will need to specify:

Other details:

The following is a sample code for a FullMultigrid class that solves the non-linear equation d2phi / dx2 + phi2 = rho :

public class NonlinearEllipticCartesianFAS extends FAS {

     public NonlinearEllipticCartesianFAS() {
         // Uses the Gauss-Seidel method for both relaxation and correct solution
         // "phi" is the Field to solve for and "rho" is the source field
         super(new NonlinearEllipticCartesianGS(), "phi", "rho");
     }

     // Fields used while computing residual and correction
     private Field phi;

     // Calculates the L operator from phi
     public double l(Point point) {
         return laplacianBulk(phi) +
             phi.at(point) * phi.at(point);
     }
 }

Reference:


Nested Class Summary
 
Nested classes/interfaces inherited from class jabble.Multigrid
Multigrid.VCycle
 
Field Summary
 
Fields inherited from class jabble.Multigrid
f, u, vCycleProlongOperator, vCycleRestrictOperator
 
Fields inherited from class jabble.Evolver
constantsMap, dDirs, fieldArrayMap, fieldMap, grid, stopTrigger
 
Constructor Summary
FAS(Evolver evolver, java.lang.String u, java.lang.String f)
           
 
Method Summary
abstract  double l(Point point)
           
 java.lang.String toString()
          The String representation of the MultiGrid evolver, which include the toString() of the wrapped evolver.
protected  void vCycleProlong(java.util.List<Slice> coarseSlices, java.util.List<Slice> fineSlices)
           
protected  void vCycleRestrict(java.util.List<Slice> coarseSlices, java.util.List<Slice> fineSlices)
           
 
Methods inherited from class jabble.Multigrid
calculateNewFields, evolve, evolve, getExactSolutionEvolver, getNIterationsExact, getNIterationsPostPrologation, getNIterationsPreRestriction, getNPreviousSlicesNeeded, getNVCycleIterations, getRelaxationEvolver, getVCycleEvolver, prolong, restrict, setNIterationsExact, setNIterationsPostPrologation, setNIterationsPreRestriction, setNVCycleIterations, setupRestrictSlices
 
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

FAS

public FAS(Evolver evolver,
           java.lang.String u,
           java.lang.String f)
Method Detail

vCycleRestrict

protected void vCycleRestrict(java.util.List<Slice> coarseSlices,
                              java.util.List<Slice> fineSlices)
Specified by:
vCycleRestrict in class Multigrid

l

public abstract double l(Point point)

vCycleProlong

protected void vCycleProlong(java.util.List<Slice> coarseSlices,
                             java.util.List<Slice> fineSlices)
Specified by:
vCycleProlong in class Multigrid

toString

public java.lang.String toString()
Description copied from class: Multigrid
The String representation of the MultiGrid evolver, which include the toString() of the wrapped evolver.

Overrides:
toString in class Multigrid
Returns:
String representation of the evolver