This is a module to solve the inverse of CSLP approximately By multigrid methods or Krylov iterations
A data type that collect some info of a (coarse) grid system It is different the type Gridpara, which does not consist any variable like u, rhs, res, and etc.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=4), | public | :: | nxc_global |
Global grid size, in x and y directions respectively. |
|||
| integer(kind=4), | public | :: | nyc_global |
Global grid size, in x and y directions respectively. |
|||
| integer(kind=4), | public | :: | nxc |
Local grid size of a subdomain, in x and y directions respectively. |
|||
| integer(kind=4), | public | :: | nyc |
Local grid size of a subdomain, in x and y directions respectively. |
|||
| integer, | public, | dimension(0:npMax - 1) | :: | ic_offset |
ic_offset: an array that contains the index offset for MPI ranks in x direction |
||
| integer, | public, | dimension(0:npMax - 1) | :: | jc_offset |
jc_offset: an array that contains the index offset for MPI ranks in y direction |
||
| integer, | public, | dimension(0:npMax - 1) | :: | ic_nn |
ic_nn: an array that contains the number of grid points for MPI ranks in x direction |
||
| integer, | public, | dimension(0:npMax - 1) | :: | jc_nn |
jc_nn: an array that contains the number of grid points for MPI ranks in y direction |
||
| real(kind=realdp), | public | :: | hxc |
space step, hxhyc==hx*hy==hx^2 |
|||
| real(kind=realdp), | public | :: | hyc |
space step, hxhyc==hx*hy==hx^2 |
|||
| real(kind=realdp), | public | :: | hxhyc |
space step, hxhyc==hx*hy==hx^2 |
|||
| complex(kind=realdp), | public, | allocatable, dimension(:,:) | :: | u_c |
Solution variable in subdomain |
||
| complex(kind=realdp), | public, | allocatable, dimension(:,:) | :: | rhs_c |
RHS variable in subdomain |
||
| complex(kind=realdp), | public, | allocatable, dimension(:,:) | :: | res_c |
Residual variable in subdomain |
||
| real(kind=realdp), | public, | allocatable, dimension(:,:) | :: | kxy_c |
wavenumber in subdomain |
||
| real(kind=realdp), | public, | allocatable, dimension(:,:) | :: | kh2_c |
wavenumber in subdomain |
Multigrid-Based CSLP, ONLY starts from the default (finest) grid sysyem One V-cycle Two V-cycle One F-cycle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=realdp), | dimension(1-LAP:nx+LAP,1-LAP:ny+LAP) | :: | b_in |
MGCSLP_invMx = M_h^(-1)(b_h)
Multigrid-based CSLP, starts from the a specified grid system One V-cycle Two V-cycle One F-cycle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=realdp), | dimension(1-LAP:grid%nx+LAP,1-LAP:grid%ny+LAP) | :: | b_in | |||
| type(Gridpara) | :: | grid |
A data type that collect some parameters of a system |
MGCSLP_invMHx = M_H^(-1)(b_H)
Krylov-based CSLP, starts from the a specified grid sysyem Choose Bi-CGSATB or GMRES by uncomment or comment
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=realdp), | dimension(1-LAP:grid%nx+LAP,1-LAP:grid%ny+LAP) | :: | b_in | |||
| type(Gridpara) | :: | grid |
A data type that collect some parameters of a system |
This is a routine that define the finest grid system from the default (finest) grid parameters
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_finest |
This is a routine that define a GridSystem type from the grid parameters of a data type Gridpara One can find the differnece of GridSystem and Gridpara
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Gridpara) | :: | grid | ||||
| type(GridSystem) | :: | basegridsys |
This is a routine that define a coarse grid system mg_coarse from a fine grid system mg_fine
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_coarse | |||
| type(GridSystem), | intent(inout) | :: | mg_fine |
This is a routine that deallocate the arrays of a grid system
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_dm |
This is routine that perform full-weight resctriction from fine to coarse grid system, mainly residual (res) on fine grid --> right-hand side (rhs) on coarse grid, wavenumber on fine grid --> wavenumber on the coarse grid Based on the relationship of the index between the fine and coarse grid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_coarse | |||
| type(GridSystem), | intent(inout) | :: | mg_fine |
This is routine that perform bilinear interpolation and correction from coarse to fine grid system, mainly solution (u) on coarse grid --> correction (e_h) for solution (u) of fine grid Based on the relationship of the index between the fine and coarse grid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_coarse | |||
| type(GridSystem), | intent(inout) | :: | mg_fine |
A classic multigrid V-cycle A classic Two-Cycle GMRES or Bi-CGSTAB can be chose to solve the coarse-grid problem GMRES or Bi-CGSTAB can be chose to solve the coarsest-grid problem
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_fine |
This is a classic F-cycle multigrid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_fine |
This is a rountine to solve the (specified) coarsest-grid CSLP system approximately by using GMRES The CSLP is define by ReD-O2 scheme Be careful!!, after the whole iteration without achieving eps, then the value of j will be "m_iter+1".So we need a k. The default tolerance is 1E-08
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_solve |
The current coarsest grid system |
Arnoldi precess w=A*v_i
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=realdp), | intent(inout), | dimension(1-LAP:ni+LAP,1-LAP:nj+LAP,cslp_mg_miter+1) | :: | V | ||
| complex(kind=realdp), | intent(inout), | dimension(cslp_mg_miter+1,cslp_mg_miter) | :: | H | ||
| integer, | intent(in) | :: | k | |||
| integer, | intent(in) | :: | ni | |||
| integer, | intent(in) | :: | nj | |||
| real(kind=realdp), | intent(in) | :: | hx_c | |||
| real(kind=realdp), | intent(in) | :: | hy_c | |||
| real(kind=realdp), | intent(in), | dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) | :: | kxy | ||
| real(kind=realdp), | intent(in), | dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) | :: | kh2 |
This is routine to perform apply_givens_rotation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=realdp), | intent(inout), | dimension(cslp_mg_miter+1,cslp_mg_miter) | :: | H | ||
| complex(kind=realdp), | intent(inout), | dimension(cslp_mg_miter+1) | :: | cs | ||
| complex(kind=realdp), | intent(inout), | dimension(cslp_mg_miter+1) | :: | sn | ||
| integer, | intent(in) | :: | k |
This is routine that performs back substitute
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=realdp), | intent(in), | dimension(cslp_mg_miter+1,cslp_mg_miter) | :: | H | ||
| complex(kind=realdp), | intent(inout), | dimension(cslp_mg_miter+1) | :: | beta | ||
| integer, | intent(in) | :: | k |
This is a rountine to solve the (specified) coarsest-grid CSLP system approximately by using Bi-CGSTAB The CSLP is define by ReD-O2 scheme
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_solve | |||
| integer, | intent(in), | optional | :: | maximum_iterations |
User-specified maximum number of iterations |
This is a rountine to solve a coarse grid CSLP system approximately by using Bi-CGSTAB. The CSLP operator is defined by ReD-Glk scheme. CSLP operator by ReD-Glk
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_solve |
The current coarse grid system |
||
| type(Gridpara) | :: | grid |
Parameters of current coarse grid |
|||
| integer, | intent(in), | optional | :: | maximum_iterations |
This is a rountine to solve a coarse grid CSLP system approximately by using GMRES The CSLP operator is defined by ReD-Glk scheme CSLP operator by ReD-Glk
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(GridSystem), | intent(inout) | :: | mg_solve | |||
| type(Gridpara) | :: | grid | ||||
| integer, | intent(in), | optional | :: | maximum_iterations |
User-specified maximum number of iterations,default is 300 |