@@ -248,24 +248,6 @@ function e2p(ex,ey,ez,Kz,kz0)
248
248
end
249
249
250
250
251
- """
252
- a2p2(a,W,Kx,Ky,Kz,kz0)
253
-
254
- Converts an amplitude vector (in substrate or superstrate) to Poynting power flow in z direction
255
- # Arguments
256
- * `a` : amplitude vector
257
- * `W` : eigenmodes of the halfspace
258
- * `Kx` : x component of the wavevector in the medium
259
- * `Ky` : y component of the wavevector in the medium
260
- * `Kz` : z component of the wavevector in the medium
261
- * `kz0` : z component of the plane wave wavevector in the superstrate
262
- # Outputs
263
- * `P` : power flow
264
- """
265
- function a2p2 (a,W,Kx,Ky,Kz,kz0)
266
- ex,ey,ez= a2e (a,W,Kx,Ky,Kz)
267
- return e2p (ex,ey,ez,Kz,kz0)
268
- end
269
251
"""
270
252
a2p(a,b,W,Kx,Ky,kz0)
271
253
290
272
a2e2d(a,W)
291
273
292
274
Converts an amplitude vector to reciprocal-space electric fields Ex and Ey.
293
- This is a "light" version of the "a2e" method.
294
275
# Arguments
295
276
* `a` : amplitude vector
296
277
* `W` : eigenmodes of the halfspace
@@ -305,27 +286,6 @@ function a2e2d(a,W)
305
286
return ex,ey
306
287
end
307
288
308
- """
309
- a2e(a,W,Kx,Ky,Kz)
310
-
311
- converts an amplitude vector (in substrate or superstrate) to reciprocal-space electric fields
312
- # Arguments
313
- * `a` : x amplitude vector
314
- * `W` : eigenmodes of the halfspace
315
- * `Kx` : x component of the wavevector in the medium
316
- * `Ky` : y component of the wavevector in the medium
317
- * `Kz` : z component of the wavevector in the medium
318
- # Outputs
319
- * `ex` : x-component of the electric field
320
- * `ey` : y-component of the electric field
321
- * `ez` : z-component of the electric field
322
- """
323
- function a2e (a,W,Kx,Ky,Kz)
324
- ex,ey= a2e2d (a,W)
325
- # Plane wave, E⊥k, E*k=0
326
- ez= - Kz\ (Kx* ex+ Ky* ey)
327
- return ex,ey,ez
328
- end
329
289
330
290
"""
331
291
getfields(ain,bout,em::Eigenmodes,grd::RCWAGrid,xypoints,zpoints,λ,window,padding)
@@ -365,10 +325,10 @@ function getfields(ain,bout,em::Eigenmodes,grd::RCWAGrid,xypoints,zpoints,λ,win
365
325
a= exp ( (em. q* 2 π/ λ* zpoints[zind]))* ain
366
326
b= exp (- (em. q* 2 π/ λ* zpoints[zind]))* bout
367
327
# convert amplitude vectors to electric fields
368
- ex,ey,ez = a2e (a+ b,em. W,grd . Kx,grd . Ky,grd . Kz0 )
369
- 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)
328
+ ex,ey= a2e2d (a+ b,em. W)
329
+ hx,hy= a2e2d (a- b,em. V)
330
+ ez= - 1im * (grd. Kx* hy- grd. Ky* hx)
331
+ hz= - 1im * (grd. Kx* ey- grd. Ky* ex)
372
332
# convert from reciprocal lattice vectors to real space distribution
373
333
efield[:,:,zind,1 ]= recipvec2real (Array (grd. nx),Array (grd. ny),Array (ex),nx,ny,windowfunction)
374
334
efield[:,:,zind,2 ]= recipvec2real (Array (grd. nx),Array (grd. ny),Array (ey),nx,ny,windowfunction)
0 commit comments