Multigrid solver for the Helmholtz problem
Creates multigrid solver
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(inout) | :: | self |
Instance of the type |
||
| type(multigrid_t), | intent(in), | target | :: | multigrid |
Multigrid on which to solve the Helmholtz problem |
|
| integer, | intent(in) | :: | bnd_type_core |
Boundary descriptor for core boundary |
||
| integer, | intent(in) | :: | bnd_type_wall |
Boundary descriptor for wall boundary |
||
| integer, | intent(in) | :: | bnd_type_dome |
Boundary descriptor for dome boundary |
||
| integer, | intent(in) | :: | bnd_type_out |
Boundary descriptor for outer(mask) boundary |
||
| real(kind=FP), | intent(in), | dimension(multigrid%get_np(1)) | :: | co |
Coefficient co |
|
| real(kind=FP), | intent(in), | dimension(multigrid%get_np_inner(1)) | :: | lambda |
Coefficient lambda |
|
| real(kind=FP), | intent(in), | dimension(multigrid%get_np_inner(1)) | :: | xi |
Coefficient xi |
Initialises multigrid solver with parameters and solvers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(inout) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | ncycle |
Number of multigrid cycles 1=V, 2=W |
||
| class(splitting_t), | intent(inout), | allocatable | :: | smoother |
Smoother On output the object is deallocated |
|
| integer, | intent(in) | :: | npresmooth |
Number of presmoothing steps |
||
| integer, | intent(in) | :: | npostsmooth |
Number of postsmoothing steps |
||
| class(direct_solver_t), | intent(inout), | allocatable | :: | dirsolver |
Direct solver, used on coarsest level On output the object is deallocated |
Updates multigrid solver with new values of coefficients
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(inout) | :: | self |
Instance of the type |
||
| real(kind=FP), | intent(in), | dimension(self%multigrid%get_np(1)) | :: | co |
Coefficient co |
|
| real(kind=FP), | intent(in), | dimension(self%multigrid%get_np_inner(1)) | :: | lambda |
Coefficient lambda |
|
| real(kind=FP), | intent(in), | dimension(self%multigrid%get_np_inner(1)) | :: | xi |
Coefficient xi |
|
| integer, | intent(in), | optional | :: | bnd_type_core |
Boundary descriptor for core boundary |
|
| integer, | intent(in), | optional | :: | bnd_type_wall |
Boundary descriptor for wall boundary |
|
| integer, | intent(in), | optional | :: | bnd_type_dome |
Boundary descriptor for dome boundary |
|
| integer, | intent(in), | optional | :: | bnd_type_out |
Boundary descriptor for outer(mask) boundary |
Performs a multigrid cycle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(inout) | :: | self |
Instance of the type |
||
| real(kind=FP), | intent(inout), | dimension(:) | :: | u |
On input initial guess, on output result after one cycle |
|
| real(kind=FP), | intent(inout), | dimension(:) | :: | b |
Right hand side |
|
| integer, | intent(in) | :: | lvl |
Level |
Computes the residuum ||Hu-b|| / ||b||
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(in) | :: | self |
Instance of the type |
||
| real(kind=FP), | intent(inout), | dimension(:) | :: | u |
Guess for solution |
|
| real(kind=FP), | intent(inout), | dimension(:) | :: | b |
Right hand side |
|
| real(kind=FP), | intent(out) | :: | res |
Residuum (root mean square) : ||Hu-b|| / ||b||+eps |
||
| real(kind=FP), | intent(out), | optional | :: | resmax |
Residuum maximum deviation max(Hu-b) |
Calls multigrid expose data
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(in) | :: | self |
Instance of the type |
||
| type(multigrid_intermediate_data_t), | intent(out) | :: | intermediate_object |
Intermediate object |
||
| type(multigrid_data_t), | intent(out) | :: | data_object |
Output object |
Exposes the Helmholtz matrix for given level Required for the GPU solver.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(in) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl |
Level for which matrix shall be returned |
||
| type(csrmat_data_t), | intent(out) | :: | res |
Helmholtz matrix for level lvl |
Exposes the inverse diagonal of Helmholtz matrices Required for the GPU solver.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(in), | target | :: | self |
Instance of the type |
|
| type(c_ptr), | intent(out) | :: | res |
Pointer to inverse diagonal of Helmhotz matrices |
Multigrid solver object
| final :: destructor_multigrid_solver |
| procedure, public :: create => create_multigrid_solver | |
| procedure, public :: update => update_multigrid_solver | |
| procedure, public :: init => initialize_multigrid_solver | |
| procedure, public :: cycle | |
| procedure, public :: residuum | |
| procedure, public :: expose_multigrid_data | |
| procedure, public :: expose_hcsr | |
| procedure, public :: expose_hdiags_inv | |
| procedure, public :: get_hcsr_finest_pointer |
Returns pointer to Helmholtz matrix on finest level
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_solver_t), | intent(in), | target | :: | self |
Instance of the type |
Pointer to Helmholtz matrix on finest level
Frees memory associated with multigrid solver
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(multigrid_solver_t), | intent(inout) | :: | self |
Instance of the type |