Hi Bin, Take a look at meep.scm in /libctl, stop-when-fields-decayed is defined in there. If you open it, you can see it it calls meep::fields::get_field, and stores the maximum value of some time (dT), at the end it then compares this value with the initial value and decides if it has decayed by the given amount.
To save fields components in a certain volume at every t_step, open an h5file using: meep::fields::open_h5file. Call meep::fields::time to check if dT has passed since your last save. Call meep::fields::output_hdf5(component c, const volume &where, h5file *file /*the file you just created*/, true /*true to append data*/, bool single_precision = false, const char *prefix = 0); to save field components in the desired volume. Don't forget to free the h5_file. Arthur On 3 October 2010 17:50, Bin Huang <[email protected]> wrote: > Hi guys, > > Is there any way I can implement this scheme syntax in C++? > > (run-sources+ (stop-when-fields-decayed > 50 Ey > (vector3 (- (* 0.5 sx) dpml 0.5) 0) > 1e-3) > (during-sources > (in-volume (volume (center 0 0) (size sx 0)) > (to-appended "hz-slice" (at-every 0.4 output-hfield-z))))) > > It seems like usually the while loop is as follows: > --------------------------- > while ( f.time() < f.last_source_time()+400) > { > f.step(); > f.output_hdf5(Ey, vol.surroundings()); > } > --------------------------- > How do I increment the time in steps of 50 time units till Ey has decayed > to 1/1000 on the plane indicated by "(vector3 (- (* 0.5 sx) dpml 0.5) 0)"? > How do I output hfield on that slice indicated by "(volume (center 0 0) > (size sx 0))" every 0.4 time unit? It seems like f.output_hdf5() can only > output the field data in the entire waveguide. > > Thanks a lot in advance. > -- > Bin Huang (Bryan) > MIT Graduate Student '10 > Computation for Design and Optimization > (+65)98947649 > _______________________________________________ > 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

