operators Module

This is a module to implement some matrix-free operations


Uses

  • module~~operators~~UsesGraph module~operators operators module~comm_variable comm_variable module~operators->module~comm_variable module~define_bc define_BC module~operators->module~define_bc module~mpi_setup mpi_setup module~operators->module~mpi_setup module~wavenumber wavenumber module~operators->module~wavenumber mpi mpi module~operators->mpi module~comm_variable->mpi module~define_bc->module~comm_variable module~define_bc->module~wavenumber module~mpi_setup->module~comm_variable module~mpi_setup->mpi module~wavenumber->module~comm_variable module~wavenumber->module~mpi_setup module~wavenumber->mpi

Used by

  • module~~operators~~UsedByGraph module~operators operators module~cslp_solver CSLP_Solver module~cslp_solver->module~operators module~smoother smoother module~cslp_solver->module~smoother module~deflaion_setup deflaion_setup module~deflaion_setup->module~operators module~deflaion_setup->module~cslp_solver module~smoother->module~operators module~solvers solvers module~solvers->module~operators module~solvers->module~cslp_solver module~solvers->module~deflaion_setup module~user_module user_module module~user_module->module~operators module~user_module->module~cslp_solver module~user_module->module~deflaion_setup module~idrs_module idrs_module module~idrs_module->module~user_module program~helmholtz_2d helmholtz_2d program~helmholtz_2d->module~solvers program~helmholtz_2d->module~user_module program~helmholtz_2d->module~idrs_module

Functions

public function norm(v)

Compute the L2-norm of a complex variable, ONLY for the default grid system.

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(in), dimension(1-LAP:nx+LAP,1-LAP:ny+LAP) :: v

Return Value real(kind=realdp)

public function Realnorm(v)

Compute the L2-norm of a real variable, ONLY for the default grid system.

Arguments

Type IntentOptional Attributes Name
real(kind=realdp), intent(in), dimension(1-LAP:nx+LAP,1-LAP:ny+LAP) :: v

Return Value real(kind=realdp)

public function dot_prod(v, w)

Compute the do product of two complex variables, ONLY for the default grid system.

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(in), dimension(1-LAP:nx+LAP,1-LAP:ny+LAP) :: v
complex(kind=realdp), intent(in), dimension(1-LAP:nx+LAP,1-LAP:ny+LAP) :: w

Return Value complex(kind=realdp)

public function mg_norm(v, ni, nj)

Compute the L2-norm of a complex variable, for a coarse-grid system.

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(in), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: v
integer, intent(in) :: ni

ni, nj: grid size of the subdomain on the current coarse grid level

integer, intent(in) :: nj

ni, nj: grid size of the subdomain on the current coarse grid level

Return Value real(kind=realdp)

public function mg_dot_prod(v, w, ni, nj)

Compute the dot product of two complex variables, for a coarse-grid system. Note that the dimension is not specified here, it means it calculate all the elements

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(in), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: v
complex(kind=realdp), intent(in), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: w
integer, intent(in) :: ni

ni, nj: grid size of the subdomain on the current coarse grid level

integer, intent(in) :: nj

ni, nj: grid size of the subdomain on the current coarse grid level

Return Value complex(kind=realdp)

public function LOG2(x)

Compute log2(x)

Arguments

Type IntentOptional Attributes Name
real(kind=realdp), intent(in) :: x

Return Value real(kind=realdp)

public function Helm_Ax_nth(v_in, grid)

ReD-Glk Helmholtz operator for coarse levels

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(inout) :: v_in(1-LAP:grid%nx+LAP,1-LAP:grid%ny+LAP)
type(Gridpara), intent(inout) :: grid

Parameters of the current grid system

Return Value complex(kind=realdp), (1-LAP:grid%nx+LAP,1-LAP:grid%ny+LAP)

public function CSLP_Mx_nth(v_in, grid)

ReD-Glk CSLP operator for coarse levels

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(inout) :: v_in(1-LAP:grid%nx+LAP,1-LAP:grid%ny+LAP)
type(Gridpara), intent(inout) :: grid

