[yt-svn] commit/yt: Max Katz: Enable support for spherical datasets in the BoxLib frontend.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Feb 16 12:59:16 PST 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/ee29ca6d81c9/
Changeset:   ee29ca6d81c9
Branch:      yt
User:        Max Katz
Date:        2016-02-16 17:36:03+00:00
Summary:     Enable support for spherical datasets in the BoxLib frontend.
Affected #:  1 file

diff -r 816123b32fa4a71c537683bef8de93f795a57796 -r ee29ca6d81c95d55073d4cf9db89e9486c40156d yt/frontends/boxlib/data_structures.py
--- a/yt/frontends/boxlib/data_structures.py
+++ b/yt/frontends/boxlib/data_structures.py
@@ -178,8 +178,15 @@
                 raise RuntimeError("yt needs cylindrical to be 2D")
             self.level_dds[:,2] = 2*np.pi
             default_zbounds = (0.0, 2*np.pi)
+        elif self.ds.geometry == "spherical":
+            # BoxLib only supports 1D spherical, so ensure
+            # the other dimensions have the right extent.
+            self.level_dds[:,1] = np.pi
+            self.level_dds[:,2] = 2*np.pi
+            default_ybounds = (0.0, np.pi)
+            default_zbounds = (0.0, 2*np.pi)
         else:
-            raise RuntimeError("yt only supports cartesian and cylindrical coordinates.")
+            raise RuntimeError("Unknown BoxLib coordinate system.")
         if int(next(header_file)) != 0:
             raise RuntimeError("INTERNAL ERROR! This should be a zero.")
 
@@ -586,8 +593,10 @@
             self.geometry = "cartesian"
         elif coordinate_type == 1:
             self.geometry = "cylindrical"
+        elif coordinate_type == 2:
+            self.geometry = "spherical"
         else:
-            raise RuntimeError("yt does not yet support spherical geometry")
+            raise RuntimeError("Unknown BoxLib coord_type")
 
         # overrides for 1/2-dimensional data
         if self.dimensionality == 1:

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