📄 pml.f90
字号:
! pml.f90! ! Berenger's Perfecly Matched Layer implementation: structure definitions ! and allocations!! Copyright (C) 2007 Paul Panserrieu, < peutetre@cs.tu-berlin.de >!! This program is free software: you can redistribute it and/or modify! it under the terms of the GNU General Public License as published by! the Free Software Foundation, either version 3 of the License.! ! last modified: 19-10-2007 12:09:19 PM CESTMODULE pmlUSE fdtd_gitter, ONLY: gitterIMPLICIT NONETYPE pml_gitter DOUBLE PRECISION, POINTER, DIMENSION(:,:,:,:) :: E, H DOUBLE PRECISION, POINTER, DIMENSION(:,:,:,:) :: sigmaEND TYPE pml_gitterTYPE pml_boundary INTEGER :: layers INTEGER :: min_xo, max_xo INTEGER :: min_yo, max_yo INTEGER :: min_zo, max_zo TYPE(pml_gitter) :: top_x, bas_x TYPE(pml_gitter) :: top_y, bas_y TYPE(pml_gitter) :: top_z, bas_zEND TYPE pml_boundaryCONTAINSSUBROUTINE pml_alloc(grid, x_min, x_max, y_min, y_max, z_min, z_max) TYPE(pml_gitter), INTENT(INOUT) :: grid INTEGER, INTENT(IN) :: x_min, x_max INTEGER, INTENT(IN) :: y_min, y_max INTEGER, INTENT(IN) :: z_min, z_max ALLOCATE(grid%E(x_min:x_max & ,y_min:y_max & ,z_min:z_max & ,1:6) & ,grid%H(x_min:x_max & ,y_min:y_max & ,z_min:z_max & ,1:6) ) grid%E(x_min:x_max, y_min:y_max, z_min:z_max, 1:6) = 0.0d0 grid%H(x_min:x_max, y_min:y_max, z_min:z_max, 1:6) = 0.0d0 ALLOCATE(grid%sigma( x_min:x_max & , y_min:y_max & , z_min:z_max & , 1:6)) ! 6 values ... grid%sigma(x_min:x_max, y_min:y_max, z_min:z_max, 1:6) = 0.0d0END SUBROUTINE pml_allocSUBROUTINE init_pml(g, pml_b, l) TYPE(gitter), INTENT(IN) :: g TYPE(pml_boundary), INTENT(OUT) :: pml_b INTEGER, INTENT(IN) :: l pml_b%layers = l pml_b%min_xo = g%nxl-l; pml_b%max_xo = g%nxgh+l pml_b%min_yo = g%nyl-l; pml_b%max_yo = g%nygh+l pml_b%min_zo = g%nzl-l; pml_b%max_zo = g%nzgh+l ! bas_x CALL pml_alloc(pml_b%bas_x & ,pml_b%min_xo,g%nxl-1 & ,pml_b%min_yo,pml_b%max_yo & ,pml_b%min_zo,pml_b%max_zo) ! top_x CALL pml_alloc(pml_b%top_x & ,g%nxgh, pml_b%max_xo & ,pml_b%min_yo,pml_b%max_yo & ,pml_b%min_zo,pml_b%max_zo) ! bas_y CALL pml_alloc(pml_b%bas_y & ,g%nxl, g%nxyh & ,pml_b%min_yo,g%nyl-1 & ,pml_b%min_zo,pml_b%max_zo) ! top_y CALL pml_alloc(pml_b%top_y & ,g%nxl, g%nxyh & ,g%nygh,pml_b%max_yo & ,pml_b%min_zo,pml_b%max_zo) ! bas_z CALL pml_alloc(pml_b%bas_z & ,g%nxl, g%nxyh & ,g%nyl, g%nyyh & ,pml_b%min_zo,g%nzl-1) ! top_z CALL pml_alloc(pml_b%top_z & ,g%nxl, g%nxyh & ,g%nyl, g%nyyh & ,g%nzgh, pml_b%max_zo)END SUBROUTINE init_pmlEND MODULE pml
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -