[yt-svn] commit/yt: MatthewTurk: Another attempt to regain correctness and speed; this is still a hack. A

Bitbucket commits-noreply at bitbucket.org
Wed Jan 18 11:28:30 PST 2012


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/809ee2b7c150/
changeset:   809ee2b7c150
branch:      yt
user:        MatthewTurk
date:        2012-01-18 20:28:06
summary:     Another attempt to regain correctness and speed; this is still a hack.  A
proper ghost zone generation mechanism would be preferable to this.
affected #:  1 file

diff -r ff156e50f301f69beca2788e23b2de6b334415d6 -r 809ee2b7c150a079cb34a28791f715c0efc3ea01 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -3498,20 +3498,27 @@
         # difference between neighboring areas.
         nz = 0
         buf = 0.0
-        d1 = ((self.global_startindex.astype("float64") - 1)
+        dl = ((self.global_startindex.astype("float64") + 1)
            / (self.pf.refine_by**self.level))
-        if na.any(d1 == na.rint(d1)):
+        dr = ((self.global_startindex.astype("float64")
+              + self.ActiveDimensions - 1)
+           / (self.pf.refine_by**self.level))
+        if na.any(dl == na.rint(dl)) or na.any(dr == na.rint(dr)):
             nz = 2 * self.pf.refine_by**self.level
             buf = self._base_dx
-        cg = self.pf.h.covering_grid(self.level,
-            self.left_edge - buf, self.ActiveDimensions + nz)
-        cg._use_pbar = False
-        count = cg.ActiveDimensions.prod()
-        for g in cg._grids:
-            count -= cg._get_data_from_grid(g, [])
-            if count <= 0:
-                min_level = g.Level
-                break
+        if nz <= self.pf.refine_by**3: # delta level of 3
+            cg = self.pf.h.covering_grid(self.level,
+                self.left_edge - buf, self.ActiveDimensions + nz)
+            cg._use_pbar = False
+            count = cg.ActiveDimensions.prod()
+            for g in cg._grids:
+                count -= cg._get_data_from_grid(g, [])
+                if count <= 0:
+                    min_level = g.Level
+                    break
+        else:
+            nz = buf = 0
+            min_level = 0
         # This should not cost substantial additional time.
         BLE = self.left_edge - buf
         BRE = self.right_edge + buf

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