1D grid class.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | name |
variable name |
||
character(len=:), | public, | allocatable | :: | scale |
scale type |
||
integer, | public | :: | ncells |
number of cells |
|||
real(kind=rk), | public, | allocatable | :: | edges(:) |
vector(0:ncells) of cell edges |
||
real(kind=rk), | public, | allocatable | :: | center(:) |
vector(ncells) of cell centers, |
||
real(kind=rk), | public, | allocatable | :: | width(:) |
vector(ncells) of cell widths, |
||
real(kind=rk), | public, | dimension(:), pointer | :: | left | => | null() |
vector(ncells) of left cell boundaries, |
real(kind=rk), | public, | dimension(:), pointer | :: | right | => | null() |
vector(ncells) of right cell boundaries, |
Initialize linear grid.
Constant width:
| ... |------(i)------|------(i+1)------| ... |
xmin <- width(i) -> <- width(i+1) -> xmax
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(grid1), | intent(inout) | :: | self |
object |
||
real(kind=rk), | intent(in) | :: | xmin |
lower boundary of grid domain |
||
real(kind=rk), | intent(in) | :: | xmax |
upper boundary of grid domain |
||
integer, | intent(in) | :: | ncells |
number of grid cells |
||
character(len=*), | intent(in), | optional | :: | name |
grid name (default="") |
Initialize bilinear grid. Equivalent to 2 linear grids in series.
| ... |--|--|--| ... | ... |---|---|---| ... |
xmin xcross xmax
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(grid1), | intent(inout) | :: | self |
object |
||
real(kind=rk), | intent(in) | :: | xmin |
lower boundary of grid domain |
||
real(kind=rk), | intent(in) | :: | xcross |
cross-over boundary of grid domain |
||
real(kind=rk), | intent(in) | :: | xmax |
upper boundary of grid domain |
||
integer, | intent(in) | :: | ncells(2) |
number of grid cells in range [xmin, xcross] and [xcross, xmax] |
||
character(len=*), | intent(in), | optional | :: | name |
grid name (default="") |
Initialize logarithmic grid.
Equivalent to a linear grid in terms of .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(grid1), | intent(inout) | :: | self |
object |
||
real(kind=rk), | intent(in) | :: | xmin |
lower boundary of grid domain (xmin>0) |
||
real(kind=rk), | intent(in) | :: | xmax |
upper boundary of grid domain |
||
integer, | intent(in) | :: | ncells |
number of grid cells |
||
character(len=*), | intent(in), | optional | :: | name |
grid name (default="") |
Initialize geometric grid.
Geometrically increasing/decreasing width:
| ... |------(i)------|------(i+1)------| ... |
xmin <- width(i) -> <- width(i+1) -> xmax
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(grid1), | intent(inout) | :: | self |
object |
||
real(kind=rk), | intent(in) | :: | xmin |
lower boundary of grid domain |
||
real(kind=rk), | intent(in) | :: | xmax |
upper boundary of grid domain |
||
real(kind=rk), | intent(in) | :: | ratio |
constant ratio of geometric grid (R>0) |
||
integer, | intent(in) | :: | ncells |
number of grid cells |
||
character(len=*), | intent(in), | optional | :: | name |
grid name (default="") |
type :: grid1 !! 1D grid class. character(:), allocatable :: name !! variable name character(:), allocatable :: scale !! scale type integer :: ncells !! number of cells real(rk), allocatable :: edges(:) !! vector(0:ncells) of cell edges real(rk), allocatable :: center(:) !! vector(ncells) of cell centers, \( x_i \) real(rk), allocatable :: width(:) !! vector(ncells) of cell widths, \( x_{i+1/2} - x_{i-1/2} \) real(rk), dimension(:), pointer :: left => null() !! vector(ncells) of left cell boundaries, \( x_{i-1/2} \) real(rk), dimension(:), pointer :: right => null() !! vector(ncells) of right cell boundaries, \( x_{i+1/2} \) contains procedure, pass(self) :: linear => grid1_linear procedure, pass(self) :: bilinear => grid1_bilinear procedure, pass(self) :: log => grid1_log procedure, pass(self) :: geometric => grid1_geometric procedure, pass(self), private :: clear => grid1_clear procedure, pass(self), private :: compute => grid1_compute end type grid1