[yt-svn] commit/yt: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed May 11 12:18:54 PDT 2016


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/3ec0ccea1142/
Changeset:   3ec0ccea1142
Branch:      yt
User:        atmyers
Date:        2016-05-10 17:56:37+00:00
Summary:     Make sure the standard particle fields get set up correctly for the Orion frontends.
Affected #:  2 files

diff -r 7f7ccbc9329e14578e120835c0365f2e271e72cf -r 3ec0ccea11428e539e70f673788c250f8f2fac74 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 7f7ccbc9329e14578e120835c0365f2e271e72cf -r 3ec0ccea11428e539e70f673788c250f8f2fac74 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


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/25670086/attachment-0002.htm>


More information about the yt-svn mailing list