[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Jun 10 12:08:10 PDT 2014
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/39076ab9ae33/
Changeset: 39076ab9ae33
Branch: yt-3.0
User: MatthewTurk
Date: 2014-06-09 21:20:38
Summary: Experimenting with save_octree and order of traversal.
Affected #: 2 files
diff -r 38fb987566a13b96956e4be610432a185b8a8b2f -r 39076ab9ae33cf835aad0b0b0a276aa2634c24ec yt/geometry/oct_container.pyx
--- a/yt/geometry/oct_container.pyx
+++ b/yt/geometry/oct_container.pyx
@@ -496,7 +496,7 @@
coords[:,i] += self.DLE[i]
return coords
- def save_octree(self, always_descend = False):
+ def save_octree(self):
# Get the header
header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]),
left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]),
@@ -507,13 +507,12 @@
# domain_id = -1 here, because we want *every* oct
cdef OctVisitorData data
self.setup_data(&data, -1)
- data.oref = 1
+ data.oref = 0
+ data.nz = 1
cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
ref_mask = np.zeros(self.nocts * data.nz, dtype="uint8") - 1
- cdef void *p[2]
- cdef np.uint8_t ad = int(always_descend)
- p[0] = <void *> &ad
- p[1] = ref_mask.data
+ cdef void *p[1]
+ p[0] = ref_mask.data
data.array = p
# Enforce partial_coverage here
self.visit_all_octs(selector, oct_visitors.store_octree, &data, 1)
diff -r 38fb987566a13b96956e4be610432a185b8a8b2f -r 39076ab9ae33cf835aad0b0b0a276aa2634c24ec yt/geometry/oct_visitors.pyx
--- a/yt/geometry/oct_visitors.pyx
+++ b/yt/geometry/oct_visitors.pyx
@@ -179,12 +179,8 @@
cdef np.uint8_t *arr, res, ii, *always_descend
ii = cind(data.ind[0], data.ind[1], data.ind[2])
cdef void **p = <void **> data.array
- always_descend = <np.uint8_t *> p[0]
- arr = <np.uint8_t *> p[1]
- if always_descend[0] == 1 and data.last == o.domain_ind:
- return
- data.last = o.domain_ind
- if o.children == NULL or o.children[ii] == NULL:
+ arr = <np.uint8_t *> p[0]
+ if o.children == NULL:
# Not refined.
res = 0
else:
https://bitbucket.org/yt_analysis/yt/commits/7c64b50ecee8/
Changeset: 7c64b50ecee8
Branch: yt-3.0
User: MatthewTurk
Date: 2014-06-10 20:17:16
Summary: Fixing load/save octree. Get rid of *8 nonsense.
Affected #: 2 files
diff -r 39076ab9ae33cf835aad0b0b0a276aa2634c24ec -r 7c64b50ecee88d56f881b251f9d4b8f0b10159b9 yt/geometry/oct_container.pyx
--- a/yt/geometry/oct_container.pyx
+++ b/yt/geometry/oct_container.pyx
@@ -122,6 +122,8 @@
cdef int i, j, k, n
data.global_index = -1
data.level = 0
+ data.oref = 0
+ data.nz = 1
assert(ref_mask.shape[0] / float(data.nz) ==
<int>(ref_mask.shape[0]/float(data.nz)))
obj.allocate_domains([ref_mask.shape[0] / data.nz])
diff -r 39076ab9ae33cf835aad0b0b0a276aa2634c24ec -r 7c64b50ecee88d56f881b251f9d4b8f0b10159b9 yt/geometry/oct_visitors.pyx
--- a/yt/geometry/oct_visitors.pyx
+++ b/yt/geometry/oct_visitors.pyx
@@ -212,7 +212,7 @@
o.children = <Oct **> malloc(sizeof(Oct *) * 8)
for i in range(8):
o.children[i] = NULL
- for i in range(arr[data.index]):
+ for i in range(8):
o.children[ii + i] = &octs[nocts[0]]
o.children[ii + i].domain_ind = nocts[0]
o.children[ii + i].file_ind = -1
https://bitbucket.org/yt_analysis/yt/commits/4212f2e4935a/
Changeset: 4212f2e4935a
Branch: yt-3.0
User: MatthewTurk
Date: 2014-06-10 21:08:03
Summary: Merged in MatthewTurk/yt/yt-3.0 (pull request #941)
Make save_octree operate on leaf nodes
Affected #: 2 files
diff -r a83501174991ae2fae2b7a4aa4f9234296976cf3 -r 4212f2e4935a998a06fceea23f1382976ef2748a yt/geometry/oct_container.pyx
--- a/yt/geometry/oct_container.pyx
+++ b/yt/geometry/oct_container.pyx
@@ -122,6 +122,8 @@
cdef int i, j, k, n
data.global_index = -1
data.level = 0
+ data.oref = 0
+ data.nz = 1
assert(ref_mask.shape[0] / float(data.nz) ==
<int>(ref_mask.shape[0]/float(data.nz)))
obj.allocate_domains([ref_mask.shape[0] / data.nz])
@@ -496,7 +498,7 @@
coords[:,i] += self.DLE[i]
return coords
- def save_octree(self, always_descend = False):
+ def save_octree(self):
# Get the header
header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]),
left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]),
@@ -507,13 +509,12 @@
# domain_id = -1 here, because we want *every* oct
cdef OctVisitorData data
self.setup_data(&data, -1)
- data.oref = 1
+ data.oref = 0
+ data.nz = 1
cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
ref_mask = np.zeros(self.nocts * data.nz, dtype="uint8") - 1
- cdef void *p[2]
- cdef np.uint8_t ad = int(always_descend)
- p[0] = <void *> &ad
- p[1] = ref_mask.data
+ cdef void *p[1]
+ p[0] = ref_mask.data
data.array = p
# Enforce partial_coverage here
self.visit_all_octs(selector, oct_visitors.store_octree, &data, 1)
diff -r a83501174991ae2fae2b7a4aa4f9234296976cf3 -r 4212f2e4935a998a06fceea23f1382976ef2748a yt/geometry/oct_visitors.pyx
--- a/yt/geometry/oct_visitors.pyx
+++ b/yt/geometry/oct_visitors.pyx
@@ -179,12 +179,8 @@
cdef np.uint8_t *arr, res, ii, *always_descend
ii = cind(data.ind[0], data.ind[1], data.ind[2])
cdef void **p = <void **> data.array
- always_descend = <np.uint8_t *> p[0]
- arr = <np.uint8_t *> p[1]
- if always_descend[0] == 1 and data.last == o.domain_ind:
- return
- data.last = o.domain_ind
- if o.children == NULL or o.children[ii] == NULL:
+ arr = <np.uint8_t *> p[0]
+ if o.children == NULL:
# Not refined.
res = 0
else:
@@ -216,7 +212,7 @@
o.children = <Oct **> malloc(sizeof(Oct *) * 8)
for i in range(8):
o.children[i] = NULL
- for i in range(arr[data.index]):
+ for i in range(8):
o.children[ii + i] = &octs[nocts[0]]
o.children[ii + i].domain_ind = nocts[0]
o.children[ii + i].file_ind = -1
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list