[cig-commits] r15377 - in short/3D/PyLith/trunk: libsrc/faults modulesrc/faults pylith/topology tests/2d/quad4 unittests/libtests/bc unittests/libtests/faults unittests/libtests/faults/data unittests/libtests/meshio

knepley at geodynamics.org knepley at geodynamics.org
Wed Jun 24 08:11:16 PDT 2009


Author: knepley
Date: 2009-06-24 08:11:13 -0700 (Wed, 24 Jun 2009)
New Revision: 15377

Modified:
   short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
   short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh
   short/3D/PyLith/trunk/libsrc/faults/Fault.cc
   short/3D/PyLith/trunk/libsrc/faults/Fault.hh
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.icc
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.icc
   short/3D/PyLith/trunk/modulesrc/faults/Fault.i
   short/3D/PyLith/trunk/modulesrc/faults/FaultCohesive.i
   short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveDyn.i
   short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveKin.i
   short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
   short/3D/PyLith/trunk/tests/2d/quad4/fourcells_twofaults.cfg
   short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestBruneSlipFn.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestConstRateSlipFn.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestEqKinSrc.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestLiuCosSlipFn.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestStepSlipFn.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataQuad4h.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc
Log:
Changed adjustTopology() to fix multiple faults
 - Now you have to pass in point starts for vertices and cells to be added
   which are modified on output
Made usLagrangeConstraints() public



Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -112,6 +112,8 @@
                                          const ALE::Obj<ALE::Mesh>& faultBoundary,
                                          const ALE::Obj<topology::Mesh::IntSection>& groupField,
                                          const int materialId,
+                                         int& firstFaultVertex,
+                                         int& firstFaultCell,
                                          const bool constraintCell)
 { // create
   assert(0 != mesh);
@@ -169,33 +171,36 @@
   const ALE::Obj<std::set<std::string> >& groupNames = 
     sieveMesh->getIntSections();
   assert(!groupNames.isNull());
-  point_type newPoint = sieve->getBaseSize() + sieve->getCapSize();
   const int numFaultVertices = fVertices->size();
   std::map<point_type,point_type> vertexRenumber;
   std::map<point_type,point_type> cellRenumber;
+  if (firstFaultVertex == 0) {
+    firstFaultVertex += sieve->getBaseSize() + sieve->getCapSize();
+    firstFaultCell   += firstFaultVertex;
+  }
 
   for(SieveSubMesh::label_sequence::iterator v_iter = fVerticesBegin;
       v_iter != fVerticesEnd;
-      ++v_iter, ++newPoint) {
-    vertexRenumber[*v_iter] = newPoint;
+      ++v_iter, ++firstFaultVertex) {
+    vertexRenumber[*v_iter] = firstFaultVertex;
     if (debug) 
       std::cout << "Duplicating " << *v_iter << " to "
 		<< vertexRenumber[*v_iter] << std::endl;
 
     // Add shadow and constraint vertices (if they exist) to group
     // associated with fault
-    groupField->addPoint(newPoint, 1);
+    groupField->addPoint(firstFaultVertex, 1);
 #if defined(FAST_STRATIFY)
     // OPTIMIZATION
-    sieveMesh->setHeight(newPoint, 1);
-    sieveMesh->setDepth(newPoint, 0);
+    sieveMesh->setHeight(firstFaultVertex, 1);
+    sieveMesh->setDepth(firstFaultVertex, 0);
 #endif
     if (constraintCell) {
-      groupField->addPoint(newPoint+numFaultVertices, 1);
+      groupField->addPoint(firstFaultVertex+numFaultVertices, 1);
 #if defined(FAST_STRATIFY)
       // OPTIMIZATION
-      sieveMesh->setHeight(newPoint+numFaultVertices, 1);
-      sieveMesh->setDepth(newPoint+numFaultVertices, 0);
+      sieveMesh->setHeight(firstFaultVertex+numFaultVertices, 1);
+      sieveMesh->setDepth(firstFaultVertex+numFaultVertices, 0);
 #endif
     } // if
 
@@ -209,7 +214,7 @@
       const ALE::Obj<IntSection>& group = sieveMesh->getIntSection(*name);
       assert(!group.isNull());
       if (group->getFiberDimension(*v_iter))
-        group->addPoint(newPoint, 1);
+        group->addPoint(firstFaultVertex, 1);
     } // for
   } // for
   const std::set<std::string>::const_iterator namesEnd = groupNames->end();
