[cig-commits] r15654 - in short/3D/PyLith/trunk: libsrc/faults modulesrc/faults pylith/topology unittests/libtests/bc unittests/libtests/faults unittests/libtests/meshio

knepley at geodynamics.org knepley at geodynamics.org
Fri Sep 4 16:38:32 PDT 2009


Author: knepley
Date: 2009-09-04 16:38:30 -0700 (Fri, 04 Sep 2009)
New Revision: 15654

Modified:
   short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
   short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh
   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/TopologyVisitors.cc
   short/3D/PyLith/trunk/modulesrc/faults/Fault.i
   short/3D/PyLith/trunk/modulesrc/faults/FaultCohesive.i
   short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
   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/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 numbering of new sieve points


Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -124,6 +124,7 @@
                                          const ALE::Obj<topology::Mesh::IntSection>& groupField,
                                          const int materialId,
                                          int& firstFaultVertex,
+                                         int& firstLagrangeVertex,
                                          int& firstFaultCell,
                                          const bool constraintCell)
 { // create
@@ -190,8 +191,9 @@
   std::map<point_type,point_type> vertexRenumber;
   std::map<point_type,point_type> cellRenumber;
   if (firstFaultVertex == 0) {
-    firstFaultVertex += sieve->getBaseSize() + sieve->getCapSize();
-    firstFaultCell   += firstFaultVertex;
+    firstFaultVertex    += sieve->getBaseSize() + sieve->getCapSize();
+    firstLagrangeVertex += firstFaultVertex;
+    firstFaultCell      += firstFaultVertex;
   }
 
   for(SieveSubMesh::label_sequence::iterator v_iter = fVerticesBegin;
@@ -213,12 +215,13 @@
     sieveMesh->setDepth(firstFaultVertex, 0);
 #endif
     if (constraintCell) {
-      groupField->addPoint(firstFaultVertex+numFaultVertices, 1);
+      groupField->addPoint(firstLagrangeVertex, 1);
 #if defined(FAST_STRATIFY)
       // OPTIMIZATION
-      sieveMesh->setHeight(firstFaultVertex+numFaultVertices, 1);
-      sieveMesh->setDepth(firstFaultVertex+numFaultVertices, 0);
+      sieveMesh->setHeight(firstLagrangeVertex, 1);
+      sieveMesh->setDepth(firstLagrangeVertex, 0);
 #endif
+      ++firstLagrangeVertex;
     } // if
     logger.stagePop();
     logger.stagePush("FaultCreation");
@@ -242,9 +245,6 @@
       ++name) {
     sieveMesh->reallocate(sieveMesh->getIntSection(*name));
   } // for
-  if (constraintCell) {
-    firstFaultVertex += numFaultVertices;
-  }
 
   // Split the mesh along the fault sieve and create cohesive elements
   const ALE::Obj<SieveSubMesh::label_sequence>& faces =
@@ -609,8 +609,7 @@
     const ALE::Obj<Mesh::label_type>& label = sieveMesh->createLabel(labelName);
     assert(!label.isNull());
 
-    TopologyOps::computeCensoredDepth(label, sieveMesh->getSieve(),
-				      firstCohesiveCell-(constraintCell?numFaultVertices:0));
+    TopologyOps::computeCensoredDepth(label, sieveMesh->getSieve(), firstFaultVertex);
   } else {
     // Insert new shadow vertices into existing label
     const ALE::Obj<Mesh::label_type>& label = sieveMesh->getLabel(labelName);

Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh	2009-09-04 23:38:30 UTC (rev 15654)
@@ -70,6 +70,7 @@
               const ALE::Obj<topology::Mesh::IntSection>& groupField,
               const int materialId,
               int& firstFaultVertex,
+              int& firstLagrangeVertex,
               int& firstFaultCell,
               const bool constraintCell = false);
 

