[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jan 22 06:18:38 PST 2014
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/dee77de3f9b4/
Changeset: dee77de3f9b4
Branch: yt-3.0
User: MatthewTurk
Date: 2014-01-17 21:07:55
Summary: Enable octree refinement masks to be 0, 1, or 8.
When the mask is 8, that indicates that this oct has been refined into 8
children, even if oref == 1. This enables interoperability with Hyperion.
Affected #: 2 files
diff -r e36747eede95c5d99764191d2b5c937852861dce -r dee77de3f9b41f83b37313b03f4f5eee08d0d6e5 yt/geometry/oct_container.pyx
--- a/yt/geometry/oct_container.pyx
+++ b/yt/geometry/oct_container.pyx
@@ -126,14 +126,12 @@
cdef SelectorObject selector = selection_routines.AlwaysSelector(None)
cdef OctVisitorData data
obj.setup_data(&data, -1)
- assert(ref_mask.shape[0] / 8.0 == <int>(ref_mask.shape[0]/8.0))
- obj.allocate_domains([ref_mask.shape[0] / 8.0])
cdef int i, j, k, n
data.global_index = -1
data.level = 0
- # This is not something I terribly like, but it needs to be done.
- data.oref = 1
- data.nz = 8
+ 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])
cdef np.float64_t pos[3], dds[3]
# This dds is the oct-width
for i in range(3):
@@ -173,8 +171,7 @@
pos[1] += dds[1]
pos[0] += dds[0]
obj.nocts = cur.n_assigned
- if obj.nocts * 8 != ref_mask.size:
- print "SOMETHING WRONG", ref_mask.size, obj.nocts, obj.oref
+ if obj.nocts * data.nz != ref_mask.size:
raise KeyError(ref_mask.size, obj.nocts, obj.oref,
obj.partial_coverage)
return obj
diff -r e36747eede95c5d99764191d2b5c937852861dce -r dee77de3f9b41f83b37313b03f4f5eee08d0d6e5 yt/geometry/oct_visitors.pyx
--- a/yt/geometry/oct_visitors.pyx
+++ b/yt/geometry/oct_visitors.pyx
@@ -202,15 +202,22 @@
o.file_ind = nfinest[0]
o.domain = 1
nfinest[0] += 1
- elif arr[data.index] == 1:
+ elif arr[data.index] > 0:
+ if arr[data.index] != 1 and arr[data.index] != 8:
+ print "ARRAY CLUE: ", arr[data.index], "UNKNOWN"
+ raise RuntimeError
if o.children == NULL:
o.children = <Oct **> malloc(sizeof(Oct *) * 8)
for i in range(8):
o.children[i] = NULL
- o.children[ii] = &octs[nocts[0]]
- o.children[ii].domain_ind = nocts[0]
- o.children[ii].file_ind = -1
- o.children[ii].domain = -1
- o.children[ii].children = NULL
- nocts[0] += 1
+ for i in range(arr[data.index]):
+ o.children[ii + i] = &octs[nocts[0]]
+ o.children[ii + i].domain_ind = nocts[0]
+ o.children[ii + i].file_ind = -1
+ o.children[ii + i].domain = -1
+ o.children[ii + i].children = NULL
+ nocts[0] += 1
+ else:
+ print "SOMETHING IS AMISS", data.index
+ raise RuntimeError
data.index += 1
https://bitbucket.org/yt_analysis/yt/commits/b3e969705199/
Changeset: b3e969705199
Branch: yt-3.0
User: MatthewTurk
Date: 2014-01-22 15:18:33
Summary: Merged in MatthewTurk/yt/yt-3.0 (pull request #691)
Enable octree refinement masks to be 0, 1, or 8.
Affected #: 2 files
diff -r 5edcb35f319179e22925db71ef7adf5122595282 -r b3e969705199c12226c7e8e24a3f7d110f872e56 yt/geometry/oct_container.pyx
--- a/yt/geometry/oct_container.pyx
+++ b/yt/geometry/oct_container.pyx
@@ -126,14 +126,12 @@
cdef SelectorObject selector = selection_routines.AlwaysSelector(None)
cdef OctVisitorData data
obj.setup_data(&data, -1)
- assert(ref_mask.shape[0] / 8.0 == <int>(ref_mask.shape[0]/8.0))
- obj.allocate_domains([ref_mask.shape[0] / 8.0])
cdef int i, j, k, n
data.global_index = -1
data.level = 0
- # This is not something I terribly like, but it needs to be done.
- data.oref = 1
- data.nz = 8
+ 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])
cdef np.float64_t pos[3], dds[3]
# This dds is the oct-width
for i in range(3):
@@ -173,8 +171,7 @@
pos[1] += dds[1]
pos[0] += dds[0]
obj.nocts = cur.n_assigned
- if obj.nocts * 8 != ref_mask.size:
- print "SOMETHING WRONG", ref_mask.size, obj.nocts, obj.oref
+ if obj.nocts * data.nz != ref_mask.size:
raise KeyError(ref_mask.size, obj.nocts, obj.oref,
obj.partial_coverage)
return obj
diff -r 5edcb35f319179e22925db71ef7adf5122595282 -r b3e969705199c12226c7e8e24a3f7d110f872e56 yt/geometry/oct_visitors.pyx
--- a/yt/geometry/oct_visitors.pyx
+++ b/yt/geometry/oct_visitors.pyx
@@ -202,15 +202,22 @@
o.file_ind = nfinest[0]
o.domain = 1
nfinest[0] += 1
- elif arr[data.index] == 1:
+ elif arr[data.index] > 0:
+ if arr[data.index] != 1 and arr[data.index] != 8:
+ print "ARRAY CLUE: ", arr[data.index], "UNKNOWN"
+ raise RuntimeError
if o.children == NULL:
o.children = <Oct **> malloc(sizeof(Oct *) * 8)
for i in range(8):
o.children[i] = NULL
- o.children[ii] = &octs[nocts[0]]
- o.children[ii].domain_ind = nocts[0]
- o.children[ii].file_ind = -1
- o.children[ii].domain = -1
- o.children[ii].children = NULL
- nocts[0] += 1
+ for i in range(arr[data.index]):
+ o.children[ii + i] = &octs[nocts[0]]
+ o.children[ii + i].domain_ind = nocts[0]
+ o.children[ii + i].file_ind = -1
+ o.children[ii + i].domain = -1
+ o.children[ii + i].children = NULL
+ nocts[0] += 1
+ else:
+ print "SOMETHING IS AMISS", data.index
+ raise RuntimeError
data.index += 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