Return Value complex(kind=realdp), (1-LAP:grid%nx+LAP,1-LAP:grid%ny+LAP)


Subroutines

public subroutine Helmholtz2d_stencils(ap, an, as, aw, ae, hxhykxy2)

Computational stencils for the Helmholtz operator, second-order central FD scheme

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp) :: ap
real(kind=realdp) :: an
real(kind=realdp) :: as
real(kind=realdp) :: aw
real(kind=realdp) :: ae
real(kind=realdp), intent(in) :: hxhykxy2

The value of (kh)^2, which is computed and stored in advance.

public subroutine cslp2d_stencils(ap, an, as, aw, ae, hxhykxy2)

Computational stencils for the CSLP operator

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp) :: ap
real(kind=realdp) :: an
real(kind=realdp) :: as
real(kind=realdp) :: aw
real(kind=realdp) :: ae
real(kind=realdp), intent(in) :: hxhykxy2

The value of (kh)^2, which is computed and stored in advance

public subroutine Helmholtz2d_BC(v_in, v_out)

matrix-free Helmholtz operator, ONLY for the default gird system First deal with the boundary grid points and then the internals

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(inout), dimension(1-LAP:nx+LAP,1-LAP:ny+LAP) :: v_in
complex(kind=realdp), intent(inout), dimension(1-LAP:nx+LAP,1-LAP:ny+LAP) :: v_out

public subroutine Helmholtz2d_BC_mg(v_in, v_out, ni, nj, hx_c, hy_c, kxy, kh2)

matrix-free Helmholtz operator, for the specified coarse gird systems

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(inout), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: v_in
complex(kind=realdp), intent(inout), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: v_out
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

public subroutine CSLP_OP_BC(v_in, v_out, ni, nj, hx_c, hy_c, kxy, kh2)

matrix-free CSLP operator, for the specified gird systems

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(inout), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: v_in
complex(kind=realdp), intent(inout), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: v_out
integer, intent(in) :: ni

ni,nj: grid size of subdomain on the current grid level

integer, intent(in) :: nj

ni,nj: grid size of subdomain on the current grid level

real(kind=realdp), intent(in) :: hx_c

hx_c,hy_c: space step of subdomain on the current grid level

real(kind=realdp), intent(in) :: hy_c

hx_c,hy_c: space step of subdomain on the current grid level

real(kind=realdp), intent(in), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: kxy

kxy: wavenumber profile of subdomain on the current grid level,kh2=(kh)^2

real(kind=realdp), intent(in), dimension(1-LAP:ni+LAP,1-LAP:nj+LAP) :: kh2

kxy: wavenumber profile of subdomain on the current grid level,kh2=(kh)^2

public subroutine GridBase_ExtrpltGhostBCs(v_in, grid)

Extrapolation of a layer of ghost grid points

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp), intent(inout) :: v_in(1-LAP:grid%nx+LAP,1-LAP:grid%ny+LAP)
type(Gridpara), intent(inout) :: grid

public subroutine Helm_Ax_nth_stencils(Stcl_nth, grid, ic, jc)

ReD-Glk computational stencils of the Helmholtz operator for differnet coarse-grid level Default 2nd-ordr stencils

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp) :: Stcl_nth(-3:3,-3:3)

Resulting stencils for the Helmholtz operator

type(Gridpara), intent(inout) :: grid

parameters for the current coarse-grid system

integer :: ic

Index for the wavenumber field

integer :: jc

Index for the wavenumber field

public subroutine CSLP_Mx_nth_stencils(Stcl_nth, grid, ic, jc)

ReD-Glk computational stencils of the CSLP operator for differnet coarse-grid level

Arguments

Type IntentOptional Attributes Name
complex(kind=realdp) :: Stcl_nth(-3:3,-3:3)

Resulting stencils for the CSLP operator

type(Gridpara), intent(inout) :: grid

parameters for the current coarse-grid system

integer :: ic

Index for the wavenumber field

integer :: jc

Index for the wavenumber field