helmholtz_solver_factory Interface

public interface helmholtz_solver_factory

Module Procedures

private subroutine factory_allocatable(multigrid, bnd_type_core, bnd_type_wall, bnd_type_dome, bnd_type_out, co, lambda, xi, par, solver_type, hsolver)

Factory routine for 2D Helmholtz solver, including type allocation of the hsolver specified by string solver_type

Arguments

Type IntentOptional Attributes Name
type(multigrid_t), intent(inout) :: multigrid

Multigrid on which to solve the Helmholtz problem (not changed)

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 within Helmholtz operator

real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: lambda

Lambda within Helmholtz operator

real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: xi

Xi within Helmholtz operator

type(parameters_helmholtz_solver_factory), intent(in) :: par

Parameters and selection of Helmholtz solver

character(len=*), intent(in) :: solver_type

Desired type of Helmholtz solver (DIRECT, MGMRES)

class(helmholtz_solver_t), intent(out), allocatable :: hsolver

Created Helmholtz solver

private subroutine factory_direct(multigrid, bnd_type_core, bnd_type_wall, bnd_type_dome, bnd_type_out, co, lambda, xi, par, hsolver)

Factory routine for 2D Helmholtz solver, type DIRECT. Only the finest mesh of the multigrid will be used.

Arguments

Type IntentOptional Attributes Name
type(multigrid_t), intent(inout) :: multigrid
integer, intent(in) :: bnd_type_core
integer, intent(in) :: bnd_type_wall
integer, intent(in) :: bnd_type_dome
integer, intent(in) :: bnd_type_out
real(kind=FP), intent(in), dimension(multigrid%get_np(1)) :: co
real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: lambda
real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: xi
type(parameters_helmholtz_solver_factory), intent(in) :: par
type(helmholtz_solver_direct_t), intent(inout) :: hsolver

private subroutine factory_mgmres(multigrid, bnd_type_core, bnd_type_wall, bnd_type_dome, bnd_type_out, co, lambda, xi, par, hsolver)

Factory routine for 2D Helmholtz solver, type MGMRES

Arguments

Type IntentOptional Attributes Name
type(multigrid_t), intent(inout) :: multigrid
integer, intent(in) :: bnd_type_core
integer, intent(in) :: bnd_type_wall
integer, intent(in) :: bnd_type_dome
integer, intent(in) :: bnd_type_out
real(kind=FP), intent(in), dimension(multigrid%get_np(1)) :: co
real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: lambda
real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: xi
type(parameters_helmholtz_solver_factory), intent(in) :: par
type(helmholtz_solver_mgmres_cpu_t), intent(inout) :: hsolver

private subroutine factory_mgmres_cxx(multigrid, compute_backend_to_use, bnd_type_core, bnd_type_wall, bnd_type_dome, bnd_type_out, co, lambda, xi, par, hsolver, data_backend_to_use)

Factory routine for 2D Helmholtz solver, type MGMRES

Arguments

Type IntentOptional Attributes Name
type(multigrid_t), intent(inout) :: multigrid
integer, intent(in) :: compute_backend_to_use
integer, intent(in) :: bnd_type_core
integer, intent(in) :: bnd_type_wall
integer, intent(in) :: bnd_type_dome
integer, intent(in) :: bnd_type_out
real(kind=FP), intent(in), dimension(multigrid%get_np(1)) :: co
real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: lambda
real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: xi
type(parameters_helmholtz_solver_factory), intent(in) :: par
type(helmholtz_solver_mgmres_cxx_t), intent(inout) :: hsolver
integer, intent(in), optional :: data_backend_to_use

public subroutine factory_petsc(multigrid, bnd_type_core, bnd_type_wall, bnd_type_dome, bnd_type_out, co, lambda, xi, par, hsolver, pc_sel)

Factory routine for 2D Helmholtz solver, type PETSC. Only the finest mesh of the multigrid will be used.

Arguments

Type IntentOptional Attributes Name
type(multigrid_t), intent(inout) :: multigrid
integer, intent(in) :: bnd_type_core
integer, intent(in) :: bnd_type_wall
integer, intent(in) :: bnd_type_dome
integer, intent(in) :: bnd_type_out
real(kind=FP), intent(in), dimension(multigrid%get_np(1)) :: co
real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: lambda
real(kind=FP), intent(in), dimension(multigrid%get_np_inner(1)) :: xi
type(parameters_helmholtz_solver_factory), intent(in) :: par
type(helmholtz_solver_petsc_t), intent(inout) :: hsolver
character(len=*), intent(in) :: pc_sel

Type of Preconditioner PGMG: Multigrid with operators from parallax-multigrid PCRC: As specified in file petscrc