!**************************************************************************** ! 電流源 !**************************************************************************** subroutine ecur_source use fdtd implicit none integer :: i,j,id real(8) :: func i=nx/2 j=ny/2 id=media_id(i,j) ey(i,j)=ey(i,j) & -(dt/eps(id))/(1.0d0+(sig(id)*dt)/(2.0d0*eps(id)))*func(time-dt/2.0d0) return end subroutine !**************************************************************************** ! 磁流源 !**************************************************************************** subroutine mcur_source use fdtd implicit none integer :: i,j,id real(8) :: func i=nx/4 j=ny/4 id=media_id(i,j) hz(i,j)=hz(i,j) & -(dt/mu(id))*func(time-dt/2.0d0) return end subroutine !**************************************************************************** ! 平面波 !**************************************************************************** subroutine plane_wave_source use consts use fdtd implicit none integer :: i,j,id real(8) :: func i=2 do j=1,ny id=media_id(i,j) ey(i,j)=func(time-dt/2.0d0) hz(i,j)=ey(i,j)/z0 end do return end subroutine !---------------------------------------------------------------------------- ! 波源の関数形 ! だんだん振幅が大きくなる正弦波(p.48) !---------------------------------------------------------------------------- real(8) function func(t) use consts use fdtd implicit none real(8) :: t real(8) :: tp,t1 tp=1.0d0/freq t1=3.0d0*tp if(t.lt.t1) then func=0.5d0*(1.0d0-dcos(pi*t/t1))*dsin(2.0d0*pi*freq*t) else func=dsin(2.0d0*pi*freq*t) end if end function !---------------------------------------------------------------------------- ! 波源の関数形 ! 余弦波 !---------------------------------------------------------------------------- real(8) function func_cos(t) use consts use fdtd implicit none real(8) :: t func_cos=dcos(2.0d0*pi*freq*t) end function !---------------------------------------------------------------------------- ! 波源の関数形 ! ステップパルス !---------------------------------------------------------------------------- real(8) function func_step(t) use consts use fdtd implicit none real(8) :: t real(8) :: tp tp=1.0d0/freq if(t.lt.(tp/2.0d0)) then func_step=1.0d0 else func_step=0.0d0 end if end function !---------------------------------------------------------------------------- ! 波源の関数形 ! ガウシアンパルス (p.46) !---------------------------------------------------------------------------- real(8) function func_gaussian(t) use consts use fdtd implicit none real(8) :: t real(8) :: tp tp=1.0d0/freq if(t.lt.tp) then ! 正規分布: exp(-(x-m)^2/(2 s^2)) func_gaussian=dexp(-(t-tp/2.0d0)**2/(2.0d0*(tp/4)**2)) else func_gaussian=0.0d0 end if end function ! ! End of file !