public class AlternatingDirectionImplicitMethod extends Object implements PDESolver
HeatEquation2D
. The idea behind the ADI method
is to split the finite difference equations into two, one with the x-derivative taken implicitly
and the next with the y-derivative taken implicitly, that allows solving the symmetric and
tridiagonal systems of linear equations by using LU decomposition, at each step. Solutions are
computed on a three-dimensional grid (time and x- and y-coordinates).
This method is unconditionally stable and is a second-order method with a truncation error of
order \(O(\Delta t^2 + \Delta x^2 + \Delta y^2)\).
Since a linear system for each row/column at the same time step can be solved independently,
parallel computation by multi-core processor can be used for higher performance. By default, this
option is turned on.Constructor and Description |
---|
AlternatingDirectionImplicitMethod(double epsilon)
Create an ADI method with the given precision parameter.
|
AlternatingDirectionImplicitMethod(double epsilon,
boolean parallel)
Create an ADI method with the given precision parameter, and choice for using multi-core
parallel computation for higher performance.
|
Modifier and Type | Method and Description |
---|---|
PDESolutionTimeSpaceGrid2D |
solve(HeatEquation2D pde,
int m,
int n,
int p)
Solve the given two-dimensional heat equation problem, with the given numbers of points along
the three axes in the grid (time, x, and y).
|
public AlternatingDirectionImplicitMethod(double epsilon)
epsilon
- the precision parameterpublic AlternatingDirectionImplicitMethod(double epsilon, boolean parallel)
epsilon
- the precision parameterparallel
- true
to turn on parallel computationpublic PDESolutionTimeSpaceGrid2D solve(HeatEquation2D pde, int m, int n, int p)
pde
- the heat equation problemm
- the number of grid points along the time-axis (excluding the initial condition)n
- the number of grid points along the x-axis (excluding the boundary)p
- the number of grid points along the y-axis (excluding the boundary)Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.