[Yt-svn] yt: 2 new changesets

hg at spacepope.org hg at spacepope.org
Tue Aug 10 12:28:55 PDT 2010


hg Repository: yt
details:   yt/rev/999be655b64a
changeset: 1926:999be655b64a
user:      Matthew Turk <matthewturk at gmail.com>
date:
Tue Aug 10 12:18:02 2010 -0700
description:
Adding a check to make sure that grids in RAMSES are all even-numbered in
dimensionality

hg Repository: yt
details:   yt/rev/f5cadbe92674
changeset: 1927:f5cadbe92674
user:      Matthew Turk <matthewturk at gmail.com>
date:
Tue Aug 10 12:28:51 2010 -0700
description:
Fixed a broken merge in the ramses branch

diffstat:

 scripts/fbranch                    |    5 +-
 scripts/fbury                      |    5 +-
 scripts/fdigup                     |    5 +-
 scripts/fido                       |    5 +-
 scripts/fimport                    |    5 +-
 yt/_amr_utils/VolumeIntegrator.pyx |   10 +-
 yt/amr_utils.c                     |  752 ++++++++++++++++++++++-------------------
 yt/extensions/eps_writer.py        |   17 +-
 yt/lagos/BaseGridType.py           |  159 ++++----
 yt/lagos/DataReadingFuncs.py       |   22 +-
 yt/lagos/FLASHFields.py            |   64 +++
 yt/lagos/HierarchyType.py          |  129 ++++++-
 yt/lagos/OutputTypes.py            |   85 +++-
 yt/raven/Callbacks.py              |   75 ++++
 14 files changed, 852 insertions(+), 486 deletions(-)

diffs (truncated from 3150 to 300 lines):

diff -r 2760302d04cb -r f5cadbe92674 scripts/fbranch
--- a/scripts/fbranch	Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fbranch	Tue Aug 10 12:28:51 2010 -0700
@@ -1,4 +1,1 @@
-#!python2.5
-import yt.fido
-
-yt.fido.runAction()
+basic.py
\ No newline at end of file
diff -r 2760302d04cb -r f5cadbe92674 scripts/fbury
--- a/scripts/fbury	Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fbury	Tue Aug 10 12:28:51 2010 -0700
@@ -1,4 +1,1 @@
-#!python2.5
-import yt.fido
-
-yt.fido.runAction()
+basic.py
\ No newline at end of file
diff -r 2760302d04cb -r f5cadbe92674 scripts/fdigup
--- a/scripts/fdigup	Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fdigup	Tue Aug 10 12:28:51 2010 -0700
@@ -1,4 +1,1 @@
-#!python2.5
-import yt.fido
-
-yt.fido.runAction()
+basic.py
\ No newline at end of file
diff -r 2760302d04cb -r f5cadbe92674 scripts/fido
--- a/scripts/fido	Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fido	Tue Aug 10 12:28:51 2010 -0700
@@ -1,4 +1,1 @@
-#!python2.5
-from yt.mods import *
-
-fido.runAction()
+basic.py
\ No newline at end of file
diff -r 2760302d04cb -r f5cadbe92674 scripts/fimport
--- a/scripts/fimport	Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fimport	Tue Aug 10 12:28:51 2010 -0700
@@ -1,4 +1,1 @@
-#!python2.5
-from yt.mods import *
-
-fido.runAction()
+basic.py
\ No newline at end of file
diff -r 2760302d04cb -r f5cadbe92674 yt/_amr_utils/VolumeIntegrator.pyx
--- a/yt/_amr_utils/VolumeIntegrator.pyx	Tue Aug 10 10:49:52 2010 -0700
+++ b/yt/_amr_utils/VolumeIntegrator.pyx	Tue Aug 10 12:28:51 2010 -0700
@@ -106,8 +106,8 @@
     cdef np.float64_t bv, dy, dd, tf
     cdef int bin_id
     if fit.pass_through == 1: return dvs[fit.field_id]
+    if dvs[fit.field_id] > fit.bounds[1] or dvs[fit.field_id] < fit.bounds[0]: return 0.0
     bin_id = <int> ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin)
-    if bin_id > fit.nbins - 2 or bin_id < 0: return 0.0
     dd = dvs[fit.field_id] - (fit.bounds[0] + bin_id * fit.dbin) # x - x0
     bv = fit.values[bin_id]
     dy = fit.values[bin_id + 1] - bv
@@ -411,11 +411,17 @@
         for i in range(3):
             if (v_dir[i] < 0):
                 step[i] = -1
+            elif (v_dir[i] == 0):
+                step[i] = 1
+                tmax[i] = 1e60
+                iv_dir[i] = 1e60
+                tdelta[i] = 1e-60
+                continue
             else:
                 step[i] = 1
             x = (i+1) % 3
             y = (i+2) % 3
-            iv_dir[i] = 1.0/v_dir[0]
+            iv_dir[i] = 1.0/v_dir[i]
             tl = (self.left_edge[i] - v_pos[i])*iv_dir[i]
             temp_x = (v_pos[x] + tl*v_dir[x])
             temp_y = (v_pos[y] + tl*v_dir[y])
