jabble.stencils
Class FirstDerivativeStencils

java.lang.Object
  extended by jabble.stencils.FirstDerivativeStencils

public class FirstDerivativeStencils
extends java.lang.Object

Stencil library for first derivates on Fields in any dimensions.


Method Summary
static double centeredDifference(Field field, int dirIndex)
          Calculates (F(x-1) - F(x+1)) / (2 * dx).
static double dField(Field field, int dirIndex)
           
static double downwind2Difference(Field field, int dirIndex)
           
static double downwind3Difference(Field field, int dirIndex)
           
static double downwindDifference(Field field, int dirIndex)
          Calculates (F(x) - F(x-1)) / dx.
static double upwind2Difference(Field field, int dirIndex)
           
static double upwind3Difference(Field field, int dirIndex)
           
static double upwindDifference(Field field, int dirIndex)
          Calculates (F(x+1) - F(x)) / dx.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

centeredDifference

public static double centeredDifference(Field field,
                                        int dirIndex)
Calculates (F(x-1) - F(x+1)) / (2 * dx).

Parameters:
field - The Field on which to calculate the derivative
dirIndex - The direction on which to calculate the derivative
Returns:
The derivate of the Field at the point defined by StencilUtils.getPoint()

downwindDifference

public static double downwindDifference(Field field,
                                        int dirIndex)
Calculates (F(x) - F(x-1)) / dx.

Parameters:
field - The Field on which to calculate the derivative
dirIndex - The direction on which to calculate the derivative
Returns:
The derivate of the Field at the point defined by StencilUtils.getPoint()

upwindDifference

public static double upwindDifference(Field field,
                                      int dirIndex)
Calculates (F(x+1) - F(x)) / dx.

Parameters:
field - The Field on which to calculate the derivative
dirIndex - The direction on which to calculate the derivative
Returns:
The derivate of the Field at the point defined by StencilUtils.getPoint()

downwind2Difference

public static double downwind2Difference(Field field,
                                         int dirIndex)

upwind2Difference

public static double upwind2Difference(Field field,
                                       int dirIndex)

downwind3Difference

public static double downwind3Difference(Field field,
                                         int dirIndex)

upwind3Difference

public static double upwind3Difference(Field field,
                                       int dirIndex)

dField

public static double dField(Field field,
                            int dirIndex)