Modified: short/3D/PyLith/trunk/libsrc/faults/Fault.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/Fault.hh	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/libsrc/faults/Fault.hh	2009-09-04 23:38:30 UTC (rev 15654)
@@ -92,6 +92,7 @@
   virtual
   void adjustTopology(topology::Mesh* const mesh,
                       int *firstFaultVertex,
+                      int *firstLagrangeVertex,
                       int *firstFaultCell,
                       const bool flipFault = false) = 0;
 

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -106,6 +106,7 @@
 void
 pylith::faults::FaultCohesive::adjustTopology(topology::Mesh* const mesh,
                                               int *firstFaultVertex,
+                                              int *firstLagrangeVertex,
                                               int *firstFaultCell,
                                               const bool flipFault)
 { // adjustTopology
@@ -133,7 +134,7 @@
 				  flipFault);
 
     CohesiveTopology::create(mesh, faultMesh, faultBoundary, groupField, id(), 
-			     *firstFaultVertex, *firstFaultCell, useLagrangeConstraints());
+                             *firstFaultVertex, *firstLagrangeVertex, *firstFaultCell, useLagrangeConstraints());
 
   } else {
     //std::cout << "BEFORE ADJUSTING TOPOLOGY FOR FAULT '" << label() << "' firstFaultVertex: " << *firstFaultVertex << ", firstFaultCell: " << *firstFaultCell << std::endl;
@@ -155,7 +156,7 @@
       sieveMesh->getIntSection(label());
     assert(!groupField.isNull());
     CohesiveTopology::create(mesh, faultMesh, faultBoundary, groupField, id(),
-                  *firstFaultVertex, *firstFaultCell, useLagrangeConstraints());
+                             *firstFaultVertex, *firstLagrangeVertex, *firstFaultCell, useLagrangeConstraints());
 
     //std::cout << "AFTER ADJUSTING TOPOLOGY FOR FAULT '" << label() << "' firstFaultVertex: " << *firstFaultVertex << ", firstFaultCell: " << *firstFaultCell << std::endl;
   } // if/else

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh	2009-09-04 23:38:30 UTC (rev 15654)
@@ -71,16 +71,19 @@
   /** 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.
+   * not currently used in the mesh, and firstLagrangeVertex/firstFaultCell are
+   * 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 firstLagrangeVertex The first point eligible to become a new Lagrange vertex
    * @param firstFaultCell The first point eligible to become a new fault cell
    * @param flipFault Flip fault orientation.
    */
   void adjustTopology(topology::Mesh* const mesh,
                       int *firstFaultVertex,
+                      int *firstLagrangeVertex,
                       int *firstFaultCell,
                       const bool flipFault = false);
 

Modified: short/3D/PyLith/trunk/libsrc/faults/TopologyVisitors.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/TopologyVisitors.cc	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/libsrc/faults/TopologyVisitors.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -134,8 +134,15 @@
   } // if
   bool classified = false;
     