@@ -218,25 +223,9 @@
       ++name) {
     sieveMesh->reallocate(sieveMesh->getIntSection(*name));
   } // for
-#if 0 // THE CODE BELOW IS WRONG
-#if defined(FAST_STRATIFY)
-  for(SieveSubMesh::label_sequence::iterator v_iter = fVerticesBegin;
-      v_iter != fVerticesEnd;
-      ++v_iter, ++newPoint) {
-    vertexRenumber[*v_iter] = newPoint;
-    // OPTIMIZATION
-    sieveMesh->setHeight(newPoint, 1);
-    sieveMesh->setDepth(newPoint, 0);
-    if (constraintCell) {
-      // OPTIMIZATION
-      sieveMesh->setHeight(newPoint+numFaultVertices, 1);
-      sieveMesh->setDepth(newPoint+numFaultVertices, 0);
-    }
+  if (constraintCell) {
+    firstFaultVertex += numFaultVertices;
   }
-#endif
-#endif
-  if (constraintCell)
-    newPoint += numFaultVertices;
 
   // Split the mesh along the fault sieve and create cohesive elements
   const ALE::Obj<SieveSubMesh::label_sequence>& faces =
@@ -247,7 +236,7 @@
   const ALE::Obj<Mesh::label_type>& material = 
     sieveMesh->getLabel("material-id");
   assert(!material.isNull());
-  const int firstCohesiveCell = newPoint;
+  const int firstCohesiveCell = firstFaultCell;
   TopologyOps::PointSet replaceCells;
   TopologyOps::PointSet noReplaceCells;
   TopologyOps::PointSet replaceVertices;
@@ -257,7 +246,7 @@
 
   for(SieveSubMesh::label_sequence::iterator f_iter = facesBegin;
       f_iter != facesEnd;
-      ++f_iter, ++newPoint) {
+      ++f_iter, ++firstFaultCell) {
     const point_type face = *f_iter;
     if (debug)
       std::cout << "Considering fault face " << face << std::endl;
@@ -284,8 +273,8 @@
     if (faceVertices.size() != coneSize) {
       std::cout << "Invalid size for faceVertices " << faceVertices.size()
 		<< " of face " << face << "should be " << coneSize << std::endl;
-      std::cout << "  firstCohesiveCell " << firstCohesiveCell << " newPoint " 
-		<< newPoint << " numFaces " << faces->size() << std::endl;
+      std::cout << "  firstCohesiveCell " << firstCohesiveCell << " firstFaultCell " 
+		<< firstFaultCell << " numFaces " << faces->size() << std::endl;
       std::cout << "  faceSet:" << std::endl;
       for(std::set<Mesh::point_type>::const_iterator p_iter = faceSet.begin();
 	  p_iter != faceSet.end();
@@ -370,33 +359,33 @@
     noReplaceCells.insert(otherCell);
     replaceCells.insert(cell);
     replaceVertices.insert(faceCone, &faceCone[coneSize]);
-    cellRenumber[cell] = newPoint;
+    cellRenumber[cell] = firstFaultCell;
     // Adding cohesive cell (not interpolated)
     if (debug)
-      std::cout << "  Creating cohesive cell " << newPoint << std::endl;
+      std::cout << "  Creating cohesive cell " << firstFaultCell << std::endl;
     for (int c = 0; c < coneSize; ++c) {
       if (debug)
 	std::cout << "    vertex " << faceCone[c] << std::endl;
-      sieve->addArrow(faceCone[c], newPoint);
+      sieve->addArrow(faceCone[c], firstFaultCell);
     } // for
     for (int c = 0; c < coneSize; ++c) {
       if (debug)
 	std::cout << "    shadow vertex " << vertexRenumber[faceCone[c]] << std::endl;
-      sieve->addArrow(vertexRenumber[faceCone[c]], newPoint);
+      sieve->addArrow(vertexRenumber[faceCone[c]], firstFaultCell, true);
     } // for
     if (constraintCell) {
       for (int c = 0; c < coneSize; ++c) {
         if (debug)
 	  std::cout << "    Lagrange vertex " << vertexRenumber[faceCone[c]]+numFaultVertices << std::endl;
-        sieve->addArrow(vertexRenumber[faceCone[c]]+numFaultVertices, newPoint);
+        sieve->addArrow(vertexRenumber[faceCone[c]]+numFaultVertices, firstFaultCell, true);
       } // for
     } // if
     // TODO: Need to reform the material label when sieve is reallocated
-    sieveMesh->setValue(material, newPoint, materialId);
+    sieveMesh->setValue(material, firstFaultCell, materialId);
 #if defined(FAST_STRATIFY)
     // OPTIMIZATION
-    sieveMesh->setHeight(newPoint, 0);
-    sieveMesh->setDepth(newPoint, 1);
+    sieveMesh->setHeight(firstFaultCell, 0);
+    sieveMesh->setDepth(firstFaultCell, 1);
 #endif
     sV2.clear();
     cV2.clear();
@@ -446,7 +435,7 @@
         if (debug)
 	  std::cout << "    Adding new support " << vertexRenumber[*v_iter]
 		    << " --> " << support[s] << std::endl;
-        sieve->addArrow(vertexRenumber[*v_iter], support[s]);
+        sieve->addArrow(vertexRenumber[*v_iter], support[s], true);
       } else {
         if (debug)
 	  std::cout << "    Keeping same support " << *v_iter<<","
@@ -687,11 +676,12 @@
   assert(!cohesiveCells.isNull());
   const SieveMesh::label_sequence::iterator cBegin = cohesiveCells->begin();
   const SieveMesh::label_sequence::iterator cEnd = cohesiveCells->end();
-  const int sieveEnd = sieve->getBaseSize() + sieve->getCapSize();
+  const int sieveEnd = *std::max_element(sieve->getChart().begin(), sieve->getChart().end())+1;
   const int numFaces = cohesiveCells->size();
   int globalSieveEnd = 0;
   int globalFaceOffset = 0;
 
+  // TODO: For multiple faults, this produces duplicate names. Not sure if we need to worry
   MPI_Allreduce((void *) &sieveEnd, (void *) &globalSieveEnd, 1,
 		MPI_INT, MPI_SUM, sieve->comm());
   MPI_Scan((void *) &numFaces, (void *) &globalFaceOffset, 1,

Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh	2009-06-24 15:11:13 UTC (rev 15377)
@@ -51,9 +51,15 @@
 
   /** Create cohesive cells.
    *
+   * If firstFaultVertex == 0, then firstFaultVertex is set to the first point
+   * not currently used in the mesh, and firstFaultCell is incremented with this
+   * point. These values are updated as new fault vertices and cells are added.
+   *
    * @param fault Finite-element mesh of fault (output)
    * @param mesh Finite-element mesh
    * @param materialId Material id for cohesive elements.
+   * @param firstFaultVertex The first point eligible to become a new fault vertex
+   * @param firstFaultCell The first point eligible to become a new fault cell
    * @param constraintCell True if creating cells constrained with 
    *   Lagrange multipliers that require extra vertices, false otherwise
    */
@@ -63,7 +69,9 @@
               const ALE::Obj<ALE::Mesh>& faultBoundary,
               const ALE::Obj<topology::Mesh::IntSection>& groupField,
               const int materialId,
-              const bool constraintCell =false);
+              int& firstFaultVertex,
+              int& firstFaultCell,
+              const bool constraintCell = false);
 
   /** Create (distributed) fault mesh from cohesive cells.
    *

Modified: short/3D/PyLith/trunk/libsrc/faults/Fault.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/Fault.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/Fault.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -43,10 +43,21 @@
 // ----------------------------------------------------------------------
 // Get mesh associated with fault fields.
 const pylith::topology::SubMesh&
-pylith::faults::Fault:: faultMesh(void) const
+pylith::faults::Fault::faultMesh(void) const
 { // faultMesh
   return *_faultMesh;
 } // faultMesh
 
+// ----------------------------------------------------------------------
+// Get mesh associated with fault fields.
+int
+pylith::faults::Fault::faultSize(topology::Mesh* const mesh) const
+{ // faultSize
+  assert(0 != mesh);
+  assert(std::string("") != label());
+  const ALE::Obj<topology::Mesh::IntSection>& groupField = 
+    mesh->sieveMesh()->getIntSection(label());
+  return groupField->size();
+} // faultSize
 
 // End of file 

Modified: short/3D/PyLith/trunk/libsrc/faults/Fault.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/Fault.hh	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/Fault.hh	2009-06-24 15:11:13 UTC (rev 15377)
@@ -77,13 +77,22 @@
    */
   const char* label(void) const;
 
+  /** Get the number of vertices on the fault.
+   *
+   * @param mesh PETSc mesh
+   * @return faults size
+   */
+  int faultSize(topology::Mesh* const mesh) const;
+
   /** Adjust mesh topology for fault implementation.
    *
    * @param mesh PETSc mesh
    */
   virtual
   void adjustTopology(topology::Mesh* const mesh,
-		      const bool flipFault =false) = 0;
+                      int *firstFaultVertex,
+                      int *firstFaultCell,
+                      const bool flipFault = false) = 0;
 
   /** Initialize fault. Determine orientation and setup boundary
    * condition parameters.

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -66,7 +66,9 @@
 // Adjust mesh topology for fault implementation.
 void
 pylith::faults::FaultCohesive::adjustTopology(topology::Mesh* const mesh,
-					      const bool flipFault)
+                                              int *firstFaultVertex,
+                                              int *firstFaultCell,
+                                              const bool flipFault)
 { // adjustTopology
   assert(0 != mesh);
   assert(std::string("") != label());
@@ -101,7 +103,7 @@
       sieveMesh->getIntSection(label());
     assert(!groupField.isNull());
     CohesiveTopology::create(mesh, faultMesh, faultBoundary, groupField, id(),
-			     _useLagrangeConstraints());
+                  *firstFaultVertex, *firstFaultCell, useLagrangeConstraints());
   } else {
     if (!sieveMesh->hasIntSection(label())) {
       std::ostringstream msg;
@@ -116,7 +118,7 @@
 				  flipFault);
 
     CohesiveTopology::create(mesh, faultMesh, faultBoundary, groupField, id(), 
-			     _useLagrangeConstraints());
+			     *firstFaultVertex, *firstFaultCell, useLagrangeConstraints());
   } // if/else
 } // adjustTopology
 

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh	2009-06-24 15:11:13 UTC (rev 15377)
@@ -57,22 +57,27 @@
 
   /** Adjust mesh topology for fault implementation.
    *
+   * If firstFaultVertex == 0, then firstFaultVertex is set to the first point
+   * not currently used in the mesh, and firstFaultCell is incremented with this
+   * point. These values are updated as new fault vertices and cells are added.
+   *
    * @param mesh PETSc mesh.
+   * @param firstFaultVertex The first point eligible to become a new fault vertex
+   * @param firstFaultCell The first point eligible to become a new fault cell
    * @param flipFault Flip fault orientation.
    */
   void adjustTopology(topology::Mesh* const mesh,
-		      const bool flipFault =false);
+                      int *firstFaultVertex,
+                      int *firstFaultCell,
+                      const bool flipFault = false);
 
-  // PROTECTED METHODS //////////////////////////////////////////////////
-protected :
-
   /** Cohesive cells use Lagrange multiplier constraints?
    *
    * @returns True if implementation using Lagrange multiplier
    * constraints, false otherwise.
    */
   virtual
-  bool _useLagrangeConstraints(void) const = 0;
+  bool useLagrangeConstraints(void) const = 0;
 
   // PRIVATE MEMBERS ////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh	2009-06-24 15:11:13 UTC (rev 15377)
@@ -114,15 +114,12 @@
   cellField(const char* name,
 	    const topology::SolutionFields* fields =0);
 
-  // PROTECTED METHODS //////////////////////////////////////////////////
-protected :
-
   /** Cohesive cells use Lagrange multiplier constraints?
    *
    * @returns True if implementation using Lagrange multiplier
    * constraints, false otherwise.
    */
-  bool _useLagrangeConstraints(void) const;
+  bool useLagrangeConstraints(void) const;
 
   // NOT IMPLEMENTED ////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.icc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.icc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -17,7 +17,7 @@
 // Cohesive cells use Lagrange multiplier constraints?
 inline
 bool
-pylith::faults::FaultCohesiveDyn::_useLagrangeConstraints(void) const {
+pylith::faults::FaultCohesiveDyn::useLagrangeConstraints(void) const {
   return false;
 } // useLagrangeConstraints
 

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -107,7 +107,7 @@
   
   delete _faultMesh; _faultMesh = new topology::SubMesh();
   CohesiveTopology::createFaultParallel(_faultMesh, &_cohesiveToFault, 
-					mesh, id(), _useLagrangeConstraints());
+					mesh, id(), useLagrangeConstraints());
 
   delete _fields; 
   _fields = new topology::Fields<topology::Field<topology::SubMesh> >(*_faultMesh);

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh	2009-06-24 15:11:13 UTC (rev 15377)
@@ -191,15 +191,12 @@
   cellField(const char* name,
 	    const topology::SolutionFields* fields =0);
 
-  // PROTECTED METHODS //////////////////////////////////////////////////
-protected :
-
   /** Cohesive cells use Lagrange multiplier constraints?
    *
    * @returns True if implementation using Lagrange multiplier
    * constraints, false otherwise.
    */
-  bool _useLagrangeConstraints(void) const;
+  bool useLagrangeConstraints(void) const;
 
   // PRIVATE METHODS ////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.icc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.icc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -17,7 +17,7 @@
 // Cohesive cells use Lagrange multiplier constraints?
 inline
 bool
-pylith::faults::FaultCohesiveKin::_useLagrangeConstraints(void) const {
+pylith::faults::FaultCohesiveKin::useLagrangeConstraints(void) const {
   return true;
 } // useLagrangeConstraints
 

Modified: short/3D/PyLith/trunk/modulesrc/faults/Fault.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/faults/Fault.i	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/modulesrc/faults/Fault.i	2009-06-24 15:11:13 UTC (rev 15377)
@@ -58,14 +58,25 @@
        * @returns Label of fault
        */
       const char* label(void) const;
+
+      /** Get the number of vertices on the fault.
+       *
+       * @param mesh PETSc mesh
+       * @return faults size
+       */
+      int faultSize(topology::Mesh* const mesh) const;
       
       /** Adjust mesh topology for fault implementation.
        *
        * @param mesh PETSc mesh
        */
+      %apply int *INOUT {int *firstFaultVertex, int *firstFaultCell};
       virtual
       void adjustTopology(pylith::topology::Mesh* const mesh,
-			  const bool flipFault =false) = 0;
+                          int *firstFaultVertex,
+                          int *firstFaultCell,
+                          const bool flipFault = false) = 0;
+      %clear int *firstFaultVertex, int *firstFaultCell;
       
       /** Initialize fault. Determine orientation and setup boundary
        * condition parameters.

Modified: short/3D/PyLith/trunk/modulesrc/faults/FaultCohesive.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/faults/FaultCohesive.i	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/modulesrc/faults/FaultCohesive.i	2009-06-24 15:11:13 UTC (rev 15377)
@@ -54,19 +54,20 @@
        * @param mesh PETSc mesh.
        * @param flipFault Flip fault orientation.
        */
+      %apply int *INOUT {int *firstFaultVertex, int *firstFaultCell};
       void adjustTopology(pylith::topology::Mesh* const mesh,
-			  const bool flipFault =false);
+                          int *firstFaultVertex,
+                          int *firstFaultCell,
+                          const bool flipFault = false);
+      %clear int *firstFaultVertex, int *firstFaultCell;
       