diff -r 2760302d04cb -r f5cadbe92674 yt/amr_utils.c
--- a/yt/amr_utils.c	Tue Aug 10 10:49:52 2010 -0700
+++ b/yt/amr_utils.c	Tue Aug 10 12:28:51 2010 -0700
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.13.beta0 on Sun Aug  1 22:53:21 2010 */
+/* Generated by Cython 0.13.beta0 on Mon Aug  2 07:18:26 2010 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -480,7 +480,7 @@
   PyObject *grids;
 };
 
-/* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":569
+/* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":575
  *         return 1
  * 
  * cdef class ProtoPrism:             # <<<<<<<<<<<<<<
@@ -513,7 +513,7 @@
   int refined_pos;
 };
 
-/* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":537
+/* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":543
  *             tf.eval_transfer(dt, self.dvs, rgba, grad)
  * 
  * cdef class GridFace:             # <<<<<<<<<<<<<<
@@ -605,7 +605,7 @@
 };
 
 
-/* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":537
+/* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":543
  *             tf.eval_transfer(dt, self.dvs, rgba, grad)
  * 
  * cdef class GridFace:             # <<<<<<<<<<<<<<
@@ -633,7 +633,7 @@
 static struct __pyx_vtabstruct_2yt_9amr_utils_TransferFunctionProxy *__pyx_vtabptr_2yt_9amr_utils_TransferFunctionProxy;
 
 
-/* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":569
+/* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":575
  *         return 1
  * 
  * cdef class ProtoPrism:             # <<<<<<<<<<<<<<
@@ -13389,8 +13389,8 @@
  *     cdef np.float64_t bv, dy, dd, tf
  *     cdef int bin_id
  *     if fit.pass_through == 1: return dvs[fit.field_id]             # <<<<<<<<<<<<<<
+ *     if dvs[fit.field_id] > fit.bounds[1] or dvs[fit.field_id] < fit.bounds[0]: return 0.0
  *     bin_id = <int> ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin)
- *     if bin_id > fit.nbins - 2 or bin_id < 0: return 0.0
  */
   __pyx_t_1 = (__pyx_v_fit->pass_through == 1);
   if (__pyx_t_1) {
@@ -13403,22 +13403,13 @@
   /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":109
  *     cdef int bin_id
  *     if fit.pass_through == 1: return dvs[fit.field_id]
- *     bin_id = <int> ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin)             # <<<<<<<<<<<<<<
- *     if bin_id > fit.nbins - 2 or bin_id < 0: return 0.0
+ *     if dvs[fit.field_id] > fit.bounds[1] or dvs[fit.field_id] < fit.bounds[0]: return 0.0             # <<<<<<<<<<<<<<
+ *     bin_id = <int> ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin)
  *     dd = dvs[fit.field_id] - (fit.bounds[0] + bin_id * fit.dbin) # x - x0
  */
-  __pyx_v_bin_id = ((int)(((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->bounds[0])) * __pyx_v_fit->idbin));
-
-  /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":110
- *     if fit.pass_through == 1: return dvs[fit.field_id]
- *     bin_id = <int> ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin)
- *     if bin_id > fit.nbins - 2 or bin_id < 0: return 0.0             # <<<<<<<<<<<<<<
- *     dd = dvs[fit.field_id] - (fit.bounds[0] + bin_id * fit.dbin) # x - x0
- *     bv = fit.values[bin_id]
- */
-  __pyx_t_1 = (__pyx_v_bin_id > (__pyx_v_fit->nbins - 2));
+  __pyx_t_1 = ((__pyx_v_dvs[__pyx_v_fit->field_id]) > (__pyx_v_fit->bounds[1]));
   if (!__pyx_t_1) {
-    __pyx_t_2 = (__pyx_v_bin_id < 0);
+    __pyx_t_2 = ((__pyx_v_dvs[__pyx_v_fit->field_id]) < (__pyx_v_fit->bounds[0]));
     __pyx_t_3 = __pyx_t_2;
   } else {
     __pyx_t_3 = __pyx_t_1;
@@ -13430,9 +13421,18 @@
   }
   __pyx_L4:;
 
+  /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":110
+ *     if fit.pass_through == 1: return dvs[fit.field_id]
+ *     if dvs[fit.field_id] > fit.bounds[1] or dvs[fit.field_id] < fit.bounds[0]: return 0.0
+ *     bin_id = <int> ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin)             # <<<<<<<<<<<<<<
+ *     dd = dvs[fit.field_id] - (fit.bounds[0] + bin_id * fit.dbin) # x - x0
+ *     bv = fit.values[bin_id]
+ */
+  __pyx_v_bin_id = ((int)(((__pyx_v_dvs[__pyx_v_fit->field_id]) - (__pyx_v_fit->bounds[0])) * __pyx_v_fit->idbin));
+
   /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":111
+ *     if dvs[fit.field_id] > fit.bounds[1] or dvs[fit.field_id] < fit.bounds[0]: return 0.0
  *     bin_id = <int> ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin)
