[cig-commits] r8094 - in short/3D/PyLith/trunk: . libsrc/meshio libsrc/topology modulesrc/meshio pylith/meshio tests/distribute

brad at geodynamics.org brad at geodynamics.org
Tue Oct 9 05:35:29 PDT 2007


Author: brad
Date: 2007-10-09 05:35:28 -0700 (Tue, 09 Oct 2007)
New Revision: 8094

Added:
   short/3D/PyLith/trunk/libsrc/topology/Distributor.cc
   short/3D/PyLith/trunk/libsrc/topology/Distributor.hh
   short/3D/PyLith/trunk/tests/distribute/hex8a.mesh
   short/3D/PyLith/trunk/tests/distribute/mesherapp.cfg
   short/3D/PyLith/trunk/tests/distribute/quad4a.mesh
   short/3D/PyLith/trunk/tests/distribute/tet4a.mesh
Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/meshio/SolutionIO.hh
   short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.cc
   short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.hh
   short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
   short/3D/PyLith/trunk/pylith/meshio/SolutionIO.py
   short/3D/PyLith/trunk/tests/distribute/README
Log:
Added missing Distributor files.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/TODO	2007-10-09 12:35:28 UTC (rev 8094)
@@ -30,6 +30,15 @@
 
   5. Reimplement SolutionIO.
 
+     Need to be able to append fields.
+
+     Want open(), writeTopology(), appendVertexField(),
+     appendCellField(), close() paradigm.
+
+     It should be possible to use PETSc viewers, but we will want to
+     setup the viewers in implementation classes and then call the
+     view in the parent class?
+
      Follow implementation of MeshIO. SolutionIO implements extracting
      data from Sieve and calls virtual functions to write data.
 

Modified: short/3D/PyLith/trunk/libsrc/meshio/SolutionIO.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/SolutionIO.hh	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/libsrc/meshio/SolutionIO.hh	2007-10-09 12:35:28 UTC (rev 8094)
@@ -78,19 +78,32 @@
   void writeTopology(const ALE::Obj<ALE::Mesh>& mesh,
 		     const spatialdata::geocoords::CoordSys* csMesh) = 0;
 
-  /** Write solution field to file.
+  /** Write field over vertices to file.
    *
    * @param t Time associated with field.
-   * @param field PETSc field.
+   * @param field PETSc field over vertices.
    * @param name Name of field.
    * @param mesh PETSc mesh object.
    */
   virtual
-  void writeField(const double t,
-		  const ALE::Obj<real_section_type>& field,
-		  const char* name,
-		  const ALE::Obj<ALE::Mesh>& mesh) = 0;
+  void writeVertexField(const double t,
+			const ALE::Obj<real_section_type>& field,
+			const char* name,
+			const ALE::Obj<ALE::Mesh>& mesh) = 0;
 
+  /** Write field over cells to file.
+   *
+   * @param t Time associated with field.
+   * @param field PETSc field over cells.
+   * @param name Name of field.
+   * @param mesh PETSc mesh object.
+   */
+  virtual
+  void writeCellField(const double t,
+		      const ALE::Obj<real_section_type>& field,
+		      const char* name,
+		      const ALE::Obj<ALE::Mesh>& mesh) = 0;
+
 // PROTECTED MEMBERS ////////////////////////////////////////////////////
 public :
 

Modified: short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.cc	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.cc	2007-10-09 12:35:28 UTC (rev 8094)
@@ -99,14 +99,14 @@
 } // writeTopology
 
 // ----------------------------------------------------------------------
-// Write field to file.
+// Write field over vertices to file.
 void
