[yt-svn] commit/yt: xarthisius: [gdf] calculate siblings and child_mask properly. Thanks to Matt for all the work
Bitbucket
commits-noreply at bitbucket.org
Thu Sep 20 11:20:55 PDT 2012
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/changeset/664d83ff5ace/
changeset: 664d83ff5ace
branch: yt
user: xarthisius
date: 2012-09-20 20:18:15
summary: [gdf] calculate siblings and child_mask properly. Thanks to Matt for all the work
affected #: 2 files
diff -r 0afe4bd46a1acc7653831364d4f541eadb45d530 -r 664d83ff5ace2571cd77516ec3c0cf5fb35da771 yt/data_objects/grid_patch.py
--- a/yt/data_objects/grid_patch.py
+++ b/yt/data_objects/grid_patch.py
@@ -364,8 +364,10 @@
self._child_index_mask = None
#@time_execution
- def __fill_child_mask(self, child, mask, tofill):
+ def __fill_child_mask(self, child, mask, tofill, dlevel = 1):
rf = self.pf.refine_by
+ if dlevel != 1:
+ rf = rf**dlevel
gi, cgi = self.get_global_startindex(), child.get_global_startindex()
startIndex = np.maximum(0, cgi / rf - gi)
endIndex = np.minimum((cgi + child.ActiveDimensions) / rf - gi,
@@ -386,7 +388,7 @@
self.__fill_child_mask(child, self._child_mask, 0)
if self.OverlappingSiblings is not None:
for sibling in self.OverlappingSiblings:
- self.__fill_child_mask(sibling, self._child_mask, 0)
+ self.__fill_child_mask(sibling, self._child_mask, 0, 0)
self._child_indices = (self._child_mask==0) # bool, possibly redundant
diff -r 0afe4bd46a1acc7653831364d4f541eadb45d530 -r 664d83ff5ace2571cd77516ec3c0cf5fb35da771 yt/frontends/gdf/data_structures.py
--- a/yt/frontends/gdf/data_structures.py
+++ b/yt/frontends/gdf/data_structures.py
@@ -37,6 +37,8 @@
AMRHierarchy
from yt.data_objects.static_output import \
StaticOutput
+from yt.utilities.lib import \
+ get_box_grids_level
from yt.utilities.definitions import \
mpc_conversion, sec_conversion
@@ -133,14 +135,25 @@
del levels, glis, gdims
def _populate_grid_objects(self):
- for g in self.grids:
+ mask = np.empty(self.grids.size, dtype='int32')
+ for gi, g in enumerate(self.grids):
g._prepare_grid()
g._setup_dx()
- for g in self.grids:
+ for gi, g in enumerate(self.grids):
g.Children = self._get_grid_children(g)
for g1 in g.Children:
g1.Parent.append(g)
+ get_box_grids_level(self.grid_left_edge[gi,:],
+ self.grid_right_edge[gi,:],
+ self.grid_levels[gi],
+ self.grid_left_edge, self.grid_right_edge,
+ self.grid_levels, mask)
+ m = mask.astype("bool")
+ m[gi] = False
+ siblings = self.grids[gi:][m[gi:]]
+ if len(siblings) > 0:
+ g.OverlappingSiblings = siblings.tolist()
self.max_level = self.grid_levels.max()
def _setup_derived_fields(self):
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