jabble.stencils
Class Average1DStencils

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

public class Average1DStencils
extends java.lang.Object

Stencil library for averages on Fields in 1D grids.


Method Summary
static double downwindAverage(Field field)
          Calculates (F(x) + F(x-1)) / 2.
static double nearestNeighborAverage(Field field)
          Calculates (F(x+1) + F(x-1)) / 2.
static double upwindAverage(Field field)
          Calculates (F(x+1) + F(x)) / 2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

nearestNeighborAverage

public static double nearestNeighborAverage(Field field)
Calculates (F(x+1) + F(x-1)) / 2.

Parameters:
field - The Field on which to calculate the average
Returns:
The averageof the Field at the point defined by StencilUtils.getPoint()

upwindAverage

public static double upwindAverage(Field field)
Calculates (F(x+1) + F(x)) / 2.

Parameters:
field - The Field on which to calculate the average
Returns:
The averageof the Field at the point defined by StencilUtils.getPoint()

downwindAverage

public static double downwindAverage(Field field)
Calculates (F(x) + F(x-1)) / 2.

Parameters:
field - The Field on which to calculate the average
Returns:
The averageof the Field at the point defined by StencilUtils.getPoint()