-      // PROTECTED METHODS //////////////////////////////////////////////////
-    protected :
-      
       /** Cohesive cells use Lagrange multiplier constraints?
        *
        * @returns True if implementation using Lagrange multiplier
        * constraints, false otherwise.
        */
       virtual
-      bool _useLagrangeConstraints(void) const = 0;
+      bool useLagrangeConstraints(void) const = 0;
       
     }; // class FaultCohesive
 

Modified: short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveDyn.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveDyn.i	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveDyn.i	2009-06-24 15:11:13 UTC (rev 15377)
@@ -99,16 +99,13 @@
       const pylith::topology::Field<pylith::topology::SubMesh>&
       cellField(const char* name,
 		const pylith::topology::SolutionFields* fields =0);
-      
-      // PROTECTED METHODS //////////////////////////////////////////////
-    protected :
 
       /** Cohesive cells use Lagrange multiplier constraints?
        *
        * @returns True if implementation using Lagrange multiplier
        * constraints, false otherwise.
        */
-      bool _useLagrangeConstraints(void) const;
+      bool useLagrangeConstraints(void) const;
 
     }; // class FaultCohesiveDyn
 

Modified: short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveKin.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveKin.i	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveKin.i	2009-06-24 15:11:13 UTC (rev 15377)
@@ -143,15 +143,12 @@
       cellField(const char* name,
 		const pylith::topology::SolutionFields* fields =0);
 
