[cig-commits] r4540 - in short/3D/PyLith/trunk/pylith: meshio topology

baagaard at geodynamics.org baagaard at geodynamics.org
Thu Sep 14 17:18:52 PDT 2006


Author: baagaard
Date: 2006-09-14 17:18:51 -0700 (Thu, 14 Sep 2006)
New Revision: 4540

Modified:
   short/3D/PyLith/trunk/pylith/meshio/MeshIO.py
   short/3D/PyLith/trunk/pylith/meshio/MeshIOAscii.py
   short/3D/PyLith/trunk/pylith/topology/Mesh.py
Log:
Fixed handling of Sieve for reading/writing.

Modified: short/3D/PyLith/trunk/pylith/meshio/MeshIO.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/MeshIO.py	2006-09-15 00:10:37 UTC (rev 4539)
+++ short/3D/PyLith/trunk/pylith/meshio/MeshIO.py	2006-09-15 00:18:51 UTC (rev 4540)
@@ -14,8 +14,6 @@
 
 ## @brief Python abstract base class for finite-element mesh I/O.
 
-import FIAT.shapes
-
 from pyre.components.Component import Component
 
 # MeshIO class
@@ -61,7 +59,10 @@
 
     @returns Sieve mesh object containing finite-element mesh
     """
-    return self.cppHandle.read(self.interpolate)
+    from pylith.topology.Mesh import Mesh
+    mesh = Mesh()
+    mesh.handle = self.cppHandle.read(self.interpolate)
+    return 
 
 
   def write(self, mesh):
@@ -70,7 +71,7 @@
 
     @param mesh Sieve mesh object containing finite-element mesh
     """
-    self.cppHandle.write(mesh)
+    self.cppHandle.write(mesh.handle)
     return
 
 

Modified: short/3D/PyLith/trunk/pylith/meshio/MeshIOAscii.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/MeshIOAscii.py	2006-09-15 00:10:37 UTC (rev 4539)
+++ short/3D/PyLith/trunk/pylith/meshio/MeshIOAscii.py	2006-09-15 00:18:51 UTC (rev 4540)
@@ -15,12 +15,10 @@
 ## @brief Python object for reading/writing finite-element mesh from
 ## simple ASCII file.
 
-import FIAT.shapes
+from MeshIO import MeshIO
 
-from pyre.components.Component import Component
-
-# MeshIO class
-class MeshIO(Component):
+# MeshIOAscii class
+class MeshIOAscii(Component):
   """
   Python object for reading/writing finite-element mesh from simple
   ASCII file.
@@ -30,7 +28,7 @@
 
   def __init__(self, name="meshio"):
     """Constructor."""
-    Component.__init__(self, name, facility="meshio")
+    MeshIO.__init__(self, name, facility="meshio")
     import pylith.meshio.meshio as bindings
     self.cppHandler = bindings.MeshIOAscii()
     return

Modified: short/3D/PyLith/trunk/pylith/topology/Mesh.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/Mesh.py	2006-09-15 00:10:37 UTC (rev 4539)
+++ short/3D/PyLith/trunk/pylith/topology/Mesh.py	2006-09-15 00:18:51 UTC (rev 4540)
@@ -47,6 +47,7 @@
   def __init__(self, name="mesh"):
     """Constructor."""
     Component.__init__(self, name, facility="mesh")
+    self.handle = None
     return
 
 



More information about the cig-commits mailing list