登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
时域有限差分法 FDTD
>
fortran编写的3D的PML程序铁出来,大家都看看
发帖
回复
1
2
5041
阅读
13
回复
[
资料共享
]
fortran编写的3D的PML程序铁出来,大家都看看
离线
wq_463
UID :20925
注册:
2008-11-06
登录:
2021-04-22
发帖:
227
等级:
仿真三级
0楼
发表于: 2008-12-06 20:43:36
!***********************************************************************
3Et t9fBd
! 3-D FDTD code with CPML absorbing boundary conditions
EwOi` g
!***********************************************************************
>iWw i'T=
!
/A%31WE&1
! Program author: Jamesina J. Simpson, Ph.D. Graduate Student
PZCOJK
! National Science Foundation Fellow
{ Em fw9L
! NU Computational Electromagnetics Laboratory
/q6 ^.>b
! Director: Allen Taflove
tt]ZGn*
! Department of Electrical Engineering and
Y:K1v:Knw
! Computer Science
|z.Z='`
! Northwestern University
f`,isy[
! 2145 Sheridan Road
P%kJq^&
! Evanston, IL 60208
l Gy`{E|
! [url=mailto:j-simpson@northwestern.edu]j-simpson@northwestern.edu[/url]
1}I%yOi)
!
P&8QKX3 j^
! Copyright 2005
7@9R^,M4:
!
]1i1_AR'`
! This FORTRAN 90 code implements the finite-difference time-domain
gn4Sz")
! solution of Maxwell's curl equations over a three-dimensional
w 8oIq*
! Cartesian space lattice. The grid is terminated by CPML absorbing
@:G#[>nKe
! boundary conditions. However, in a straightforward manner it can
|gJI}"T
! be altered to have PEC planes at any of the outer grid boundaries.
$N17GqoC
! Also, the number of grid cells as well as the thickness of
EN@Pr `R
! the PML in each Cartesian direction can be varied independently.
+Zi@+|"BCN
!
sQr |3}I(
! For illustrative purposes, the code supplied here models the PML
.s>PDzM$
! numerical experiment described in Section 7.11.2. Three output
eTY""EWU
! files are generated having the following data:
/m+\oZ ]d
!
A>Oi9%OY:
! (1) Ez at the source for each time step;
ZHOh(
! (2) Ey at the probe point for each time step; and
>=3ay^(Y2D
! (3) The plane of Ez values 1 mm above the source in the k-
UhF+},gU
! direction recorded at the time step, "record_grid". This
sT% ^W
! data can be viewed in Matlab using the following commands:
)|i]"8I
!
:~dI2e\:
! >> load view_grid.dat
P{h$> 6c
! >> for j = 1:Jmax
W*NK-F[
! >> image(1:Imax,j) = view_grid(1+(j-1)*Imax:j*Imax);
t(.xEl;Ma
! >> end
]$ iqJL
! >> pcolor(image'); shading flat
Ni)/L( &
!
R"k}wRnxY
! The relative error (equation 7.135) graphed in Fig. 7.6 on
4l"oq"uc
! page 318 can be reproduced by comparing the output file
Q.])En >i
! "probe.dat" with that of a much larger benchmark grid having
?Y#x`DMh
! Imax, Jmax, and Kmax increased to the values mentioned in the text.
C\C*'l6d
!
Qo \;)
! This code has been tested using the Intel Fortran Compiler 8.0 for
I'T@}{h
! Linux. The executable can be created by typing
%oN5 jt
! "ifort fdtd3D_CPML.f90" at the command prompt.
LuUfdzH
!
q.g0Oz@z
! This program is not guaranteed to be free of defects or bugs.
9..! g:
! Please report any bugs that may exist to:
9~C$C
! [url=mailto:j-simpson@northwestern.edu]j-simpson@northwestern.edu[/url]
[%yCnt
!
t"L-9kCM
!
A@k`$xevVj
!***********************************************************************
Nh/B8:035
~OQ/ |ws
PROGRAM fdtd3D_CPML
o+.LG($+U
IMPLICIT NONE
n*GsM6Y&
! ..................................
m%G:|`f7
! Input Fundamental Constants (MKS units)
IA?v[xu
REAL, PARAMETER :: &
K trR+:
pi = 3.14159265358979, C = 2.99792458E8, &
j5qrM_Chg
muO = 4.0 * pi * 1.0E-7, epsO = 1.0/(C*C*muO)
-H(\[{3{V
! ..................................
]W>kbHImz
! Specify Material Relative Permittivity and Conductivity
p$OkWSi~
REAL, PARAMETER:: &
>`!Lh`n7_
epsR = 1.0, sigM1 = 0.0 ! free space
lQnqPQY
! ..................................
2 K&5Kt/
! Specify Number of Time Steps and Grid Size Parameters
Dwp-*QK^G
INTEGER, PARAMETER :: &
j@+QwZL|
nmax = 2100, & ! total number of time steps
eZ[O:W vk:
Imax = 51, Jmax = 126, Kmax = 26 ! grid size corresponding to the
mtg3}etA
! number of Ez field components
@ wJ|vW_.
! ..................................
#99fFs`w
! Specify Grid Cell Size in Each Direction and Calculate the
8<