On Sun, 31 Dec 2006, V.Sokolov wrote:
if I try to get total power pattern using "output-tot-pwr", the programs stops with the "meep: too many field components" message. However, "output-dpwr" and "output-hpwr" work fine. Wouldn't you help me?

Thanks, this is a bug.  The patch below should fix the problem.

Steven

diff -rN -u old-meep/src/h5fields.cpp new-meep/src/h5fields.cpp
--- old-meep/src/h5fields.cpp   2006-08-08 18:16:37.000000000 -0400
+++ new-meep/src/h5fields.cpp   2007-01-02 21:25:08.000000000 -0500
@@ -399,7 +399,7 @@
   if (coordinate_mismatch(v.dim, c)) return;

   int nfields;
-  component cs[6];
+  component cs[12];
   field_rfunction fun = derived_component_func(c, v, nfields, cs);

   output_hdf5(component_name(c), nfields, cs, fun, &nfields, where,
diff -rN -u old-meep/src/integrate.cpp new-meep/src/integrate.cpp
--- old-meep/src/integrate.cpp  2006-03-27 21:44:04.000000000 -0500
+++ new-meep/src/integrate.cpp  2007-01-02 21:25:21.000000000 -0500
@@ -241,7 +241,7 @@
   if (!is_derived(int(c)))
     return max_abs(component(c), where);
   int nfields;
-  component cs[6];
+  component cs[12];
   field_rfunction fun = derived_component_func(c, v, nfields, cs);
   return max_abs(nfields, cs, fun, &nfields, where);
 }
diff -rN -u old-meep/src/meep.hpp new-meep/src/meep.hpp
--- old-meep/src/meep.hpp       2006-09-18 21:49:59.000000000 -0400
+++ new-meep/src/meep.hpp       2007-01-02 21:24:49.000000000 -0500
@@ -749,7 +749,7 @@
                                   void *integrand_data_);

 field_rfunction derived_component_func(derived_component c, const volume &v,
-                                      int &nfields, component cs[6]);
+                                      int &nfields, component cs[12]);

 class fields {
  public:
diff -rN -u old-meep/src/vec.cpp new-meep/src/vec.cpp
--- old-meep/src/vec.cpp        2006-08-02 19:48:39.000000000 -0400
+++ new-meep/src/vec.cpp        2007-01-02 21:25:45.000000000 -0500
@@ -1403,7 +1403,7 @@
 }

 field_rfunction derived_component_func(derived_component c, const volume &v,
-                                      int &nfields, component cs[6]) {
+                                      int &nfields, component cs[12]) {
   switch (c) {
   case Sx: case Sy: case Sz: case Sr: case Sp:
     switch (c) {
@@ -1431,7 +1431,7 @@
        cs[nfields++] = c0;
        cs[nfields++] = c0;
       }
-    if (nfields > 6) abort("too many field components");
+    if (nfields > 12) abort("too many field components");
     return energy_fun;

   default:



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

Reply via email to