| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | initialized | = | .FALSE. | ||
| integer, | public | :: | nElems |
global number of radial elements |
|||
| integer, | public | :: | nElems_str |
local number of radial elements per MPI subdomain !<<<< |
|||
| integer, | public | :: | nElems_end |
local number of radial elements per MPI subdomain !<<<< |
|||
| integer, | public, | ALLOCATABLE | :: | offset_elem(:) |
allocated (0:nRanks), gives range on each rank: nElems_str:nElems_end=offset_elem(rank)+1:offset_elem(myRank+1) |
||
| integer, | public | :: | grid_type |
type of grid (stretching functions...) |
|||
| real(kind=wp), | public, | ALLOCATABLE | :: | sp(:) |
element point positions in [0,1], size(0:nElems) |
||
| real(kind=wp), | public, | ALLOCATABLE | :: | ds(:) |
ds(i)=sp(i)-sp(i-1), size(1:nElems) |
initialize the type sgrid with number of elements
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_sGrid), | intent(inout) | :: | sf |
self |
||
| integer, | intent(in) | :: | nElems_in |
total number of elements |
||
| integer, | intent(in) | :: | grid_type_in |
0, 1, 2, 3 |
||
| real(kind=wp), | intent(in), | optional | :: | sp_in(0:nElems_in) |
inner grid point positions, first position should be 0, last should be 1. |
copy the type sgrid, copies sf <= tocopy ... call sf%copy(tocopy)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_sGrid), | intent(inout) | :: | sf |
self |
||
| class(c_sgrid), | intent(in) | :: | tocopy |
compare to sf grid with input grid to see if they are the same
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_sGrid), | intent(in) | :: | sf |
self |
||
| class(c_sgrid), | intent(in) | :: | tocompare | |||
| logical, | intent(out) | :: | is_same |
finalize the type sgrid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_sGrid), | intent(inout) | :: | sf |
self |
find grid cell for certain position
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_sGrid), | intent(in) | :: | sf |
self |
||
| real(kind=wp), | intent(in) | :: | x |
TYPE,EXTENDS(c_sgrid) :: t_sGrid LOGICAL :: initialized=.FALSE. !--------------------------------------------------------------------------------------------------------------------------------- !input parameters INTEGER :: nElems !! global number of radial elements INTEGER :: nElems_str, nElems_end !! local number of radial elements per MPI subdomain !<<<< INTEGER,ALLOCATABLE :: offset_elem(:) !! allocated (0:nRanks), gives range on each rank: !! nElems_str:nElems_end=offset_elem(rank)+1:offset_elem(myRank+1) INTEGER :: grid_type !! type of grid (stretching functions...) !--------------------------------------------------------------------------------------------------------------------------------- REAL(wp),ALLOCATABLE :: sp(:) !! element point positions in [0,1], size(0:nElems) REAL(wp),ALLOCATABLE :: ds(:) !! ds(i)=sp(i)-sp(i-1), size(1:nElems) CONTAINS PROCEDURE :: init => sGrid_init PROCEDURE :: copy => sGrid_copy PROCEDURE :: compare => sGrid_compare PROCEDURE :: free => sGrid_free PROCEDURE :: find_elem => sGrid_find_elem END TYPE t_sGrid