[yt-svn] commit/yt-3.0: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Oct 29 06:48:39 PDT 2013


3 new commits in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/1773e02166ca/
Changeset:   1773e02166ca
Branch:      yt-3.0
User:        scopatz
Date:        2013-10-29 02:02:55
Summary:     fixed up PyneMoabHex8 to use updated pyne mesh tagging capabilities.
Affected #:  2 files

diff -r 9bc960be45cb0664d924523552460752a67c5325 -r 1773e02166caa9bf1042c029325bc761cc0a60d9 yt/frontends/moab/data_structures.py
--- a/yt/frontends/moab/data_structures.py
+++ b/yt/frontends/moab/data_structures.py
@@ -157,11 +157,12 @@
         #self.field_list = self.pyne_mesh.mesh.getAllTags(
         #    self.pyne_mesh.mesh.rootSet)
         # So we have to look at each entity.
-        tags = set([])
-        for ent in self.pyne_mesh.mesh.rootSet:
-            for tag in self.pyne_mesh.mesh.getAllTags(ent):
-                tags.add(tag.name)
-        self.field_list = list(tags)
+        #tags = set([])
+        #for ent in self.pyne_mesh.mesh.rootSet:
+        #    for tag in self.pyne_mesh.mesh.getAllTags(ent):
+        #        tags.add(tag.name)
+        #self.field_list = list(tags)
+        self.field_list = self.pyne_mesh.tags.keys()
 
     def _count_grids(self):
         self.num_grids = 1

diff -r 9bc960be45cb0664d924523552460752a67c5325 -r 1773e02166caa9bf1042c029325bc761cc0a60d9 yt/frontends/moab/io.py
--- a/yt/frontends/moab/io.py
+++ b/yt/frontends/moab/io.py
@@ -74,3 +74,28 @@
                 for g in chunk.objs:
                     ind += g.select(selector, ds, rv[field], ind) # caches
         return rv
+
+    def _read_fluid_selection(self, chunks, selector, fields, size):
+        chunks = list(chunks)
+        assert(len(chunks) == 1)
+        tags = {}
+        rv = {}
+        pyne_mesh = self.pf.pyne_mesh
+        mesh = pyne_mesh.mesh
+        for field in fields:
+            rv[field] = np.empty(size, dtype="float64")
+        from itaps import iBase
+        ve_idx_tag = mesh.getTagHandle('ve_idx')
+        ents = pyne_mesh.structured_set.getEntities(iBase.Type.region)
+        ve_idx = ve_idx_tag[ents]
+        ngrids = sum(len(chunk.objs) for chunk in chunks)
+        mylog.debug("Reading %s cells of %s fields in %s blocks",
+                    size, [fname for ftype, fname in fields], ngrids)
+        for field in fields:
+            ftype, fname = field
+            ds = np.asarray(getattr(pyne_mesh, fname)[ve_idx], 'float64')
+            ind = 0
+            for chunk in chunks:
+                for g in chunk.objs:
+                    ind += g.select(selector, ds, rv[field], ind) # caches
+        return rv


https://bitbucket.org/yt_analysis/yt-3.0/commits/62e9d46abd61/
Changeset:   62e9d46abd61
Branch:      yt-3.0
User:        scopatz
Date:        2013-10-29 02:54:24
Summary:     rm'd some commented and extraneous code
Affected #:  2 files

diff -r 1773e02166caa9bf1042c029325bc761cc0a60d9 -r 62e9d46abd61ee4ff02a8a33f6b9b8bf34da7cd9 yt/frontends/moab/data_structures.py
--- a/yt/frontends/moab/data_structures.py
+++ b/yt/frontends/moab/data_structures.py
@@ -152,16 +152,6 @@
                                     vind, coords, self)]
 
     def _detect_fields(self):
-        # Currently, I don't know a better way to do this.  This code, for
-        # example, does not work:
-        #self.field_list = self.pyne_mesh.mesh.getAllTags(
-        #    self.pyne_mesh.mesh.rootSet)
-        # So we have to look at each entity.
-        #tags = set([])
-        #for ent in self.pyne_mesh.mesh.rootSet:
-        #    for tag in self.pyne_mesh.mesh.getAllTags(ent):
-        #        tags.add(tag.name)
-        #self.field_list = list(tags)
         self.field_list = self.pyne_mesh.tags.keys()
 
     def _count_grids(self):

diff -r 1773e02166caa9bf1042c029325bc761cc0a60d9 -r 62e9d46abd61ee4ff02a8a33f6b9b8bf34da7cd9 yt/frontends/moab/io.py
--- a/yt/frontends/moab/io.py
+++ b/yt/frontends/moab/io.py
@@ -55,31 +55,6 @@
         assert(len(chunks) == 1)
         tags = {}
         rv = {}
