[yt-svn] commit/yt-3.0: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Aug 28 08:16:14 PDT 2013
2 new commits in yt-3.0:
https://bitbucket.org/yt_analysis/yt-3.0/commits/89a35feb1443/
Changeset: 89a35feb1443
Branch: yt-3.0
User: MatthewTurk
Date: 2013-08-23 02:47:30
Summary: This enables find_max for RAMSES.
Note that in many cases, find_max already worked! In fact, if finest_levels
were specified to be false, it would have worked just fine as-is. But what
this will do is ensure that find_max works in all cases, but specifically those
cases where the maximum "level" of the Octree is not the same as levelmax in
the header file -- as in, those simulations which have not yet refined to their
maximum level yet. In those cases, no domains would be selected in the
inclusion check for the "all_data" selector, and the max would not be found.
This change makes two distinctions:
ds.h.max_level
ds.max_level
These are no longer the same. The former is the maximum *reached* level of
refinement, whereas the latter is the maximum *possible* level of refinement.
I believe that this behavior is valid, although I am not terribly fond of it.
Affected #: 1 file
diff -r 2c8e6279eb37d4966d28f951e3831e1aefea2baa -r 89a35feb1443686c3e18ed7f251cdc6f81bdf3de yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -215,6 +215,7 @@
self.amr_header['nboundary']*l]
return ng
min_level = self.pf.min_level
+ max_level = min_level
nx, ny, nz = (((i-1.0)/2.0) for i in self.amr_header['nx'])
for level in range(self.amr_header['nlevelmax']):
# Easier if do this 1-indexed
@@ -248,6 +249,8 @@
assert(pos.shape[0] == ng)
n = self.oct_handler.add(cpu + 1, level - min_level, pos)
assert(n == ng)
+ if n > 0: max_level = max(level - min_level, max_level)
+ self.max_level = max_level
self.oct_handler.finalize()
def included(self, selector):
@@ -297,7 +300,7 @@
# for now, the hierarchy file is the parameter file!
self.hierarchy_filename = self.parameter_file.parameter_filename
self.directory = os.path.dirname(self.hierarchy_filename)
- self.max_level = pf.max_level
+ self.max_level = None
self.float_type = np.float64
super(RAMSESGeometryHandler, self).__init__(pf, data_style)
@@ -308,6 +311,7 @@
for i in range(self.parameter_file['ncpu'])]
total_octs = sum(dom.local_oct_count #+ dom.ngridbound.sum()
for dom in self.domains)
+ self.max_level = max(dom.max_level for dom in self.domains)
self.num_grids = total_octs
def _detect_fields(self):
https://bitbucket.org/yt_analysis/yt-3.0/commits/68bb0d0b94e4/
Changeset: 68bb0d0b94e4
Branch: yt-3.0
User: MatthewTurk
Date: 2013-08-28 17:16:07
Summary: Merged in MatthewTurk/yt-3.0 (pull request #84)
This enables find_max for RAMSES.
Affected #: 1 file
diff -r 3e72bfc43c5eaecdd5d496c2228ca6cc85da5434 -r 68bb0d0b94e4def4eadba5903e1184264851ca1c yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -215,6 +215,7 @@
self.amr_header['nboundary']*l]
return ng
min_level = self.pf.min_level
+ max_level = min_level
nx, ny, nz = (((i-1.0)/2.0) for i in self.amr_header['nx'])
for level in range(self.amr_header['nlevelmax']):
# Easier if do this 1-indexed
@@ -248,6 +249,8 @@
assert(pos.shape[0] == ng)
n = self.oct_handler.add(cpu + 1, level - min_level, pos)
assert(n == ng)
+ if n > 0: max_level = max(level - min_level, max_level)
+ self.max_level = max_level
self.oct_handler.finalize()
def included(self, selector):
@@ -297,7 +300,7 @@
# for now, the hierarchy file is the parameter file!
self.hierarchy_filename = self.parameter_file.parameter_filename
self.directory = os.path.dirname(self.hierarchy_filename)
- self.max_level = pf.max_level
+ self.max_level = None
self.float_type = np.float64
super(RAMSESGeometryHandler, self).__init__(pf, data_style)
@@ -308,6 +311,7 @@
for i in range(self.parameter_file['ncpu'])]
total_octs = sum(dom.local_oct_count #+ dom.ngridbound.sum()
for dom in self.domains)
+ self.max_level = max(dom.max_level for dom in self.domains)
self.num_grids = total_octs
def _detect_fields(self):
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