[Yt-svn] commit/yt: samskillman: For some reason I'm running into situations where the left/right corners of kd tree bricks can overlap in one of the dimensions, which leads to failures on the PartitionedGrid creation. This only showed up after the recent update of the smoothed covering grids, but I'm guessing the old way was more lenient. This now works for me, but perhaps warrants some more digging.

Bitbucket commits-noreply at bitbucket.org
Mon Sep 12 09:28:35 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/03c0d3cc2e1b/
changeset:   03c0d3cc2e1b
branch:      yt
user:        samskillman
date:        2011-09-12 18:17:15
summary:     For some reason I'm running into situations where the left/right corners of kd tree bricks can overlap in one of the dimensions, which leads to failures on the PartitionedGrid creation.  This only showed up after the recent update of the smoothed covering grids, but I'm guessing the old way was more lenient.  This now works for me, but perhaps warrants some more digging.
affected #:  1 file (215 bytes)

--- a/yt/utilities/amr_kdtree/amr_kdtree.py	Fri Sep 09 11:51:19 2011 -0400
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py	Mon Sep 12 12:17:15 2011 -0400
@@ -547,11 +547,14 @@
                 data = [d[current_node.li[0]:current_node.ri[0]+1,
                           current_node.li[1]:current_node.ri[1]+1,
                           current_node.li[2]:current_node.ri[2]+1].copy() for d in dds]
-
-                current_node.brick = PartitionedGrid(current_node.grid.id, len(self.fields), data,
-                                                        current_node.l_corner.copy(), 
-                                                        current_node.r_corner.copy(), 
-                                                        current_node.dims.astype('int64'))
+                
+                if na.any(current_node.r_corner-current_node.l_corner == 0):
+                    current_node.brick = None
+                else:
+                    current_node.brick = PartitionedGrid(current_node.grid.id, len(self.fields), data,
+                                                         current_node.l_corner.copy(), 
+                                                         current_node.r_corner.copy(), 
+                                                         current_node.dims.astype('int64'))
                 self.bricks.append(current_node.brick)
                 self.brick_dimensions.append(current_node.dims)
         self.bricks = na.array(self.bricks)
@@ -1010,7 +1013,8 @@
 
         for node in self.viewpoint_traverse(viewpoint):
             if node.grid is not None:
-                yield node.brick
+                if node.brick is not None:
+                    yield node.brick
          
         self.reduce_tree_images(self.tree, front_center)
         self._barrier()

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