Base type used to define a Poisson2D matrix on a rectangular domain
discretized with nx and ny points in each direction and
corresponding grid spacings dx and dy.
Constructor for generating a Poisson2D matrix. The matrix corresponds
to the standard second-order accurate finite-difference approximation
of the Laplace operator with homogeneous Dirichlet boundary conditions.
type(Poisson2D) :: A
integer, parameter :: nx = 128, ny = 256
real(dp), parameter :: Lx = 1.0_dp, Ly = 2.0_dp
A = Poisson2D(nx, ny, Lx, Ly)
Note
Only doube precision is currently supported for this matrix type.
Note
Note that Lx and Ly are optional. If not specified, they default
to 1.0_dp.
Utility function to construct a Poisson2D matrix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=ilp), | intent(in) | :: | nx |
Number of grid points in each direction. |
||
| integer(kind=ilp), | intent(in) | :: | ny |
Number of grid points in each direction. |
||
| real(kind=dp), | intent(in), | optional | :: | Lx |
Physical extent of each dimension. |
|
| real(kind=dp), | intent(in), | optional | :: | Ly |
Physical extent of each dimension. |
Corresponding Poisson2D matrix.