-        mesh = self.pf.pyne_mesh.mesh
-        for field in fields:
-            ftype, fname = field
-            rv[field] = np.empty(size, dtype="float64")
-            tags[field] = mesh.getTagHandle(fname)
-        from itaps import iBase
-        ents = self.pf.pyne_mesh.structured_set.getEntities(
-            iBase.Type.region)
-        ngrids = sum(len(chunk.objs) for chunk in chunks)
-        mylog.debug("Reading %s cells of %s fields in %s blocks",
-                    size, [fname for ftype, fname in fields], ngrids)
-        for field in fields:
-            ftype, fname = field
-            ds = tags[field][ents]
-            ind = 0
-            for chunk in chunks:
-                for g in chunk.objs:
-                    ind += g.select(selector, ds, rv[field], ind) # caches
-        return rv
-
-    def _read_fluid_selection(self, chunks, selector, fields, size):
-        chunks = list(chunks)
-        assert(len(chunks) == 1)
-        tags = {}
-        rv = {}
         pyne_mesh = self.pf.pyne_mesh
         mesh = pyne_mesh.mesh
         for field in fields:


https://bitbucket.org/yt_analysis/yt-3.0/commits/75ffc619a1d7/
Changeset:   75ffc619a1d7
Branch:      yt-3.0
User:        scopatz
Date:        2013-10-29 03:31:50
Summary:     further improvements to make field access faster
Affected #:  2 files

diff -r 62e9d46abd61ee4ff02a8a33f6b9b8bf34da7cd9 -r 75ffc619a1d7bee7cbfbe795e62107e4485e9a6f yt/frontends/moab/data_structures.py
--- a/yt/frontends/moab/data_structures.py
+++ b/yt/frontends/moab/data_structures.py
@@ -141,9 +141,9 @@
 
     def _initialize_mesh(self):
         from itaps import iBase, iMesh
-        ent = self.pyne_mesh.structured_set.getEntities(iBase.Type.vertex)
-        coords = self.pyne_mesh.mesh.getVtxCoords(ent).astype("float64")
-        vind = self.pyne_mesh.structured_set.getAdjEntIndices(
+        ents = self.pyne_mesh.mesh.rootSet.getEntities(iBase.Type.vertex)
+        coords = self.pyne_mesh.mesh.getVtxCoords(ents).astype("float64")
+        vind = self.pyne_mesh.mesh.rootSet.getAdjEntIndices(
             iBase.Type.region, iMesh.Topology.hexahedron,
             iBase.Type.vertex)[1].indices.data.astype("int64")
         # Divide by float so it throws an error if it's not 8
@@ -192,8 +192,8 @@
 
     def _parse_parameter_file(self):
         from itaps import iBase
-        ent = self.pyne_mesh.structured_set.getEntities(iBase.Type.vertex)
-        coords = self.pyne_mesh.mesh.getVtxCoords(ent)
+        ents = self.pyne_mesh.mesh.rootSet.getEntities(iBase.Type.vertex)
+        coords = self.pyne_mesh.mesh.getVtxCoords(ents)
         self.domain_left_edge = coords[0]
         self.domain_right_edge = coords[-1]
         self.domain_dimensions = self.domain_right_edge - self.domain_left_edge

diff -r 62e9d46abd61ee4ff02a8a33f6b9b8bf34da7cd9 -r 75ffc619a1d7bee7cbfbe795e62107e4485e9a6f yt/frontends/moab/io.py
--- a/yt/frontends/moab/io.py
+++ b/yt/frontends/moab/io.py
@@ -59,16 +59,12 @@
         mesh = pyne_mesh.mesh
         for field in fields:
             rv[field] = np.empty(size, dtype="float64")
-        from itaps import iBase
-        ve_idx_tag = mesh.getTagHandle('ve_idx')
-        ents = pyne_mesh.structured_set.getEntities(iBase.Type.region)
-        ve_idx = ve_idx_tag[ents]
         ngrids = sum(len(chunk.objs) for chunk in chunks)
         mylog.debug("Reading %s cells of %s fields in %s blocks",
                     size, [fname for ftype, fname in fields], ngrids)
         for field in fields:
             ftype, fname = field
-            ds = np.asarray(getattr(pyne_mesh, fname)[ve_idx], 'float64')
+            ds = np.asarray(getattr(pyne_mesh, fname)[:], 'float64')
             ind = 0
             for chunk in chunks:
                 for g in chunk.objs:

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

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