[cig-commits] r8619 -
short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs
brad at geodynamics.org
brad at geodynamics.org
Fri Dec 7 16:44:46 PST 2007
Author: brad
Date: 2007-12-07 16:44:46 -0800 (Fri, 07 Dec 2007)
New Revision: 8619
Modified:
short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_error.py
Log:
Using cell data not point data.
Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_error.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_error.py 2007-12-03 15:34:35 UTC (rev 8618)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_error.py 2007-12-08 00:44:46 UTC (rev 8619)
@@ -13,7 +13,7 @@
from plot_geometry import PlotScene
shape = "tet4"
-res = 500
+res = 1000
class PlotError(PlotScene):
@@ -21,6 +21,7 @@
def run(self):
from enthought.mayavi.sources.vtk_data_source import VTKDataSource
+ from enthought.mayavi.filters.cell_to_point_data import CellToPointData
from enthought.mayavi.modules.iso_surface import IsoSurface
self._setupScene()
@@ -29,6 +30,10 @@
script = self.script
script.add_source(VTKDataSource(data=data))
script.engine.current_object.name = "Error"
+
+ ptdata = CellToPointData()
+ script.add_filter(ptdata)
+
surf = IsoSurface()
script.add_module(surf)
@@ -50,6 +55,8 @@
vertices = h5.root.geometry.vertices[:] / 1e+3
(nvertices, spaceDim) = vertices.shape
error = h5.root.difference.pylith_1_0_analytic.snapshot0.displacements[:]
+ disp = h5.root.projection.data.pylith_1_0.snapshot0.displacements[:]
+ dispE = h5.root.projection.data.analytic.snapshot0.displacements[:]
h5.close()
if shape == "tet4":
@@ -60,12 +67,13 @@
raise ValueError("Unknown shape '%s'." % shape)
errorLog10 = numpy.log10(error)
+ disp = numpy.reshape(disp, (ncells, spaceDim))
data = tvtk.UnstructuredGrid()
data.points = vertices
data.set_cells(cellType, cells)
- data.point_data.scalars = errorLog10
- data.point_data.scalars.name = "log10(Error [m])"
+ data.cell_data.scalars = errorLog10
+ data.cell_data.scalars.name = "log10(Error [m])"
return data
More information about the cig-commits
mailing list