- *     if bin_id > fit.nbins - 2 or bin_id < 0: return 0.0
  *     dd = dvs[fit.field_id] - (fit.bounds[0] + bin_id * fit.dbin) # x - x0             # <<<<<<<<<<<<<<
  *     bv = fit.values[bin_id]
  *     dy = fit.values[bin_id + 1] - bv
@@ -13440,7 +13440,7 @@
   __pyx_v_dd = ((__pyx_v_dvs[__pyx_v_fit->field_id]) - ((__pyx_v_fit->bounds[0]) + (__pyx_v_bin_id * __pyx_v_fit->dbin)));
 
   /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":112
- *     if bin_id > fit.nbins - 2 or bin_id < 0: return 0.0
+ *     bin_id = <int> ((dvs[fit.field_id] - fit.bounds[0]) * fit.idbin)
  *     dd = dvs[fit.field_id] - (fit.bounds[0] + bin_id * fit.dbin) # x - x0
  *     bv = fit.values[bin_id]             # <<<<<<<<<<<<<<
  *     dy = fit.values[bin_id + 1] - bv
@@ -16440,7 +16440,7 @@
  *         for i in range(3):
  *             if (v_dir[i] < 0):             # <<<<<<<<<<<<<<
  *                 step[i] = -1
- *             else:
+ *             elif (v_dir[i] == 0):
  */
     __pyx_t_2 = ((__pyx_v_v_dir[__pyx_v_i]) < 0.0);
     if (__pyx_t_2) {
@@ -16449,16 +16449,73 @@
  *         for i in range(3):
  *             if (v_dir[i] < 0):
  *                 step[i] = -1             # <<<<<<<<<<<<<<
- *             else:
+ *             elif (v_dir[i] == 0):
  *                 step[i] = 1
  */
       (__pyx_v_step[__pyx_v_i]) = -1;
       goto __pyx_L5;
     }
-    /*else*/ {
+
+    /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":414
+ *             if (v_dir[i] < 0):
+ *                 step[i] = -1
+ *             elif (v_dir[i] == 0):             # <<<<<<<<<<<<<<
+ *                 step[i] = 1
+ *                 tmax[i] = 1e60
+ */
+    __pyx_t_2 = ((__pyx_v_v_dir[__pyx_v_i]) == 0.0);
+    if (__pyx_t_2) {
 
       /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":415
  *                 step[i] = -1
+ *             elif (v_dir[i] == 0):
+ *                 step[i] = 1             # <<<<<<<<<<<<<<
+ *                 tmax[i] = 1e60
+ *                 iv_dir[i] = 1e60
+ */
+      (__pyx_v_step[__pyx_v_i]) = 1;
+
+      /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":416
+ *             elif (v_dir[i] == 0):
+ *                 step[i] = 1
+ *                 tmax[i] = 1e60             # <<<<<<<<<<<<<<
+ *                 iv_dir[i] = 1e60
+ *                 tdelta[i] = 1e-60
+ */
+      (__pyx_v_tmax[__pyx_v_i]) = 1e60;
+
+      /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":417
+ *                 step[i] = 1
+ *                 tmax[i] = 1e60
+ *                 iv_dir[i] = 1e60             # <<<<<<<<<<<<<<
+ *                 tdelta[i] = 1e-60
+ *                 continue
+ */
+      (__pyx_v_iv_dir[__pyx_v_i]) = 1e60;
+
+      /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":418
+ *                 tmax[i] = 1e60
+ *                 iv_dir[i] = 1e60
+ *                 tdelta[i] = 1e-60             # <<<<<<<<<<<<<<
+ *                 continue
+ *             else:
+ */
+      (__pyx_v_tdelta[__pyx_v_i]) = 1e-60;
+
+      /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":419
+ *                 iv_dir[i] = 1e60
+ *                 tdelta[i] = 1e-60
+ *                 continue             # <<<<<<<<<<<<<<
+ *             else:
+ *                 step[i] = 1
+ */
+      goto __pyx_L3_continue;
+      goto __pyx_L5;
+    }
+    /*else*/ {
+
+      /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":421
+ *                 continue
  *             else:
  *                 step[i] = 1             # <<<<<<<<<<<<<<
  *             x = (i+1) % 3
@@ -16468,49 +16525,49 @@
     }
     __pyx_L5:;
 
-    /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":416
+    /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":422
  *             else:
  *                 step[i] = 1
  *             x = (i+1) % 3             # <<<<<<<<<<<<<<
  *             y = (i+2) % 3
- *             iv_dir[i] = 1.0/v_dir[0]
+ *             iv_dir[i] = 1.0/v_dir[i]
  */
     __pyx_v_x = __Pyx_mod_long((__pyx_v_i + 1), 3);
 
-    /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":417
+    /* "/Users/matthewturk/yt/yt/yt/_amr_utils/VolumeIntegrator.pyx":423
  *                 step[i] = 1
  *             x = (i+1) % 3
  *             y = (i+2) % 3             # <<<<<<<<<<<<<<
- *             iv_dir[i] = 1.0/v_dir[0]
+ *             iv_dir[i] = 1.0/v_dir[i]



More information about the yt-svn mailing list