-  if (debug)
+  if (debug) {
     std::cout << "Checking neighbor " << point << std::endl;
+    ALE::ISieveVisitor::PointRetriever<Sieve> pR(9);
+
+    sieve.cone(point, pR);
+    for(int i = 0; i < pR.getSize(); ++i) {
+      std::cout << "  cone point " << pR.getPoints()[i] << std::endl;
+    }
+  }
   if (vReplaceCells.find(point) != vReplaceCells.end()) {
     if (debug) 
       std::cout << "  already in replaceCells" << std::endl;

Modified: short/3D/PyLith/trunk/modulesrc/faults/Fault.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/faults/Fault.i	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/modulesrc/faults/Fault.i	2009-09-04 23:38:30 UTC (rev 15654)
@@ -75,6 +75,7 @@
       virtual
       void adjustTopology(pylith::topology::Mesh* const mesh,
                           int *firstFaultVertex,
+                          int *firstLagrangeVertex,
                           int *firstFaultCell,
                           const bool flipFault = false) = 0;
       %clear int *firstFaultVertex, int *firstFaultCell;

Modified: short/3D/PyLith/trunk/modulesrc/faults/FaultCohesive.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/faults/FaultCohesive.i	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/modulesrc/faults/FaultCohesive.i	2009-09-04 23:38:30 UTC (rev 15654)
@@ -62,12 +62,13 @@
        * @param mesh PETSc mesh.
        * @param flipFault Flip fault orientation.
        */
-      %apply int *INOUT {int *firstFaultVertex, int *firstFaultCell};
+      %apply int *INOUT {int *firstFaultVertex, int *firstLagrangeVertex, int *firstFaultCell};
       void adjustTopology(pylith::topology::Mesh* const mesh,
                           int *firstFaultVertex,
+                          int *firstLagrangeVertex,
                           int *firstFaultCell,
                           const bool flipFault = false);
-      %clear int *firstFaultVertex, int *firstFaultCell;
+      %clear int *firstFaultVertex, int *firstLagrangeVertex, int *firstFaultCell;
       
       /** Cohesive cells use Lagrange multiplier constraints?
        *

Modified: short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py	2009-09-04 23:38:30 UTC (rev 15654)
@@ -95,20 +95,22 @@
     #mesh.view("===== MESH BEFORE ADJUSTING TOPOLOGY =====")
 
     if not interfaces is None:
-      firstFaultVertex = 0
-      firstFaultCell   = 0
+      firstFaultVertex    = 0
+      firstLagrangeVertex = 0
+      firstFaultCell      = 0
       for interface in interfaces:
         self._info.log("Counting vertices for fault '%s'." % interface.label())
         nvertices = interface.numVertices(mesh)
-        firstFaultCell += nvertices
+        firstLagrangeVertex += nvertices
+        firstFaultCell      += nvertices
         if interface.useLagrangeConstraints():
           firstFaultCell += nvertices
       for interface in interfaces:
         nvertices = interface.numVertices(mesh)
         self._info.log("Adjusting topology for fault '%s' with %d vertices." % \
                          (interface.label(), nvertices))
-        firstFaultVertex, firstFaultCell = \
-            interface.adjustTopology(mesh, firstFaultVertex, firstFaultCell)
+        firstFaultVertex, firstLagrangeVertex, firstFaultCell = \
+            interface.adjustTopology(mesh, firstFaultVertex, firstLagrangeVertex, firstFaultCell)
         
     #mesh.view("===== MESH AFTER ADJUSTING TOPOLOGY =====")
     #self._info.deactivate()

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -129,11 +129,12 @@
 
   // Adjust topology
   faults::FaultCohesiveKin fault;
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh.sieveMesh()->getIntSection(_data->faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh.sieveMesh()->getIntSection(_data->faultLabel)->size();
+  int firstFaultCell      = mesh.sieveMesh()->getIntSection(_data->faultLabel)->size();
   fault.label(_data->faultLabel);
   fault.id(_data->faultId);
-  fault.adjustTopology(&mesh, &firstFaultVertex, &firstFaultCell, _flipFault);
+  fault.adjustTopology(&mesh, &firstFaultVertex, &firstLagrangeVertex, &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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestBruneSlipFn.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -398,8 +398,9 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultCell      = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
@@ -412,7 +413,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().
@@ -471,8 +472,9 @@
 
   // Create fault mesh
   topology::SubMesh faultMesh;
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  int firstFaultCell      = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
@@ -485,7 +487,7 @@
   CohesiveTopology::create(&mesh, faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(data.faultLabel),
                            data.faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, 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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestConstRateSlipFn.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -317,8 +317,9 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultCell      = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
@@ -331,7 +332,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().
@@ -384,8 +385,9 @@
 
   // Create fault mesh
   topology::SubMesh faultMesh;
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  int firstFaultCell      = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
@@ -398,7 +400,7 @@
   CohesiveTopology::create(&mesh, faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(data.faultLabel),
                            data.faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, 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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestEqKinSrc.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -237,8 +237,9 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultCell      = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
@@ -251,7 +252,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, 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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -492,14 +492,15 @@
   iohandler.read(&mesh);
 
   CPPUNIT_ASSERT(0 != fault);
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh.sieveMesh()->getIntSection("fault")->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh.sieveMesh()->getIntSection("fault")->size();
+  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, &firstFaultVertex, &firstFaultCell, flipFault);
+  fault->adjustTopology(&mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell, flipFault);
   //mesh->view(data.filename);
 
   CPPUNIT_ASSERT_EQUAL(data.cellDim, mesh.dimension());
@@ -626,22 +627,24 @@
   iohandler.read(&mesh);
 
   CPPUNIT_ASSERT(0 != faultA);
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh.sieveMesh()->getIntSection("faultA")->size() + mesh.sieveMesh()->getIntSection("faultB")->size();
+  CPPUNIT_ASSERT(0 != faultB);
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh.sieveMesh()->getIntSection("faultA")->size() + mesh.sieveMesh()->getIntSection("faultB")->size();
+  int firstFaultCell      = mesh.sieveMesh()->getIntSection("faultA")->size() + mesh.sieveMesh()->getIntSection("faultB")->size();
   if (dynamic_cast<FaultCohesive*>(faultA)->useLagrangeConstraints()) {
     firstFaultCell += mesh.sieveMesh()->getIntSection("faultA")->size();
   }
+  if (dynamic_cast<FaultCohesive*>(faultB)->useLagrangeConstraints()) {
+    firstFaultCell += mesh.sieveMesh()->getIntSection("faultB")->size();
+  }
+
   faultA->id(1);
   faultA->label("faultA");
-  faultA->adjustTopology(&mesh, &firstFaultVertex, &firstFaultCell, flipFaultA);
+  faultA->adjustTopology(&mesh, &firstFaultVertex, &firstLagrangeVertex, &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, &firstFaultVertex, &firstFaultCell, flipFaultB);
+  faultB->adjustTopology(&mesh, &firstFaultVertex, &firstLagrangeVertex, &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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -903,8 +903,9 @@
     names[i][1] = '\0';
   } // for
   
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh->sieveMesh()->getIntSection(_data->label)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh->sieveMesh()->getIntSection(_data->label)->size();
+  int firstFaultCell      = mesh->sieveMesh()->getIntSection(_data->label)->size();
   if (fault->useLagrangeConstraints()) {
     firstFaultCell += mesh->sieveMesh()->getIntSection(_data->label)->size();
   }
@@ -913,7 +914,7 @@
   fault->quadrature(_quadrature);
   
   fault->eqsrcs(const_cast<const char**>(names), nsrcs, sources, nsrcs);
-  fault->adjustTopology(mesh, &firstFaultVertex, &firstFaultCell, _flipFault);
+  fault->adjustTopology(mesh, &firstFaultVertex, &firstLagrangeVertex, &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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestLiuCosSlipFn.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -393,8 +393,9 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultCell      = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
@@ -407,7 +408,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().
@@ -466,8 +467,9 @@
 
   // Create fault mesh
   topology::SubMesh faultMesh;
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  int firstFaultCell      = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
@@ -480,7 +482,7 @@
   CohesiveTopology::create(&mesh, faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(data.faultLabel),
                            data.faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, 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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestStepSlipFn.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -309,8 +309,9 @@
   mesh->coordsys(&cs);
 
   // Create fault mesh
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh->sieveMesh()->getIntSection(faultLabel)->size();
+  int firstFaultCell      = mesh->sieveMesh()->getIntSection(faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh->sieveMesh()->getIntSection(faultLabel)->size();
@@ -323,7 +324,7 @@
   CohesiveTopology::create(mesh, *faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(faultLabel),
                            faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, firstFaultCell,
                            useLagrangeConstraints);
   // Need to copy coordinates from mesh to fault mesh since we are not
   // using create() instead of createParallel().
@@ -376,8 +377,9 @@
 
   // Create fault mesh
   topology::SubMesh faultMesh;
-  int firstFaultVertex = 0;
-  int firstFaultCell   = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
+  int firstFaultCell      = mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
   const bool useLagrangeConstraints = true;
   if (useLagrangeConstraints) {
     firstFaultCell += mesh.sieveMesh()->getIntSection(data.faultLabel)->size();
@@ -390,7 +392,7 @@
   CohesiveTopology::create(&mesh, faultMesh, faultBoundary, 
                            sieveMesh->getIntSection(data.faultLabel),
                            data.faultId,
-                           firstFaultVertex, firstFaultCell,
+                           firstFaultVertex, firstLagrangeVertex, 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/meshio/TestDataWriterVTKBCMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -208,14 +208,15 @@
 
   if (0 != _data->faultLabel) {
     faults::FaultCohesiveKin fault;
-    int firstFaultVertex = 0;
-    int firstFaultCell   = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    int firstFaultVertex    = 0;
+    int firstLagrangeVertex = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    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, &firstFaultVertex, &firstFaultCell, _flipFault);
+    fault.adjustTopology(_mesh, &firstFaultVertex, &firstLagrangeVertex, &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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -211,15 +211,16 @@
   iohandler.read(_mesh);
 
   faults::FaultCohesiveKin fault;
-  int firstFaultVertex = 0;
-  int firstFaultCell   = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+  int firstFaultVertex    = 0;
+  int firstLagrangeVertex = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+  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, &firstFaultVertex, &firstFaultCell, _flipFault);
+  fault.adjustTopology(_mesh, &firstFaultVertex, &firstLagrangeVertex, &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-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -269,14 +269,15 @@
 
   if (0 != _data->faultLabel) {
     faults::FaultCohesiveKin fault;
-    int firstFaultVertex = 0;
-    int firstFaultCell   = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    int firstFaultVertex    = 0;
+    int firstLagrangeVertex = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    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, &firstFaultVertex, &firstFaultCell, _flipFault);
+    fault.adjustTopology(_mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell, _flipFault);
   } // if
 } // _initialize
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc	2009-09-04 23:32:56 UTC (rev 15653)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc	2009-09-04 23:38:30 UTC (rev 15654)
@@ -209,14 +209,15 @@
 
   if (0 != _data->faultLabel) {
     faults::FaultCohesiveKin fault;
-    int firstFaultVertex = 0;
-    int firstFaultCell   = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    int firstFaultVertex    = 0;
+    int firstLagrangeVertex = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+    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, &firstFaultVertex, &firstFaultCell, _flipFault);
+    fault.adjustTopology(_mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell, _flipFault);
   } // if
 
   CPPUNIT_ASSERT(0 != _data->bcLabel);



More information about the CIG-COMMITS mailing list