[cig-commits] r17130 - short/3D/PyLith/trunk/libsrc/meshio

knepley at geodynamics.org knepley at geodynamics.org
Thu Aug 26 22:23:27 PDT 2010


Author: knepley
Date: 2010-08-26 22:23:26 -0700 (Thu, 26 Aug 2010)
New Revision: 17130

Modified:
   short/3D/PyLith/trunk/libsrc/meshio/DataWriterHDF5.cc
Log:
More HDF5


Modified: short/3D/PyLith/trunk/libsrc/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/DataWriterHDF5.cc	2010-08-27 04:35:47 UTC (rev 17129)
+++ short/3D/PyLith/trunk/libsrc/meshio/DataWriterHDF5.cc	2010-08-27 05:23:26 UTC (rev 17130)
@@ -85,11 +85,13 @@
     CHECK_PETSC_ERROR(err);
 
     const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh = mesh.sieveMesh();
-    //const ALE::Obj<typename field_type::Mesh::RealSection>& coordinates = sieveMesh->getRealSection("coordinates");
-    Vec coordVec;
+    const ALE::Obj<typename field_type::Mesh::RealSection>& coordinates = sieveMesh->getRealSection("coordinates");
+    field_type coordField(coordinates);
 
-    // BRAD: Are the coordinates in Fields, so I can just get the Vec out?
-    err = VecView(coordVec, _viewer);CHECK_PETSC_ERROR(err);
+    coordField.createVector();
+    coordField.createScatter();
+    coordField.scatterSectionToVector();
+    err = VecView(coordField.vector(), _viewer);CHECK_PETSC_ERROR(err);
     Vec          elemVec;
     PetscInt     numElements, numCorners, *vertices;
     PetscScalar *tmpVertices;
@@ -144,9 +146,12 @@
     // We will try the simplest thing, using the embedded vector. If this is not
     // general enough, due to ordering, etc., we can construct an auxiliary vector.
 
-    // BRAD: Do we need to syncrhonize values here?
     const PetscVec vector = field.vector();
-    assert(vector != PETSC_NULL);
+    if (vector == PETSC_NULL) {
+      field.createVector();
+    }
+    // TODO: Create scatter if necessary
+    field.scatterSectionToVector();
 
     PetscErrorCode err = 0;
     err = VecView(vector, _viewer);
@@ -178,9 +183,12 @@
     // We will try the simplest thing, using the embedded vector. If this is not
     // general enough, due to ordering, etc., we can construct an auxiliary vector.
 
-    // BRAD: Do we need to syncrhonize values here?
     const PetscVec vector = field.vector();
-    assert(vector != PETSC_NULL);
+    if (vector == PETSC_NULL) {
+      field.createVector();
+    }
+    // TODO: Create scatter if necessary
+    field.scatterSectionToVector();
 
     PetscErrorCode err = 0;
     err = VecView(vector, _viewer);



More information about the CIG-COMMITS mailing list