Skip to content

Commit cb2d5c0

Browse files
author
Jon Schlipf
committed
new z field
1 parent a77caec commit cb2d5c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Common/Common.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ function getfields(ain,bout,em::Eigenmodes,grd::RCWAGrid,xypoints,zpoints,λ,win
367367
#convert amplitude vectors to electric fields
368368
ex,ey,ez=a2e(a+b,em.W,grd.Kx,grd.Ky,grd.Kz0)
369369
hx,hy,hz=a2e(a-b,em.V,grd.Kx,grd.Ky,grd.Kz0)
370+
ez=1im*(grd.Kx*hy-grd.Ky*hx)
371+
hz=1im*(grd.Kx*ey-grd.Ky*ex)
370372
#convert from reciprocal lattice vectors to real space distribution
371373
efield[:,:,zind,1]=recipvec2real(Array(grd.nx),Array(grd.ny),Array(ex),nx,ny,windowfunction)
372374
efield[:,:,zind,2]=recipvec2real(Array(grd.nx),Array(grd.ny),Array(ey),nx,ny,windowfunction)

0 commit comments

Comments
 (0)