-      // PROTECTED METHODS //////////////////////////////////////////////
-    protected :
-
       /** Cohesive cells use Lagrange multiplier constraints?
        *
        * @returns True if implementation using Lagrange multiplier
        * constraints, false otherwise.
        */
-      bool _useLagrangeConstraints(void) const;
+      bool useLagrangeConstraints(void) const;
 
     }; // class FaultCohesiveKin
 

Modified: short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py	2009-06-24 15:11:13 UTC (rev 15377)
@@ -92,9 +92,15 @@
     self._eventLogger.eventBegin(logEvent)
     
     if not interfaces is None:
+      firstFaultVertex = 0
+      firstFaultCell   = 0
       for interface in interfaces:
+        firstFaultCell += interface.faultSize(mesh)
+        if interface.useLagrangeConstraints():
+          firstFaultCell += interface.faultSize(mesh)
+      for interface in interfaces:
         self._info.log("Adjusting topology for fault '%s'." % interface.label)
-        interface.adjustTopology(mesh)
+        firstFaultVertex, firstFaultCell = interface.adjustTopology(mesh, firstFaultVertex, firstFaultCell)
 
     self._eventLogger.eventEnd(logEvent)
     return

Modified: short/3D/PyLith/trunk/tests/2d/quad4/fourcells_twofaults.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/2d/quad4/fourcells_twofaults.cfg	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/tests/2d/quad4/fourcells_twofaults.cfg	2009-06-24 15:11:13 UTC (rev 15377)
@@ -2,7 +2,7 @@
 [pylithapp]
 
 [pylithapp.launcher] # WARNING: THIS IS NOT PORTABLE
