[yt-svn] commit/yt: ngoldbaum: Merged in atmyers/yt (pull request #2166)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed May 11 12:18:51 PDT 2016
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/de456d1efc0e/
Changeset: de456d1efc0e
Branch: yt
User: ngoldbaum
Date: 2016-05-11 19:18:41+00:00
Summary: Merged in atmyers/yt (pull request #2166)
Make sure the standard particle fields get set up correctly for the Orion frontends. Closes Issue #1166.
Affected #: 2 files
diff -r 78591f39a47d294c9ff8d5be7121fbe51e5a2acd -r de456d1efc0ecd2faa73ec9a309a40c5ee1ce393 yt/frontends/boxlib/fields.py
--- a/yt/frontends/boxlib/fields.py
+++ b/yt/frontends/boxlib/fields.py
@@ -90,6 +90,21 @@
# "luminosity",
)
+ def setup_particle_fields(self, ptype):
+
+ def _get_vel(axis):
+ def velocity(field, data):
+ return data["particle_momentum_%s" % axis]/data["particle_mass"]
+ return velocity
+
+ for ax in 'xyz':
+ self.add_field((ptype, "particle_velocity_%s" % ax),
+ function=_get_vel(ax),
+ particle_type=True,
+ units="code_length/code_time")
+
+ super(BoxlibFieldInfo, self).setup_particle_fields(ptype)
+
def setup_fluid_fields(self):
unit_system = self.ds.unit_system
# Now, let's figure out what fields are included.
diff -r 78591f39a47d294c9ff8d5be7121fbe51e5a2acd -r de456d1efc0ecd2faa73ec9a309a40c5ee1ce393 yt/frontends/chombo/fields.py
--- a/yt/frontends/chombo/fields.py
+++ b/yt/frontends/chombo/fields.py
@@ -78,6 +78,21 @@
("particle_id", ("", ["particle_index"], None)),
)
+ def setup_particle_fields(self, ptype):
+
+ def _get_vel(axis):
+ def velocity(field, data):
+ return data["particle_momentum_%s" % axis]/data["particle_mass"]
+ return velocity
+
+ for ax in 'xyz':
+ self.add_field((ptype, "particle_velocity_%s" % ax),
+ function=_get_vel(ax),
+ particle_type=True,
+ units="code_length/code_time")
+
+ super(Orion2FieldInfo, self).setup_particle_fields(ptype)
+
def setup_fluid_fields(self):
from yt.fields.magnetic_field import \
setup_magnetic_field_aliases
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-svn-spacepope.org/attachments/20160511/d9491b5c/attachment.html>
More information about the yt-svn
mailing list