Class SpaceTimeDiscretization
java.lang.Object
net.finmath.finitedifference.grids.SpaceTimeDiscretization
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
Gridobjects indexed by their dimension (index0corresponds 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, so0corresponds to maturity. - The parameter
theta, controlling the theta-method (explicit, implicit, or CrankâNicolson). - A center point per spatial dimension.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
ConstructorsConstructorDescriptionSpaceTimeDiscretization(Grid[] spaceGrids, TimeDiscretization timeDiscretization, double theta, double[] center) Constructs a multi-dimensional space-time discretization.SpaceTimeDiscretization(Grid spaceGrid, TimeDiscretization timeDiscretization, double theta, double[] center) Constructs a one-dimensional space-time discretization. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns the value.doublegetCenter(int dimension) Returns the center coordinate for the specified spatial dimension.intReturns the value.getSpaceGrid(int dimension) Returns the spatial grid corresponding to the given dimension.Returns the value.doublegetTheta()Returns the theta parameter of the theta-method.Returns the time discretization.
-
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 keyi.- 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 asspaceGrids).
-
-
Method Details
-
getSpaceGrids
-
getCenter
public double[] getCenter()Returns the value.- Returns:
- The value.
-
getSpaceGrid
-
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.
-