jabble.stencils
Class SecondDerivativeStencils

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

public class SecondDerivativeStencils
extends java.lang.Object

Stencil library for second derivates on Fields in any dimensions.


Method Summary
static double d2FieldBulk(Field field, int dirIndex)
          Calculates (F(x+1) - 2*F(x) + F(x-1)) / dx2.
static double d2FieldLowerBoundary(Field field, int dirIndex)
          Calculates (2*F(x) - 5*F(x+1) + 4*F(x+2) - F(x+3)) / dx2.
static double d2FieldMixedBulk(Field field, int dirIndex1, int dirIndex2)
          Calculates mixed second derivative using a nine-point stencil (F(x+1, y+1) - F(x+1, y-1) - F(x-1, y+1) + F(x-1, y-1) / dx*dy.
static double d2FieldUpperBoundary(Field field, int dirIndex)
          Calculates (2*F(x) - 5*F(x-1) + 4*F(x-2) - F(x-3)) / dx2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

d2FieldBulk

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

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()

d2FieldMixedBulk

public static double d2FieldMixedBulk(Field field,
                                      int dirIndex1,
                                      int dirIndex2)
Calculates mixed second derivative using a nine-point stencil (F(x+1, y+1) - F(x+1, y-1) - F(x-1, y+1) + F(x-1, y-1) / dx*dy.

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

d2FieldUpperBoundary

public static double d2FieldUpperBoundary(Field field,
                                          int dirIndex)
Calculates (2*F(x) - 5*F(x-1) + 4*F(x-2) - F(x-3)) / dx2.

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()

d2FieldLowerBoundary

public static double d2FieldLowerBoundary(Field field,
                                          int dirIndex)
Calculates (2*F(x) - 5*F(x+1) + 4*F(x+2) - F(x+3)) / dx2.

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()