[yt-svn] commit/yt-3.0: MatthewTurk: This allows RAMSES domains to extend to negative values.

Bitbucket commits-noreply at bitbucket.org
Wed Dec 19 04:13:31 PST 2012


1 new commit in yt-3.0:


https://bitbucket.org/yt_analysis/yt-3.0/changeset/befae3c21101/
changeset:   befae3c21101
branch:      yt-3.0
user:        MatthewTurk
date:        2012-12-19 13:12:16
summary:     This allows RAMSES domains to extend to negative values.

Previously, calculating the root mesh incorrectly truncated the integer
position of the cell location.
affected #:  1 file

diff -r 5dc083e28333595fd324a31149fb45885c72a088 -r befae3c21101a8f584e18e06f27c33b008bee324 yt/geometry/oct_container.pyx
--- a/yt/geometry/oct_container.pyx
+++ b/yt/geometry/oct_container.pyx
@@ -24,6 +24,7 @@
 """
 
 from libc.stdlib cimport malloc, free
+from libc.math cimport floor
 cimport numpy as np
 import numpy as np
 from oct_container cimport Oct, OctAllocationContainer, OctreeContainer
@@ -145,7 +146,7 @@
         for i in range(3):
             pp[i] = ppos[i] - self.DLE[i]
             dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
-            ind[i] = <np.int64_t> (pp[i]/dds[i])
+            ind[i] = <np.int64_t> (floor(pp[i]/dds[i]))
             cp[i] = (ind[i] + 0.5) * dds[i]
         cur = self.root_mesh[ind[0]][ind[1]][ind[2]]
         while cur.children[0][0][0] != NULL:

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

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