[cig-commits] r7303 - in short/3D/PyLith/trunk: libsrc/meshio
tests/1d/line3 unittests/pytests/topology
knepley at geodynamics.org
knepley at geodynamics.org
Tue Jun 19 12:03:38 PDT 2007
Author: knepley
Date: 2007-06-19 12:03:38 -0700 (Tue, 19 Jun 2007)
New Revision: 7303
Modified:
short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.cc
short/3D/PyLith/trunk/tests/1d/line3/bar.mesh
short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py
Log:
Fixed VTK output for fields
Modified: short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.cc 2007-06-19 17:44:54 UTC (rev 7302)
+++ short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.cc 2007-06-19 19:03:38 UTC (rev 7303)
@@ -24,7 +24,7 @@
#include <stdexcept> // USES std::runtime_error
template<typename Bundle, typename Section>
-PetscErrorCode SectionView_Sieve_Ascii(const Obj<Bundle>& bundle, const Obj<Section>& s, const char name[], PetscViewer viewer);
+PetscErrorCode SectionView_Sieve_Ascii(const Obj<Bundle>& bundle, const Obj<Section>& s, const char name[], PetscViewer viewer, int enforceDim);
// ----------------------------------------------------------------------
// Constructor
@@ -136,7 +136,9 @@
buffer.str("");
buffer << name << "_t" << t;
- err = SectionView_Sieve_Ascii(mesh, field, buffer.str().c_str(), _viewer);
+ // Now we are enforcing a 3D solution
+ // Perhaps we need to push this argument higher
+ err = SectionView_Sieve_Ascii(mesh, field, buffer.str().c_str(), _viewer, 3);
} catch (const std::exception& err) {
std::ostringstream msg;
msg << "Error while writing field '" << name << "' at time "
Modified: short/3D/PyLith/trunk/tests/1d/line3/bar.mesh
===================================================================
--- short/3D/PyLith/trunk/tests/1d/line3/bar.mesh 2007-06-19 17:44:54 UTC (rev 7302)
+++ short/3D/PyLith/trunk/tests/1d/line3/bar.mesh 2007-06-19 19:03:38 UTC (rev 7303)
@@ -2,21 +2,19 @@
dimension = 1
vertices = {
dimension = 1
- count = 5
+ count = 3
coordinates = {
0 0.0
- 1 1.0
- 2 2.0
- 3 3.0
- 4 4.0
+ 1 2.0
+ 2 4.0
}
}
cells = {
- num-corners = 3
+ num-corners = 2
count = 2
simplices = {
- 0 0 2 1
- 1 2 4 3
+ 0 0 1
+ 1 1 2
}
material-ids = {
0 1
@@ -29,7 +27,7 @@
count = 2
indices = {
0
- 4
+ 2
}
}
group = {
@@ -37,7 +35,7 @@
type = vertices
count = 1
indices = {
- 2
+ 1
}
}
}
Modified: short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py 2007-06-19 17:44:54 UTC (rev 7302)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py 2007-06-19 19:03:38 UTC (rev 7303)
@@ -51,13 +51,13 @@
io.writeTopology()
io.close()
- #from pylith.topology.Distributor import Distributor
- #distributor = Distributor()
- #newMesh = distributor.distribute(mesh)
- #io.filename = 'newMesh.vtk'
- #io.open(newMesh)
- #io.writeTopology(newMesh)
- #io.close()
+ from pylith.topology.Distributor import Distributor
+ distributor = Distributor()
+ newMesh = distributor.distribute(mesh)
+ io.filename = 'newMesh.vtk'
+ io.open(newMesh)
+ io.writeTopology(newMesh)
+ io.close()
return
More information about the cig-commits
mailing list