[cig-commits] r6873 - in short/3D/PyLith/trunk: pylith/meshio
unittests/pytests/topology
knepley at geodynamics.org
knepley at geodynamics.org
Sun May 13 14:09:54 PDT 2007
Author: knepley
Date: 2007-05-13 14:09:53 -0700 (Sun, 13 May 2007)
New Revision: 6873
Modified:
short/3D/PyLith/trunk/pylith/meshio/SolutionIO.py
short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py
Log:
Can now output a mesh to VTK
Modified: short/3D/PyLith/trunk/pylith/meshio/SolutionIO.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/SolutionIO.py 2007-05-13 20:25:40 UTC (rev 6872)
+++ short/3D/PyLith/trunk/pylith/meshio/SolutionIO.py 2007-05-13 21:09:53 UTC (rev 6873)
@@ -80,14 +80,30 @@
return
+ def close(self):
+ """
+ Close files for solution.
+ """
+ self._info.log("Closing files for output of solution.")
+
+ # Set flags
+ self._sync()
+
+ assert(self.cppHandle != None)
+ self.cppHandle.close()
+ return
+
+
def writeTopology(self, mesh):
"""
Write solution topology to file.
"""
self._info.log("Writing solution topology.")
- assert(cppHandle != None)
- self.cppHandle.write(mesh.cppHandle, mesh.coordsys.cppHandle)
+ assert(self.cppHandle != None)
+ assert(mesh.cppHandle != None)
+ assert(mesh.coordsys.cppHandle != None)
+ self.cppHandle.writeTopology(mesh.cppHandle, mesh.coordsys.cppHandle)
return
@@ -97,7 +113,7 @@
"""
self._info.log("Writing solution field '%s'." % name)
- self.cppHandle.write(t, field, name, mesh.cppHandle)
+ self.cppHandle.writeField(t, field, name, mesh.cppHandle)
return
Modified: short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py 2007-05-13 20:25:40 UTC (rev 6872)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py 2007-05-13 21:09:53 UTC (rev 6873)
@@ -46,6 +46,7 @@
io.filename = 'mesh.vtk'
from spatialdata.geocoords.CSCart import CSCart
io.coordsys = CSCart()
+ mesh.coordsys = CSCart()
io.open(mesh)
io.writeTopology(mesh)
io.close()
More information about the cig-commits
mailing list