[Yt-svn] yt-commit r1718 - trunk/yt/lagos
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Wed May 12 13:34:15 PDT 2010
Author: mturk
Date: Wed May 12 13:34:15 2010
New Revision: 1718
URL: http://yt.enzotools.org/changeset/1718
Log:
DivV should NOT have an abs taken. Added new field that takes the abs.
Modified:
trunk/yt/lagos/UniversalFields.py
Modified: trunk/yt/lagos/UniversalFields.py
==============================================================================
--- trunk/yt/lagos/UniversalFields.py (original)
+++ trunk/yt/lagos/UniversalFields.py Wed May 12 13:34:15 2010
@@ -466,12 +466,20 @@
f -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
new_field = na.zeros(data["x-velocity"].shape, dtype='float64')
new_field[1:-1,1:-1,1:-1] = f
- return na.abs(new_field)
+ return new_field
def _convertDivV(data):
return data.convert("cm")**-1.0
add_field("DivV", function=_DivV,
validators=[ValidateSpatial(1,
["x-velocity","y-velocity","z-velocity"])],
+ units=r"\rm{s}^{-1}", take_log=False,
+ convert_function=_convertDivV)
+
+def _AbsDivV(field, data):
+ return na.abs(data['DivV'])
+add_field("AbsDivV", function=_AbsDivV,
+ validators=[ValidateSpatial(1,
+ ["x-velocity","y-velocity","z-velocity"])],
units=r"\rm{s}^{-1}",
convert_function=_convertDivV)
More information about the yt-svn
mailing list