jabble
Class FullMultigrid

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

public abstract class FullMultigrid
extends Multigrid

Adds the linear Multigrid V-Cycle to implement FullMultigrid.

The V-Cycle algorithm

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

uh = VCycle(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. rh = f h - Lh uh;
    compute residual field.
  4. f 2h = I2hrh;
    restrict residual.
  5. u2h = 0;
    set u2h to zero, including boundary conditions.
  6. u2h = VCycle(u2h, 2h, N/2, f 2h, v1, v2);
    recursive call.
  7. uh = uh + I h2h  u2h;
    interpolate and add correction.
  8. uh = Relax(uh, h, N, f h, v2);
    relax v2 times.
  9. 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 8, 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 Poisson equation d2phi / dx2 = rho :

public class PoissonCartesianFMG extends FullMultigrid {

     // Creates FullMultigrid using PoissonCartesianGS as both the
     // relaxationEvolver and the exactSolutionEvolver.
     // "phi" is the field to be solved and "rho" is the
     // source field.
     public PoissonCartesianFMG() {
         super(new PoissonCartesianGS(), "phi", "rho");
     }

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

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

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
FullMultigrid(Evolver evolver, java.lang.String u, java.lang.String f)
          Creates a new MultiGrid evolver on top of the given evolver.
 
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

FullMultigrid

public FullMultigrid(Evolver evolver,
                     java.lang.String u,
                     java.lang.String f)
Creates a new MultiGrid evolver on top of the given evolver.

Parameters:
evolver - this evolver will be used by MultiGrid to actually solve the equations
Method Detail

l

public abstract double l(Point point)

vCycleRestrict

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

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