-pylith::meshio::SolutionIOVTK::writeField(
+pylith::meshio::SolutionIOVTK::writeVertexField(
 				     const double t,
 				     const ALE::Obj<real_section_type>& field,
 				     const char* name,
 				     const ALE::Obj<ALE::Mesh>& mesh)
-{ // writeField
+{ // writeVertexField
 
   try {
     PetscErrorCode err;
@@ -150,7 +150,64 @@
 	<< t << " to VTK file '" << _filename << "'.\n";
     throw std::runtime_error(msg.str());
   } // try/catch
-} // writeField
+} // writeVertexField
 
+// ----------------------------------------------------------------------
+// Write field over cells to file.
+void
+pylith::meshio::SolutionIOVTK::writeCellField(
+				     const double t,
+				     const ALE::Obj<real_section_type>& field,
+				     const char* name,
+				     const ALE::Obj<ALE::Mesh>& mesh)
+{ // writeVertexField
 
+  try {
+    PetscErrorCode err;
+
+    std::ostringstream buffer;
+    const int indexExt = _filename.find(".vtk");
+    buffer << std::string(_filename, 0, indexExt) << "_t" << t << ".vtk";
+
+    err = PetscViewerCreate(mesh->comm(), &_viewer);
+    err = PetscViewerSetType(_viewer, PETSC_VIEWER_ASCII);
+    err = PetscViewerSetFormat(_viewer, PETSC_VIEWER_ASCII_VTK);
+    err = PetscViewerFileSetName(_viewer, buffer.str().c_str());
+    if (err) {
+      std::ostringstream msg;
+      msg << "Could not open VTK file '" << buffer.str()
+	  << "' for solution output.\n";
+      throw std::runtime_error(msg.str());
+    } // if
+
+    err = VTKViewer::writeHeader(_viewer);
+    err = VTKViewer::writeVertices(mesh, _viewer);
+    err = VTKViewer::writeElements(mesh, _viewer);
+
+    buffer.str("");
+    buffer << name << "_t" << t;
+
+   err = PetscViewerPushFormat(_viewer, PETSC_VIEWER_ASCII_VTK_CELL);
+
+   // Get fiber dimension of first cell
+   const ALE::Obj<Mesh::label_sequence>& cells = mesh->heightStratum(0);
+   const int fiberDim = field->getFiberDimension(*cells->begin());
+   err = SectionView_Sieve_Ascii(mesh, field, buffer.str().c_str(), _viewer, fiberDim);
+    buffer.str("");
+    buffer << name << "_verify_t" << t;
+    err = SectionView_Sieve_Ascii(mesh, field, buffer.str().c_str(), _viewer, -4);
+  } catch (const std::exception& err) {
+    std::ostringstream msg;
+    msg << "Error while writing field '" << name << "' at time " 
+	<< t << " to VTK file '" << _filename << "'.\n" << err.what();
+    throw std::runtime_error(msg.str());
+  } catch (...) { 
+    std::ostringstream msg;
+    msg << "Error while writing field '" << name << "' at time " 
+	<< t << " to VTK file '" << _filename << "'.\n";
+    throw std::runtime_error(msg.str());
+  } // try/catch
+} // writeCellField
+
+
 // End of file 

Modified: short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.hh	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/libsrc/meshio/SolutionIOVTK.hh	2007-10-09 12:35:28 UTC (rev 8094)
@@ -64,18 +64,30 @@
   void writeTopology(const ALE::Obj<ALE::Mesh>& mesh,
 		     const spatialdata::geocoords::CoordSys* csMesh);
 
-  /** Write solution field to file.
+  /** Write field over vertices to file.
    *
    * @param t Time associated with field.
-   * @param field PETSc field.
+   * @param field PETSc field over vertices.
    * @param name Name of field.
    * @param mesh PETSc mesh object.
    */
-  void writeField(const double t,
-		  const ALE::Obj<real_section_type>& field,
-		  const char* name,
-		  const ALE::Obj<ALE::Mesh>& mesh);
+  void writeVertexField(const double t,
+			const ALE::Obj<real_section_type>& field,
+			const char* name,
+			const ALE::Obj<ALE::Mesh>& mesh);
 
+  /** Write field over cells to file.
+   *
+   * @param t Time associated with field.
+   * @param field PETSc field over cells.
+   * @param name Name of field.
+   * @param mesh PETSc mesh object.
+   */
+  void writeCellField(const double t,
+		      const ALE::Obj<real_section_type>& field,
+		      const char* name,
+		      const ALE::Obj<ALE::Mesh>& mesh);
+
 // PRIVATE MEMBERS //////////////////////////////////////////////////////
 public :
 

Added: short/3D/PyLith/trunk/libsrc/topology/Distributor.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Distributor.cc	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/libsrc/topology/Distributor.cc	2007-10-09 12:35:28 UTC (rev 8094)
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include <portinfo>
+
+#include "Distributor.hh" // implementation of class methods
+
+#include "pylith/utils/sievetypes.hh" // USES PETSc Mesh
+#include "pylith/meshio/SolutionIO.hh" // USES SolutionIO
+
+#include <string.h> // USES strlen()
+#include <stdexcept> // USES std::runtime_error
+#include <sstream> // USES std::ostringstream
+#include <assert.h> // USES assert()
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::topology::Distributor::Distributor(void)
+{ // constructor
+} // constructor
+ 
+// ----------------------------------------------------------------------
+// Destructor
+pylith::topology::Distributor::~Distributor(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Distribute mesh among processors.
+void
+pylith::topology::Distributor::distribute(ALE::Obj<Mesh>* const newMesh,
+					  const ALE::Obj<Mesh>& origMesh,
+					  const char* partitioner)
+{ // distribute
+  if (strlen(partitioner) == 0)
+    *newMesh = ALE::Distribution<ALE::Mesh>::distributeMesh(origMesh);
+  else
+    *newMesh = 
+      ALE::Distribution<ALE::Mesh>::distributeMesh(origMesh, 0, partitioner);
+} // distribute
+
+// ----------------------------------------------------------------------
+// Write partitioning info for distributed mesh.
+void
+pylith::topology::Distributor::write(const ALE::Obj<Mesh>& mesh,
+				     meshio::SolutionIO* const writer)
+{ // write
+  
+  // Setup and allocate field
+  const int fiberDim = 1;
+  ALE::Obj<real_section_type> partition = 
+    new real_section_type(mesh->comm(), mesh->debug());
+  const ALE::Obj<Mesh::label_sequence>& cells = mesh->heightStratum(0);
+  assert(!cells.isNull());
+  partition->setFiberDimension(cells, fiberDim);
+  mesh->allocate(partition);
+
+  const int rank  = mesh->commRank();
+  double rankReal = double(rank);
+  const Mesh::label_sequence::iterator  cellsEnd = cells->end();
+  for (Mesh::label_sequence::iterator c_iter=cells->begin();
+       c_iter != cellsEnd;
+       ++c_iter) {
+    partition->updatePoint(*c_iter, &rankReal);
+  } // for
+
+
+  partition->view("PARTITION");
+  const double t = 0.0;
+  writer->writeCellField(t, partition, "partition", mesh);
+} // write
+
+
+// End of file 

Added: short/3D/PyLith/trunk/libsrc/topology/Distributor.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Distributor.hh	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/libsrc/topology/Distributor.hh	2007-10-09 12:35:28 UTC (rev 8094)
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file pylith/topology/Distributor.hh
+ *
+ * @brief Object for managing distribution of mesh among processors.
+ */
+
+#if !defined(pylith_topology_distributor_hh)
+#define pylith_topology_distributor_hh
+
+#include "pylith/utils/sievefwd.hh" // USES PETSc Mesh
+
+namespace pylith {
+  namespace topology {
+    class Distributor;
+    class TestDistributor;
+  } // topology
+
+  namespace meshio {
+    class SolutionIO;
+  } // meshio
+} // pylith
+
+class pylith::topology::Distributor
+{ // Distributor
+  friend class TestDistributor; // unit testing
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public :
+
+  /// Constructor
+  Distributor(void);
+
+  /// Destructor
+  ~Distributor(void);
+
+  /** Distribute mesh among processors.
+   *
+   * @param newMesh Distributed mesh (result).
+   * @param mesh Mesh to distribute.
+   * @param partitioner Name of partitioner to use in distributing mesh.
+   */
+  static
+  void distribute(ALE::Obj<ALE::Mesh>* const newMesh,
+		  const ALE::Obj<ALE::Mesh>& mesh,
+		  const char* partitioner);
+
+  /** Write partitioning info for distributed mesh.
+   *
+   * @param mesh Distributed mesh.
+   * @param writer Writer for partition information.
+   */
+  static
+  void write(const ALE::Obj<ALE::Mesh>& mesh,
+	     meshio::SolutionIO* const writer);
+
+// NOT IMPLEMENTED //////////////////////////////////////////////////////
+private :
+
+  /// Not implemented
+  Distributor(const Distributor&);
+
+  /// Not implemented
+  const Distributor& operator=(const Distributor&);
+
+}; // Distributor
+
+#endif // pylith_topology_distributor_hh
+
+
+// End of file 

Modified: short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src	2007-10-09 12:35:28 UTC (rev 8094)
@@ -663,12 +663,12 @@
     return
 
 
-  def writeField(self, t, field, name, mesh):
+  def writeVertexField(self, t, field, name, mesh):
     """
-    Write solution field to file.
+    Write field over vertices to file.
     """
-    # create shim for method 'writeField'
-    #embed{ void SolutionIO_writeField(void* objVptr, double t, void* fieldVptr, char* name, void* meshVptr)
+    # create shim for method 'writeVertxField'
+    #embed{ void SolutionIO_writeVertexField(void* objVptr, double t, void* fieldVptr, char* name, void* meshVptr)
     try {
       assert(0 != objVptr);
       assert(0 != fieldVptr);
@@ -677,8 +677,8 @@
       ALE::Obj<pylith::real_section_type>* field =
         (ALE::Obj<pylith::real_section_type>*) fieldVptr;
       ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
-      ((pylith::meshio::SolutionIO*) objVptr)->writeField(t, *field, name,
-                                                          *mesh);
+      ((pylith::meshio::SolutionIO*) objVptr)->writeVertexField(t, *field,
+                                                                name, *mesh);
     } catch (const std::exception& err) {
       PyErr_SetString(PyExc_RuntimeError,
                       const_cast<char*>(err.what()));
@@ -695,10 +695,48 @@
             "Argument must be extension module type 'Mesh'."
     cdef void* fieldVptr
     fieldVptr = PyCObject_AsVoidPtr(field)
-    SolutionIO_writeField(self.thisptr, t, fieldVptr, name, ptrFromHandle(mesh))
+    SolutionIO_writeVertexField(self.thisptr, t, fieldVptr, name,
+                                ptrFromHandle(mesh))
     return
 
 
+  def writeCellField(self, t, field, name, mesh):
+    """
+    Write field over cells to file.
+    """
+    # create shim for method 'writeCellField'
+    #embed{ void SolutionIO_writeCellField(void* objVptr, double t, void* fieldVptr, char* name, void* meshVptr)
+    try {
+      assert(0 != objVptr);
+      assert(0 != fieldVptr);
+      assert(0 != name);
+      assert(0 != meshVptr);
+      ALE::Obj<pylith::real_section_type>* field =
+        (ALE::Obj<pylith::real_section_type>*) fieldVptr;
+      ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
+      ((pylith::meshio::SolutionIO*) objVptr)->writeCellField(t, *field, name,
+                                                              *mesh);
+    } catch (const std::exception& err) {
+      PyErr_SetString(PyExc_RuntimeError,
+                      const_cast<char*>(err.what()));
+    } catch (const ALE::Exception& err) {
+      PyErr_SetString(PyExc_RuntimeError,
+                      const_cast<char*>(err.msg().c_str()));
+    } catch (...) {
+      PyErr_SetString(PyExc_RuntimeError,
+                      "Caught unknown C++ exception.");
+    } // try/catch
+    #}embed
+    if not mesh.name == "pylith_topology_Mesh":
+      raise TypeError, \
+            "Argument must be extension module type 'Mesh'."
+    cdef void* fieldVptr
+    fieldVptr = PyCObject_AsVoidPtr(field)
+    SolutionIO_writeCellField(self.thisptr, t, fieldVptr, name,
+                              ptrFromHandle(mesh))
+    return
+
+
   def _createHandle(self):
     """Wrap pointer to C++ object in PyCObject."""
     return PyCObject_FromVoidPtr(self.thisptr, SolutionIO_destructor)

Modified: short/3D/PyLith/trunk/pylith/meshio/SolutionIO.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/SolutionIO.py	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/pylith/meshio/SolutionIO.py	2007-10-09 12:35:28 UTC (rev 8094)
@@ -135,9 +135,9 @@
     return
 
 
-  def writeField(self, t, istep, field, name):
+  def writeVertexField(self, t, istep, field, name):
     """
-    Write solution field at time t to file.
+    Write field over vertices at time t to file.
     """
     write = False
     if self.istep == None or not "value" in dir(self.t):
@@ -151,12 +151,35 @@
       self._info.log("Writing solution field '%s'." % name)
       assert(self.cppHandle != None)
       assert(self.mesh.cppHandle != None)
-      self.cppHandle.writeField(t.value, field, name, self.mesh.cppHandle)
+      self.cppHandle.writeVertexField(t.value, field, name,
+                                      self.mesh.cppHandle)
       self.istep = istep
       self.t = t
     return
 
 
+  def writeCellField(self, t, istep, field, name):
+    """
+    Write field over cells at time t to file.
+    """
+    write = False
+    if self.istep == None or not "value" in dir(self.t):
+      write = True
+    elif self.outputFreq == "skip":
+      if istep > self.istep + self.skip:
+        write = True
+    elif t >= self.t + self.dt:
+      write = True
+    if write:
+      self._info.log("Writing solution field '%s'." % name)
+      assert(self.cppHandle != None)
+      assert(self.mesh.cppHandle != None)
+      self.cppHandle.writeCellField(t.value, field, name, self.mesh.cppHandle)
+      self.istep = istep
+      self.t = t
+    return
+
+
   # PRIVATE METHODS ////////////////////////////////////////////////////
 
   def _configure(self):

Modified: short/3D/PyLith/trunk/tests/distribute/README
===================================================================
--- short/3D/PyLith/trunk/tests/distribute/README	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/tests/distribute/README	2007-10-09 12:35:28 UTC (rev 8094)
@@ -1 +1,24 @@
-tdistribute.py --mesh_generator.importer.filename=tri3a.mesh --mesh_generator.debug=1 --mesh_generator.distributor.debug=1 --mesh_generator.distributor.partitioner=parmetis --nodes=2
+# tri3
+testdistribute.py --mesh_generator.importer.filename=tri3a.mesh --mesh_generator.debug=1 --mesh_generator.distributor.debug=1 --mesh_generator.distributor.partitioner=parmetis --nodes=2
+
+parmetis: reasonable, but not optimal edge cut
+chaco: dumb
+
+# quad4
+testdistribute.py --mesh_generator.importer.filename=quad4a.mesh --mesh_generator.debug=1 --mesh_generator.distributor.debug=1 --mesh_generator.distributor.partitioner=parmetis --nodes=2
+
+parmetis: dumb
+chaco: dumb
+
+# tet4
+testdistribute.py --mesh_generator.importer.filename=tet4a.mesh --mesh_generator.debug=1 --mesh_generator.distributor.debug=1 --mesh_generator.distributor.partitioner=parmetis --nodes=2
+
+parmetis: reasonable, but not optimal edge cut
+chaco: dumb
+
+# hex8
+testdistribute.py --mesh_generator.importer.filename=hex8a.mesh --mesh_generator.debug=1 --mesh_generator.distributor.debug=1 --mesh_generator.distributor.partitioner=parmetis --nodes=2
+
+parmetis: reasonable, but not optimal edge cut
+chaco: dumb
+

Added: short/3D/PyLith/trunk/tests/distribute/hex8a.mesh
===================================================================
--- short/3D/PyLith/trunk/tests/distribute/hex8a.mesh	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/tests/distribute/hex8a.mesh	2007-10-09 12:35:28 UTC (rev 8094)
@@ -0,0 +1,119 @@
+//
+// Vertices
+// z=+1.0
+// 24 --- 25 --- 26
+//  |      |      |
+//  |      |      |
+//  |      |      |
+// 21 --- 22 --- 23
+//  |      |      |
+//  |      |      |
+//  |      |      |
+// 18 --- 19 --- 20
+//
+// z= 0.0
+// 15 --- 16 --- 17
+//  |      |      |
+//  |      |      |
+//  |      |      |
+// 12 --- 13 --- 14
+//  |      |      |
+//  |      |      |
+//  |      |      |
+//  9 --- 10 --- 11
+//
+// z=-1.0
+//  6 ---  7 ---  8
+//  |      |      |
+//  |      |      |
+//  |      |      |
+//  3 ---  4 ---  5
+//  |      |      |
+//  |      |      |
+//  |      |      |
+//  0 ---  1 ---  2
+//
+// Cells (position of cells)
+//     4 ----- 2
+//    /|      /|
+//   / |     / |
+//  0 ----- 6  |
+//  |  |    |  |
+//  |  7 ---|- 1
+//  | /     | /
+//  |/      |/
+//  3 ----- 5
+mesh = {
+  dimension = 3
+  vertices = {
+    dimension = 3
+    count = 27
+    coordinates = {
+      0  -1.0  -1.0  -1.0
+      1   0.0  -1.0  -1.0
+      2  +1.0  -1.0  -1.0
+      3  -1.0   0.0  -1.0
+      4   0.0   0.0  -1.0
+      5  +1.0   0.0  -1.0
+      6  -1.0  +1.0  -1.0
+      7   0.0  +1.0  -1.0
+      8  +1.0  +1.0  -1.0
+      9  -1.0  -1.0   0.0
+     10   0.0  -1.0   0.0
+     11  +1.0  -1.0   0.0
+     12  -1.0   0.0   0.0
+     13   0.0   0.0   0.0
+     14  +1.0   0.0   0.0
+     15  -1.0  +1.0   0.0
+     16   0.0  +1.0   0.0
+     17  +1.0  +1.0   0.0
+     18  -1.0  -1.0  +1.0
+     19   0.0  -1.0  +1.0
+     20  +1.0  -1.0  +1.0
+     21  -1.0   0.0  +1.0
+     22   0.0   0.0  +1.0
+     23  +1.0   0.0  +1.0
+     24  -1.0  +1.0  +1.0
+     25   0.0  +1.0  +1.0
+     26  +1.0  +1.0  +1.0
+    } // coordinates
+  } // vertices
+  
+  cells = {
+    num-corners = 8
+    count = 8
+    simplices = {
+      0     9 10 13 12 18 19 22 21
+      1     4  5  8  7 13 14 17 16
+      2    13 14 17 16 22 23 26 25
+      3     0  1  4  3  9 10 13 12
+      4    12 13 16 15 21 22 25 24
+      5     1  2  5  4 10 11 14 13
+      6    10 11 14 13 19 20 23 22
+      7     3  4  7  6 12 13 16 15
+    } // cells
+
+    material-ids = {
+      0   1
+      1   1
+      2   1
+      3   1
+      4   1
+      5   1
+      6   1
+      7   1
+    } // material-ids
+  } // cells
+
+  group = {
+    type = vertices
+    name = fault
+    count = 9
+    indices = {
+       1  4  7
+      10 13 16
+      19 22 25
+    } // indices
+  } // group
+
+} // mesh

Added: short/3D/PyLith/trunk/tests/distribute/mesherapp.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/distribute/mesherapp.cfg	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/tests/distribute/mesherapp.cfg	2007-10-09 12:35:28 UTC (rev 8094)
@@ -0,0 +1,12 @@
+[mesherapp]
+
+nodes = 2
+
+[mesherapp.mesh_generator]
+
+debug = 1
+distributor.debug = 1
+
+distributor.partitioner = parmetis
+importer.filename = tri3a.mesh
+distributor.writer.filename = tri3a_parmetis.vtk

Added: short/3D/PyLith/trunk/tests/distribute/quad4a.mesh
===================================================================
--- short/3D/PyLith/trunk/tests/distribute/quad4a.mesh	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/tests/distribute/quad4a.mesh	2007-10-09 12:35:28 UTC (rev 8094)
@@ -0,0 +1,117 @@
+//
+//  20 ------- 21 ------- 22 ------- 23 ------- 24
+//   |          |          |          |          |
+//   |          |          |          |          |
+//   |    0     |     4    |     8    |     2    |
+//   |          |          |          |          |
+//   |          |          |          |          |
+//  15 ------- 16 ------- 17 ------- 18 ------- 19
+//   |          |          |          |          |
+//   |          |          |          |          |
+//   |   11     |    13    |    14    |     6    |
+//   |          |          |          |          |
+//   |          |          |          |          |
+//  10 ------- 11 ------- 12 ------- 13 ------- 14
+//   |          |          |          |          |
+//   |          |          |          |          |
+//   |    7     |    15    |    12    |    10    |
+//   |          |          |          |          |
+//   |          |          |          |          |
+//   5 -------  6 -------  7 -------  8 -------  9
+//   |          |          |          |          |
+//   |          |          |          |          |
+//   |    3     |     9    |     5    |     1    |
+//   |          |          |          |          |
+//   |          |          |          |          |
+//   0 -------  1 -------  2 -------  3 -------  4
+//
+mesh = {
+  dimension = 2
+  vertices = {
+    dimension = 2
+    count = 25
+    coordinates = {
+      0  -2.0  -2.0
+      1   1.0  -2.0
+      2   0.0  -2.0
+      3   1.0  -2.0
+      4   2.0  -2.0
+      5  -2.0  -1.0
+      6   1.0  -1.0
+      7   0.0  -1.0
+      8   1.0  -1.0
+      9   2.0  -1.0
+     10  -2.0   0.0
+     11   1.0   0.0
+     12   0.0   0.0
+     13   1.0   0.0
+     14   2.0   0.0
+     15  -2.0   1.0
+     16   1.0   1.0
+     17   0.0   1.0
+     18   1.0   1.0
+     19   2.0   1.0
+     20  -2.0   2.0
+     21   1.0   2.0
+     22   0.0   2.0
+     23   1.0   2.0
+     24   2.0   2.0
+    } // coordinates
+  } // vertices
+  
+  cells = {
+    num-corners = 4
+    count = 16
+    simplices = {
+      0    15 16 21 20
+      1     3  4  9  8
+      2    18 19 24 23
+      3     0  1  6  5
+      4    16 17 22 21
+      5     2  3  8  7
+      6    13 14 19 18
+      7     5  6 11 10
+      8    17 18 23 22
+      9     1  2  7  6
+     10     8  9 14 13
+     11    10 11 16 15
+     12     7  8 13 12
+     13    11 12 17 16
+     14    12 13 18 17
+     15     6  7 12 11
+    } // cells
+
+    material-ids = {
+      0   1
+      1   1
+      2   1
+      3   1
+      4   1
+      5   1
+      6   1
+      7   1
+      8   1
+      9   1
+     10   1
+     11   1
+     12   1
+     13   1
+     14   1
+     15   1
+    } // material-ids
+  } // cells
+
+  group = {
+    type = vertices
+    name = fault
+    count = 5
+    indices = {
+      2
+      7
+     12
+     17
+     22
+    } // indices
+  } // group
+
+} // mesh

Added: short/3D/PyLith/trunk/tests/distribute/tet4a.mesh
===================================================================
--- short/3D/PyLith/trunk/tests/distribute/tet4a.mesh	2007-10-08 03:56:59 UTC (rev 8093)
+++ short/3D/PyLith/trunk/tests/distribute/tet4a.mesh	2007-10-09 12:35:28 UTC (rev 8094)
@@ -0,0 +1,64 @@
+// Vertices
+// z=+1.0
+// 6 --- 7 --- 8
+//
+// z=0.0
+//
+// 0 --- 2 --- 4
+// | \   |   / |
+// |  \  |  /  |
+// |   \ | /   |
+// 1 --- 3 --- 5
+//
+mesh = {
+  dimension = 3
+  vertices = {
+    dimension = 3
+    count = 9
+    coordinates = {
+      0  -1.0  +1.0   0.0
+      1  -1.0  -1.0   0.0
+      2   0.0  +1.0   0.0
+      3   0.0  -1.0   0.0
+      4  +1.0  +1.0   0.0
+      5  +1.0  -1.0   0.0
+      6  -1.0   0.0  +1.0
+      7   0.0   0.0  +1.0
+      8  +1.0   0.0  +1.0
+    } // coordinates
+  } // vertices
+  
+  cells = {
+    num-corners = 4
+    count = 6
+    simplices = {
+      0    2  3  7  0
+      1    3  2  7  4
+      2    0  1  7  6
+      3    3  5  4  7
+      4    0  1  3  7
+      5    3  8  4  7
+    } // cells
+
+    material-ids = {
+      0   1
+      1   1
+      2   1
+      3   1
+      4   1
+      5   1
+    } // material-ids
+  } // cells
+
+  group = {
+    type = vertices
+    name = fault
+    count = 3
+    indices = {
+      2
+      3
+      7
+    } // indices
+  } // group
+
+} // mesh



More information about the cig-commits mailing list