[Yt-svn] yt: First draft of gadget revisions
hg at spacepope.org
hg at spacepope.org
Tue Aug 10 11:34:36 PDT 2010
hg Repository: yt
details: yt/rev/ed1a7300a088
changeset: 1924:ed1a7300a088
user: Christopher Erick Moody <cemoody at ucsc.edu>
date:
Tue Aug 10 11:23:22 2010 -0700
description:
First draft of gadget revisions
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 | 8 +-
yt/lagos/BaseGridType.py | 143 ++-----
yt/lagos/DataReadingFuncs.py | 39 +-
yt/lagos/FLASHFields.py | 64 +++
yt/lagos/HierarchyType.py | 268 +++++---------
yt/lagos/OutputTypes.py | 153 +++----
yt/lagos/__init__.py | 1 -
yt/raven/Callbacks.py | 75 ++++
yt/setup.py | 8 -
16 files changed, 793 insertions(+), 753 deletions(-)
diffs (truncated from 3335 to 300 lines):
diff -r 2760302d04cb -r ed1a7300a088 scripts/fbranch
--- a/scripts/fbranch Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fbranch Tue Aug 10 11:23:22 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 ed1a7300a088 scripts/fbury
--- a/scripts/fbury Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fbury Tue Aug 10 11:23:22 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 ed1a7300a088 scripts/fdigup
--- a/scripts/fdigup Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fdigup Tue Aug 10 11:23:22 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 ed1a7300a088 scripts/fido
--- a/scripts/fido Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fido Tue Aug 10 11:23:22 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 ed1a7300a088 scripts/fimport
--- a/scripts/fimport Tue Aug 10 10:49:52 2010 -0700
+++ b/scripts/fimport Tue Aug 10 11:23:22 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 ed1a7300a088 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 11:23:22 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 ed1a7300a088 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 11:23:22 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