[Yt-svn] commit/yt: MatthewTurk: This should fix the bug seen with the incremental octree builder for
Bitbucket
commits-noreply at bitbucket.org
Sun Mar 13 17:42:49 PDT 2011
1 new changeset in yt:
http://bitbucket.org/yt_analysis/yt/changeset/af7e30415acd/
changeset: r3816:af7e30415acd
branch: yt
user: MatthewTurk
date: 2011-03-14 01:42:28
summary: This should fix the bug seen with the incremental octree builder for
lack-of-conservation for mass-like quantities.
affected #: 1 file (66 bytes)
--- a/yt/utilities/_amr_utils/Octree.pyx Fri Mar 11 13:56:16 2011 -0600
+++ b/yt/utilities/_amr_utils/Octree.pyx Sun Mar 13 17:42:28 2011 -0700
@@ -51,7 +51,7 @@
self.val[i] += val[i]
self.weight_val += weight_val
-cdef void OTN_refine(OctreeNode *self):
+cdef void OTN_refine(OctreeNode *self, int incremental = 0):
cdef int i, j, i1, j1
cdef np.int64_t npos[3]
cdef OctreeNode *node
@@ -66,6 +66,7 @@
npos,
self.nvals, self.val, self.weight_val,
self.level + 1)
+ if incremental: return
for i in range(self.nvals): self.val[i] = 0.0
self.weight_val = 0.0
@@ -157,7 +158,7 @@
if self.incremental:
OTN_add_value(node, val, weight_val)
if node.children[0][0][0] == NULL:
- OTN_refine(node)
+ OTN_refine(node, self.incremental)
# Maybe we should use bitwise operators?
fac = self.po2[level - L - 1]
i = (pos[0] >= fac*(2*node.pos[0]+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