Class SpaceTimeDiscretization

java.lang.Object
net.finmath.finitedifference.grids.SpaceTimeDiscretization

public class SpaceTimeDiscretization extends Object
Encapsulates the space-time discretization used in a finite difference scheme.

The class contains:

  • A possibly multi-dimensional spatial grid, stored as a collection of Grid objects indexed by their dimension (index 0 corresponds to the one-dimensional case).
  • A TimeDiscretization, interpreted as a discretization of time-to-maturity. In the finite difference framework, the PDE is solved backward in time, so 0 corresponds to maturity.
  • The parameter theta, controlling the theta-method (explicit, implicit, or Crank–Nicolson).
  • A center point per spatial dimension.
Author:
Alessandro Gnoatto
  • Constructor Details

    • SpaceTimeDiscretization

      public SpaceTimeDiscretization(Grid spaceGrid, TimeDiscretization timeDiscretization, double theta, double[] center)
      Constructs a one-dimensional space-time discretization.
      Parameters:
      spaceGrid - The spatial grid.
      timeDiscretization - The time discretization (time-to-maturity).
      theta - The theta parameter of the theta-method.
      center - The center point of the spatial grid.
    • SpaceTimeDiscretization

      public SpaceTimeDiscretization(Grid[] spaceGrids, TimeDiscretization timeDiscretization, double theta, double[] center)
      Constructs a multi-dimensional space-time discretization.

      The i-th grid in the array is stored under key i.

      Parameters:
      spaceGrids - Array of grids, one per spatial dimension.
      timeDiscretization - The time discretization (time-to-maturity).
      theta - The theta parameter of the theta-method.
      center - Center point per dimension (same length as spaceGrids).
  • Method Details

    • getSpaceGrids

      public HashMap<Integer,Grid> getSpaceGrids()
      Returns the value.
      Returns:
      The value.
    • getCenter

      public double[] getCenter()
      Returns the value.
      Returns:
      The value.
    • getSpaceGrid

      public Grid getSpaceGrid(int dimension)
      Returns the spatial grid corresponding to the given dimension.
      Parameters:
      dimension - The spatial dimension index.
      Returns:
      The corresponding Grid.
    • getTimeDiscretization

      public TimeDiscretization getTimeDiscretization()
      Returns the time discretization.
      Returns:
      The TimeDiscretization.
    • getTheta

      public double getTheta()
      Returns the theta parameter of the theta-method.
      Returns:
      The theta parameter.
    • getCenter

      public double getCenter(int dimension)
      Returns the center coordinate for the specified spatial dimension.
      Parameters:
      dimension - The spatial dimension index.
      Returns:
      The center value for the given dimension.
    • getNumberOfSpaceGrids

      public int getNumberOfSpaceGrids()
      Returns the value.
      Returns:
      The value.