[yt-svn] commit/yt: MatthewTurk: Removing the old, unused EnzoTable stuff from Enzo outputs and fix detection
Bitbucket
commits-noreply at bitbucket.org
Mon Sep 10 08:44:26 PDT 2012
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/changeset/f683d37da087/
changeset: f683d37da087
branch: yt
user: MatthewTurk
date: 2012-09-10 17:37:59
summary: Removing the old, unused EnzoTable stuff from Enzo outputs and fix detection
and setup of 1D and 2D enzo fields. This fixes the problem Sam identified with
DivV/z-velocity not working in 2D fields.
affected #: 2 files
diff -r 64c090a6d57f30cd7dfa87fe242bb7128f4f791a -r f683d37da0870bbf34d450c338c5cab049b7b7d3 yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -702,23 +702,6 @@
StaticOutput.__init__(self, filename, data_style, file_style=file_style)
if "InitialTime" not in self.parameters:
self.current_time = 0.0
- rp = os.path.join(self.directory, "rates.out")
- if os.path.exists(rp):
- try:
- self.rates = EnzoTable(rp, rates_out_key)
- except:
- pass
- cp = os.path.join(self.directory, "cool_rates.out")
- if os.path.exists(cp):
- try:
- self.cool = EnzoTable(cp, cool_out_key)
- except:
- pass
-
- # Now fixes for different types of Hierarchies
- # This includes changing the fieldinfo class!
- if self["TopGridRank"] == 1: self._setup_1d()
- elif self["TopGridRank"] == 2: self._setup_2d()
def _setup_1d(self):
self._hierarchy_class = EnzoHierarchy1D
@@ -732,9 +715,9 @@
self._hierarchy_class = EnzoHierarchy2D
self._fieldinfo_fallback = Enzo2DFieldInfo
self.domain_left_edge = \
- na.concatenate([self["DomainLeftEdge"], [0.0]])
+ na.concatenate([self.domain_left_edge, [0.0]])
self.domain_right_edge = \
- na.concatenate([self["DomainRightEdge"], [1.0]])
+ na.concatenate([self.domain_right_edge, [1.0]])
def get_parameter(self,parameter,type=None):
"""
@@ -870,6 +853,11 @@
self.current_redshift = self.omega_lambda = self.omega_matter = \
self.hubble_constant = self.cosmological_simulation = 0.0
+ if self.dimensionality == 1:
+ self._setup_1d()
+ elif self.dimensionality == 2:
+ self._setup_2d()
+
def _set_units(self):
"""
Generates the conversion to various physical _units based on the parameter file
diff -r 64c090a6d57f30cd7dfa87fe242bb7128f4f791a -r f683d37da0870bbf34d450c338c5cab049b7b7d3 yt/frontends/enzo/fields.py
--- a/yt/frontends/enzo/fields.py
+++ b/yt/frontends/enzo/fields.py
@@ -610,7 +610,6 @@
dtype='float64')
add_enzo_2d_field("z-velocity", function=_zvel)
-
#
# Now we do overrides for 1D fields
#
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