-------------------------------------------------- From: "Steven G. Johnson" <[EMAIL PROTECTED]> Sent: Tuesday, June 03, 2008 4:27 PM To: <[email protected]> Subject: Re: [Meep-discuss] E and H for the "same point"
> To get the fields for the same point in space, you can just use one of > the supplied interpolation routines as defined in the manual, such as > get-field-pt. The HDF5 output routines also interpolate all the > fields onto the same spatial grid. Also, the built-in field- > integration routines (see the reference manual) also interpolate the > fields onto the same spatial grid for you --these routines may be > useful to you if you want to integrate the stress tensor. > > To get the fields for the same *time*, you will need to do some > averaging yourself. In particular, each time step first steps H and > then steps E (and D), so the E (and D) field is always half a time- > step ahead of the H field. So, for example, you could output HDF5 > files for E and H from two consecutive time steps, and use the *first* > E field with the *average* of the two H fields. > > To do this averaging within Meep is possible, but is a bit tricky > right now from the Scheme interface. To see how it is done in C++, > see the implementation of fields::flux_in_box in src/ > energy_and_flux.cpp. > > Or you could just ignore the time difference and use E and H at > slightly different times; this will still converge as you increase > resolution, but is only first-order-accurate in the resolution. > > Steven > > On Jun 3, 2008, at 1:13 AM, matt wrote: >> Do these texts answer your question? >> http://ab-initio.mit.edu/wiki/index.php/Meep_Introduction#Finite-difference_time-domain_methods >> http://ab-initio.mit.edu/wiki/index.php/Meep_Introduction#The_illusion_of_continuity_in_Meep >> >> On Tue, 3 Jun 2008, Juntao Xi wrote: >> >>> Hi, Steven and Meepers, >>> >>> Now, I am working on the optical force simulation project. And >>> mostly, the optical force is presented by the Maxwell stress >>> tensor. (http://en.wikipedia.org/wiki/Maxwell_stress_tensor). >>> >>> As you know, Meep is using FDTD algorithms and the E output and H >>> output have "half-step" difference. >>> >>> My question is that how I can get the E and H for the "same point" >>> >>> Regards >>> Jun Both E and H are necessary in order to calculate stress tensor. Do I need to run the simulation twice with different source component? I implement the the following 2-D simulation twice with different component. ^Ey | | |------>k ;define the simulation cell ;basic unit is 10nm ;planewave source ;frequency 1/(530nm), fwidth 0.2 (346nm~1127nm) ;Drude model of Au (set! eps-averaging? false) (define-param wp_au 0.67) ; resonant plasma frequency (define-param gama_au 6.85e-3) ; gamma of Gold (define-param e_au 9.84) ; epsilon of Gold 9.84 (define-param r 2.5) (define-param d 0.1) (define-param th 5) (define Au (make dielectric (epsilon e_au) (polarizations (make polarizability (omega 1e-20) (gamma gama_au) (delta-epsilon (* wp_au wp_au 1e+20 1e+20)))))) (set! geometry-lattice (make lattice (size (+ th 40) (+ th 40) no-size))) (set! geometry (list (make block (center 0 0) (size 30 30 infinity) (material (make dielectric (epsilon 1)))) (make sphere (center 0 0) (radius r) (material Au)) (make sphere (center 0 (+ (* 2 r) d)) (radius r) (material Au)) )) (set! sources (list (make source (src (make continuous-src (wavelength 55))) (component Hy) (component Ey) (center -9 0) (size (* 4 r) 0)))) (set! pml-layers (list (make pml (thickness th)))) (set! resolution 10) (use-output-directory) (run-until 300 (at-beginning output-epsilon) (to-appended "ey" (at-every 0.2 (in-volume (volume (center 0 0) (size 10 10)) output-efield-y))) (to-appended "ex" (at-every 0.2 (in-volume (volume (center 0 0) (size 10 10)) output-efield-x))) (to-appended "hy" (at-every 0.2 (in-volume (volume (center 0 0) (size 10 10)) output-hfield-y))) (to-appended "hx" (at-every 0.2 (in-volume (volume (center 0 0) (size 10 10)) output-hfield-x))) ) First time, run it with Ey and set the output as Ex and Ey Second time, run it with Hx and set the output as Hx and Hy. Is that right? Could you please advise. Cheers Jun > > _______________________________________________ > meep-discuss mailing list > [email protected] > http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss > _______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

