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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Mar 22 16:16:12 PDT 2014


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/f29080ca4f88/
Changeset:   f29080ca4f88
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-03-20 12:14:40
Summary:     Adding auto-smoothing of particle types for SPH.
Affected #:  1 file

diff -r 794514da3f86f4792efff526fdeeb9556e53b0b5 -r f29080ca4f88070f75ff2da01db7255352d6ef43 yt/fields/field_info_container.py
--- a/yt/fields/field_info_container.py
+++ b/yt/fields/field_info_container.py
@@ -39,7 +39,8 @@
     particle_deposition_functions, \
     particle_vector_functions, \
     particle_scalar_functions, \
-    standard_particle_fields
+    standard_particle_fields, \
+    add_volume_weighted_smoothed_field
 
 class FieldInfoContainer(dict):
     """
@@ -97,6 +98,26 @@
             self.add_output_field(field, 
                                   units = self.pf.field_units.get(field, ""),
                                   particle_type = True)
+        self.setup_smoothed_fields(ptype)
+
+    def setup_smoothed_fields(self, ptype, num_neighbors = 64, ftype = "gas"):
+        # We can in principle compute this, but it is not yet implemented.
+        if (ptype, "density") not in self:
+            return
+        if (ptype, "smoothing_length") in self:
+            sml_name = "smoothing_length"
+        else:
+            sml_name = None
+        new_aliases = []
+        for _, alias_name in self.field_aliases:
+            fn = add_volume_weighted_smoothed_field(ptype,
+                "particle_position", "particle_mass",
+                sml_name, "density", alias_name, self,
+                num_neighbors)
+            new_aliases.append(((ftype, alias_name), fn[0]))
+        for alias, source in new_aliases:
+            #print "Aliasing %s => %s" % (alias, source)
+            self.alias(alias, source)
 
     def setup_fluid_aliases(self):
         known_other_fields = dict(self.known_other_fields)


https://bitbucket.org/yt_analysis/yt/commits/7305c9e6d46f/
Changeset:   7305c9e6d46f
Branch:      yt-3.0
User:        samskillman
Date:        2014-03-23 00:16:06
Summary:     Merged in MatthewTurk/yt/yt-3.0 (pull request #735)

Adding auto-smoothing of particle types for SPH.
Affected #:  1 file

diff -r afbb6c1c19fd04fb97eab241ceb4b8382ce206c8 -r 7305c9e6d46f05581859b3d95d80c912dd00b2d6 yt/fields/field_info_container.py
--- a/yt/fields/field_info_container.py
+++ b/yt/fields/field_info_container.py
@@ -39,7 +39,8 @@
     particle_deposition_functions, \
     particle_vector_functions, \
     particle_scalar_functions, \
-    standard_particle_fields
+    standard_particle_fields, \
+    add_volume_weighted_smoothed_field
 
 class FieldInfoContainer(dict):
     """
@@ -97,6 +98,26 @@
             self.add_output_field(field, 
                                   units = self.pf.field_units.get(field, ""),
                                   particle_type = True)
+        self.setup_smoothed_fields(ptype)
+
+    def setup_smoothed_fields(self, ptype, num_neighbors = 64, ftype = "gas"):
+        # We can in principle compute this, but it is not yet implemented.
+        if (ptype, "density") not in self:
+            return
+        if (ptype, "smoothing_length") in self:
+            sml_name = "smoothing_length"
+        else:
+            sml_name = None
+        new_aliases = []
+        for _, alias_name in self.field_aliases:
+            fn = add_volume_weighted_smoothed_field(ptype,
+                "particle_position", "particle_mass",
+                sml_name, "density", alias_name, self,
+                num_neighbors)
+            new_aliases.append(((ftype, alias_name), fn[0]))
+        for alias, source in new_aliases:
+            #print "Aliasing %s => %s" % (alias, source)
+            self.alias(alias, source)
 
     def setup_fluid_aliases(self):
         known_other_fields = dict(self.known_other_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