[yt-svn] commit/yt: ngoldbaum: Merged in cosmosquark/yt (pull request #1302)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Nov 17 12:34:23 PST 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/6b9ada3a86ad/
Changeset:   6b9ada3a86ad
Branch:      yt
User:        ngoldbaum
Date:        2014-11-17 20:34:14+00:00
Summary:     Merged in cosmosquark/yt (pull request #1302)

Ramses frontend improvement  (min_level and max_level consistancy) + slight oct tree geometry change
Affected #:  2 files

diff -r e8fb57e66ca42e26052dadf054a5c782740abec9 -r 6b9ada3a86ad7c86171132650c032e4d157f8f79 yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -18,7 +18,6 @@
 import stat
 import weakref
 import cStringIO
-
 from yt.funcs import *
 from yt.geometry.oct_geometry_handler import \
     OctreeIndex
@@ -163,6 +162,7 @@
         if hvals["nstar_tot"] > 0:
             particle_fields += [("particle_age", "d"),
                                 ("particle_metallicity", "d")]
+
         field_offsets = {}
         _pfields = {}
         for field, vtype in particle_fields:
@@ -224,7 +224,11 @@
                                 self.amr_header['nboundary']*l]
             return ng
         min_level = self.ds.min_level
-        max_level = min_level
+        # yt max level is not the same as the RAMSES one.
+        # yt max level is the maximum number of additional refinement levels
+        # so for a uni grid run with no refinement, it would be 0. 
+        # So we initially assume that.
+        max_level = 0
         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
@@ -551,7 +555,7 @@
         self.omega_lambda = rheader["omega_l"]
         self.omega_matter = rheader["omega_m"]
         self.hubble_constant = rheader["H0"] / 100.0 # This is H100
-        self.max_level = rheader['levelmax'] - self.min_level
+        self.max_level = rheader['levelmax'] - self.min_level - 1
         f.close()
 
     @classmethod

diff -r e8fb57e66ca42e26052dadf054a5c782740abec9 -r 6b9ada3a86ad7c86171132650c032e4d157f8f79 yt/geometry/oct_geometry_handler.py
--- a/yt/geometry/oct_geometry_handler.py
+++ b/yt/geometry/oct_geometry_handler.py
@@ -45,7 +45,7 @@
         Returns (in code units) the smallest cell size in the simulation.
         """
         return (self.dataset.domain_width /
-                (2**(self.max_level+1))).min()
+                (self.dataset.domain_dimensions * 2**(self.max_level))).min()
 
     def convert(self, unit):
         return self.dataset.conversion_factors[unit]

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