On Thu, 20 Dec 2007, Manoj Rajagopalan wrote:
>   Does anyone know what outputs the *.00.h5 files store and what the
> *.50.h5 store? I have only one f.output_hdf5 statement in my program
> (fields f). Is one for the electric field and the other for the magnetic
> field since they are computed at different half-steps of each step?

The number in the filename is the time (in meep c/a units) to two decimal 
places.  For example:

        ring-ez-000305.25.h5

is the Ez field from ring.ctl at time 305.25.  If you look in the C++ 
code, this filename is set in fields::h5file_name.

Now that I think about it, I'm not sure this naming convention is always 
the best idea.  Since the units in Meep are arbitrary, it is possible to 
set the lengthscales so that the time step is < 0.01 ... in this case you 
might have a problem because files from different time steps will have the 
same name.  (Alternatively, if the timestamp is too large then it is 
annoying because the filenames could get rather long and of variable 
length so that they don't sort properly.)

I never noticed this before because we always recommend using natural 
units of distance, so that your wavelength is of order unity ... in this 
case, for any reasonable resolution the timestep is normally going to be 
at least 0.01.  (Or even if you crank up the resolution to be extremely 
large, you probably aren't going to output h5 files every timestep.)

For the next Meep release, I'll change it so that if the time step is < 
0.01 or too large then the filename uses the integer timestep count as a 
timestamp instead of the time.  Otherwise, it will stick with the current 
behavior (which is convenient since that way the filenames are independent 
of resolution).  If anyone needs the patch now, I've attached it below.

(It is also possible to completely control the output filename manually if 
you use lower-level functions, of course.)

Regards,
Steven G. Johnson

--- old-meep/src/h5fields.cpp   2007-12-21 19:55:23.480617059 -0500
+++ new-meep/src/h5fields.cpp   2007-12-21 19:55:23.771574190 -0500
@@ -416,7 +416,12 @@
    static char filename[buflen];
    char time_step_string[32] = "";

-  if (timestamp) snprintf(time_step_string, 32, "-%09.2f", time());
+  if (timestamp) {
+    if (dt >= 0.01 && dt < 10)
+      snprintf(time_step_string, 32, "-%09.2f", time());
+    else
+      snprintf(time_step_string, 32, "-%09d", t);
+  }

    snprintf(filename, buflen, "%s/" "%s%s" "%s" "%s" ".h5",
           outdir,


_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to