-command = mpirun -np ${nodes}
+#command = mpirun -np ${nodes}
 
 # ----------------------------------------------------------------------
 # journal
@@ -53,6 +53,7 @@
 db_properties.iohandler.filename = matprops.spatialdb
 quadrature.cell = pylith.feassemble.FIATLagrange
 quadrature.cell.dimension = 2
+quadrature.min_jacobian = 1.0e-9
 
 # ----------------------------------------------------------------------
 # boundary conditions

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -129,9 +129,11 @@
 
   // Adjust topology
   faults::FaultCohesiveKin fault;
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh.sieveMesh()->getIntSection(_data->faultLabel)->size();
   fault.label(_data->faultLabel);
   fault.id(_data->faultId);
-  fault.adjustTopology(&mesh, _flipFault);
+  fault.adjustTopology(&mesh, &firstFaultVertex, &firstFaultCell, _flipFault);
 
   // Create submesh
   topology::SubMesh submesh(mesh, _data->bcLabel);

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestBruneSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestBruneSlipFn.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestBruneSlipFn.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -398,7 +398,12 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh->sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -407,6 +412,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().
@@ -465,7 +471,12 @@
 
   // Create fault mesh
   topology::SubMesh faultMesh;
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -474,6 +485,7 @@
   CohesiveTopology::create(&mesh, faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(data.faultLabel),
                            data.faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestConstRateSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestConstRateSlipFn.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestConstRateSlipFn.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -317,7 +317,12 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh->sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -326,6 +331,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().
@@ -378,7 +384,12 @@
 
   // Create fault mesh
   topology::SubMesh faultMesh;
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -387,6 +398,7 @@
   CohesiveTopology::create(&mesh, faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(data.faultLabel),
                            data.faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestEqKinSrc.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestEqKinSrc.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestEqKinSrc.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -237,7 +237,12 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh->sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -246,6 +251,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -492,9 +492,14 @@
   iohandler.read(&mesh);
 
   CPPUNIT_ASSERT(0 != fault);
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh.sieveMesh()->getIntSection("fault")->size();
+  if (dynamic_cast<FaultCohesive*>(fault)->useLagrangeConstraints()) {
+    firstFaultCell += mesh.sieveMesh()->getIntSection("fault")->size();
+  }
   fault->id(1);
   fault->label("fault");
-  fault->adjustTopology(&mesh, flipFault);
+  fault->adjustTopology(&mesh, &firstFaultVertex, &firstFaultCell, flipFault);
   //mesh->view(data.filename);
 
   CPPUNIT_ASSERT_EQUAL(data.cellDim, mesh.dimension());
@@ -621,14 +626,22 @@
   iohandler.read(&mesh);
 
   CPPUNIT_ASSERT(0 != faultA);
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh.sieveMesh()->getIntSection("faultA")->size() + mesh.sieveMesh()->getIntSection("faultB")->size();
+  if (dynamic_cast<FaultCohesive*>(faultA)->useLagrangeConstraints()) {
+    firstFaultCell += mesh.sieveMesh()->getIntSection("faultA")->size();
+  }
   faultA->id(1);
   faultA->label("faultA");
-  faultA->adjustTopology(&mesh, flipFaultA);
+  faultA->adjustTopology(&mesh, &firstFaultVertex, &firstFaultCell, flipFaultA);
 
   CPPUNIT_ASSERT(0 != faultB);
+  if (dynamic_cast<FaultCohesive*>(faultB)->useLagrangeConstraints()) {
+    firstFaultCell += mesh.sieveMesh()->getIntSection("faultB")->size();
+  }
   faultB->id(2);
   faultB->label("faultB");
-  faultB->adjustTopology(&mesh, flipFaultB);
+  faultB->adjustTopology(&mesh, &firstFaultVertex, &firstFaultCell, flipFaultB);
 
   //sieveMesh->view(data.filename);
   CPPUNIT_ASSERT_EQUAL(data.cellDim, mesh.dimension());

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -129,7 +129,7 @@
 pylith::faults::TestFaultCohesiveKin::testUseLagrangeConstraints(void)
 { // testUseLagrangeConstraints
   FaultCohesiveKin fault;
-  CPPUNIT_ASSERT_EQUAL(true, fault._useLagrangeConstraints());
+  CPPUNIT_ASSERT_EQUAL(true, fault.useLagrangeConstraints());
 } // testUseLagrangeConstraints
 
 // ----------------------------------------------------------------------
@@ -903,12 +903,17 @@
     names[i][1] = '\0';
   } // for
   
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh->sieveMesh()->getIntSection(_data->label)->size();
+  if (fault->useLagrangeConstraints()) {
+    firstFaultCell += mesh->sieveMesh()->getIntSection(_data->label)->size();
+  }
   fault->id(_data->id);
   fault->label(_data->label);
   fault->quadrature(_quadrature);
   
   fault->eqsrcs(const_cast<const char**>(names), nsrcs, sources, nsrcs);
-  fault->adjustTopology(mesh, _flipFault);
+  fault->adjustTopology(mesh, &firstFaultVertex, &firstFaultCell, _flipFault);
   
   const double upDir[] = { 0.0, 0.0, 1.0 };
   const double normalDir[] = { 1.0, 0.0, 0.0 };

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestLiuCosSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestLiuCosSlipFn.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestLiuCosSlipFn.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -393,7 +393,12 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh->sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -402,6 +407,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().
@@ -460,7 +466,12 @@
 
   // Create fault mesh
   topology::SubMesh faultMesh;
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -469,6 +480,7 @@
   CohesiveTopology::create(&mesh, faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(data.faultLabel),
                            data.faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestStepSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestStepSlipFn.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestStepSlipFn.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -309,7 +309,12 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh->sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -318,6 +323,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().
@@ -370,7 +376,12 @@
 
   // Create fault mesh
   topology::SubMesh faultMesh;
+  int firstFaultVertex = 0;
+  int firstFaultCell   = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
   const bool useLagrangeConstraints = true;
+  if (useLagrangeConstraints) {
+    firstFaultCell += mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  }
   ALE::Obj<ALE::Mesh> faultBoundary = 0;
   const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());
@@ -379,6 +390,7 @@
   CohesiveTopology::create(&mesh, faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(data.faultLabel),
                            data.faultId,
+                           firstFaultVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataQuad4h.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataQuad4h.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataQuad4h.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -37,15 +37,15 @@
  *
  * 9 ----10 ----25-11 ----12
  * |      |      |  |      |
- * |  0   |  1   |28|  2   |
+ * |  0   |  1   |30|  2   |
  * |      |      |  |      |
  * |      |      |  |      |
  *13 ----14 ----26-15 ----16
  * |      |      |  |      |
- * |  3   |  4   |29|  5   |
+ * |  3   |  4   |31|  5   |
  * |      |      |  |      |
  * |      |      |  |      |
- *30 ----31-----27-19 ----20
+ *28 ----29-----27-19 ----20
  * |  32  |      |         |
  *17 ----18      |         |
  * |      |   7  |     8   |
@@ -109,15 +109,15 @@
    9, 13, 14, 10,
   10, 14, 26, 25,
   11, 15, 16, 12,
-  13, 30, 31, 14,
-  14, 31, 27, 26,
+  13, 28, 29, 14,
+  14, 29, 27, 26,
   15, 19, 20, 16,
   17, 21, 22, 18,
-  31, 22, 23, 27,
+  29, 22, 23, 27,
   27, 23, 24, 20,
   11, 15, 25, 26,
   15, 19, 26, 27,
-  18, 17, 31, 30,
+  18, 17, 29, 28,
 };
 
 const int pylith::faults::CohesiveDataQuad4h::_materialIds[] = {
@@ -132,7 +132,7 @@
 
 const int pylith::faults::CohesiveDataQuad4h::_groups[] = {
   11, 15, 19, 25, 26, 27,
-  17, 18, 30, 31,
+  17, 18, 28, 29,
 };
 
 const char* pylith::faults::CohesiveDataQuad4h::_groupNames[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -208,9 +208,14 @@
 
   if (0 != _data->faultLabel) {
     faults::FaultCohesiveKin fault;
+    int firstFaultVertex = 0;
+    int firstFaultCell   = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    if (fault.useLagrangeConstraints()) {
+      firstFaultCell += _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    }
     fault.label(_data->faultLabel);
     fault.id(_data->faultId);
-    fault.adjustTopology(_mesh, _flipFault);
+    fault.adjustTopology(_mesh, &firstFaultVertex, &firstFaultCell, _flipFault);
   } // if
 
   delete _submesh; _submesh = new topology::SubMesh(*_mesh, _data->bcLabel);

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -211,10 +211,15 @@
   iohandler.read(_mesh);
 
   faults::FaultCohesiveKin fault;
+  int firstFaultVertex = 0;
+  int firstFaultCell   = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+  const bool constraintCell = true;
+  if (constraintCell) {
+    firstFaultCell += _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+  }
   fault.label(_data->faultLabel);
   fault.id(_data->faultId);
-  fault.adjustTopology(_mesh, _flipFault);
-  const bool constraintCell = true;
+  fault.adjustTopology(_mesh, &firstFaultVertex, &firstFaultCell, _flipFault);
   std::map<Mesh::point_type, Mesh::point_type> cohesiveToFault;
   faults::CohesiveTopology::createFaultParallel(_faultMesh, &cohesiveToFault,
 						*_mesh, _data->faultId,

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -269,9 +269,14 @@
 
   if (0 != _data->faultLabel) {
     faults::FaultCohesiveKin fault;
+    int firstFaultVertex = 0;
+    int firstFaultCell   = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    if (fault.useLagrangeConstraints()) {
+      firstFaultCell += _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    }
     fault.label(_data->faultLabel);
     fault.id(_data->faultId);
-    fault.adjustTopology(_mesh, _flipFault);
+    fault.adjustTopology(_mesh, &firstFaultVertex, &firstFaultCell, _flipFault);
   } // if
 } // _initialize
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc	2009-06-24 13:59:41 UTC (rev 15376)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc	2009-06-24 15:11:13 UTC (rev 15377)
@@ -209,9 +209,14 @@
 
   if (0 != _data->faultLabel) {
     faults::FaultCohesiveKin fault;
+    int firstFaultVertex = 0;
+    int firstFaultCell   = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    if (fault.useLagrangeConstraints()) {
+      firstFaultCell += _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    }
     fault.label(_data->faultLabel);
     fault.id(_data->faultId);
-    fault.adjustTopology(_mesh, _flipFault);
+    fault.adjustTopology(_mesh, &firstFaultVertex, &firstFaultCell, _flipFault);
   } // if
 
   CPPUNIT_ASSERT(0 != _data->bcLabel);



More information about the CIG-COMMITS mailing list