[cig-commits] r22707 - in short/3D/PyLith/trunk/unittests/libtests/faults: . data

knepley at geodynamics.org knepley at geodynamics.org
Wed Aug 7 02:32:10 PDT 2013


Author: knepley
Date: 2013-08-07 02:32:10 -0700 (Wed, 07 Aug 2013)
New Revision: 22707

Modified:
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultMesh.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3e.cc
Log:
Fixes to allow testing of interpolated meshes with faults

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc	2013-08-07 09:32:10 UTC (rev 22707)
@@ -65,7 +65,7 @@
 
   CohesiveDataLine2 data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyLine2
@@ -81,7 +81,7 @@
 
   CohesiveDataTri3 data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTri3
@@ -97,7 +97,7 @@
 
   CohesiveDataTri3b data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTri3b
@@ -113,7 +113,7 @@
 
   CohesiveDataTri3c data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTri3c
@@ -129,7 +129,7 @@
 
   CohesiveDataTri3d data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTri3d
@@ -145,7 +145,7 @@
 
   CohesiveDataTri3e data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTri3e
@@ -161,7 +161,7 @@
 
   CohesiveDataTri3f data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTri3f
@@ -177,7 +177,7 @@
 
   CohesiveDataQuad4 data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyQuad4
@@ -193,7 +193,7 @@
 
   CohesiveDataQuad4b data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyQuad4b
@@ -209,7 +209,7 @@
 
   CohesiveDataQuad4c data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyQuad4c
@@ -225,7 +225,7 @@
 
   CohesiveDataQuad4d data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyQuad4d
@@ -241,7 +241,7 @@
 
   CohesiveDataQuad4e data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyQuad4e
@@ -257,7 +257,7 @@
 
   CohesiveDataQuad4f data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyQuad4f
@@ -273,7 +273,7 @@
 
   CohesiveDataQuad4g data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyQuad4g
@@ -306,7 +306,7 @@
 
   CohesiveDataTet4 data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4
@@ -322,7 +322,7 @@
 
   CohesiveDataTet4b data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4b
@@ -338,7 +338,7 @@
 
   CohesiveDataTet4c data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4c
@@ -354,7 +354,7 @@
 
   CohesiveDataTet4d data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4d
@@ -370,7 +370,7 @@
 
   CohesiveDataTet4f data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4f
@@ -386,7 +386,7 @@
 
   CohesiveDataTet4g data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4g
@@ -402,7 +402,7 @@
 
   CohesiveDataTet4h data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4h
@@ -418,7 +418,7 @@
 
   CohesiveDataTet4i data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4i
@@ -434,7 +434,7 @@
 
   CohesiveDataTet4j data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4j
@@ -450,7 +450,7 @@
 
   CohesiveDataHex8 data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8
@@ -466,7 +466,7 @@
 
   CohesiveDataHex8b data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8b
@@ -482,7 +482,7 @@
 
   CohesiveDataHex8c data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8c
@@ -498,7 +498,7 @@
 
   CohesiveDataHex8d data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8d
@@ -514,7 +514,7 @@
 
   CohesiveDataHex8e data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8e
@@ -530,7 +530,7 @@
 
   CohesiveDataHex8f data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8f
@@ -546,7 +546,7 @@
 
   CohesiveDataHex8g data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8g
@@ -562,7 +562,7 @@
 
   CohesiveDataHex8h data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8h
@@ -578,7 +578,7 @@
 
   CohesiveDataHex8i data;
   FaultCohesiveTract fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8i
@@ -595,7 +595,7 @@
 
   CohesiveDataLine2Lagrange data;
   FaultCohesiveKin fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyLine2Lagrange
@@ -612,7 +612,7 @@
 
   CohesiveDataTri3Lagrange data;
   FaultCohesiveKin fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTri3Lagrange
@@ -629,7 +629,7 @@
 
   CohesiveDataQuad4Lagrange data;
   FaultCohesiveKin fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyQuad4Lagrange
@@ -646,7 +646,7 @@
 
   CohesiveDataTet4Lagrange data;
   FaultCohesiveKin fault;
-  _testAdjustTopology(&fault, data, false);
+  _testAdjustTopology(&fault, data, false, false);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyTet4Lagrange
@@ -663,7 +663,7 @@
 
   CohesiveDataHex8Lagrange data;
   FaultCohesiveKin fault;
-  _testAdjustTopology(&fault, data, true);
+  _testAdjustTopology(&fault, data, true, true);
 
   PYLITH_METHOD_END;
 } // testAdjustTopologyHex8Lagrange
@@ -673,7 +673,8 @@
 void
 pylith::faults::TestFaultCohesive::_testAdjustTopology(Fault* fault,
 						       const CohesiveData& data,
-						       const bool flipFault)
+                               const bool flipFault,
+                               const bool flipFaultInt)
 { // _testAdjustTopology
   PYLITH_METHOD_BEGIN;
 
@@ -694,20 +695,29 @@
   spatialdata::units::Nondimensional normalizer;
   topology::MeshOps::nondimensionalize(&mesh, normalizer);
 
-  PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
-  PetscInt firstFaultVertex = 0;
-  PetscInt firstLagrangeVertex = 0, firstFaultCell = 0;
+  PetscDM        dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
+  PetscInt       depth, firstFaultVertex = 0;
+  PetscInt       firstLagrangeVertex = 0, firstFaultCell = 0;
+  PetscBool      isInterpolated;
   PetscErrorCode err;
 
+  err = DMPlexGetDepth(dmMesh, &depth);PYLITH_CHECK_ERROR(err);
   err = DMPlexGetStratumSize(dmMesh, "fault", 1, &firstLagrangeVertex);PYLITH_CHECK_ERROR(err);
+  PetscViewerPushFormat(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_ASCII_INFO_DETAIL);
+  DMView(mesh.dmMesh(), PETSC_VIEWER_STDOUT_WORLD);
+  PetscViewerPopFormat(PETSC_VIEWER_STDOUT_WORLD);
+  isInterpolated = (mesh.dimension() > 1) && (mesh.dimension() == depth) ? PETSC_TRUE : PETSC_FALSE;
   firstFaultCell = firstLagrangeVertex;
   if (dynamic_cast<FaultCohesive*>(fault)->useLagrangeConstraints()) {
     firstFaultCell += firstLagrangeVertex;
   } // if
   fault->id(1);
   fault->label("fault");
-  fault->adjustTopology(&mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell, flipFault);
+  fault->adjustTopology(&mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell, isInterpolated ? flipFaultInt : flipFault);
   //mesh->view(data.filename);
+  PetscViewerPushFormat(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_ASCII_INFO_DETAIL);
+  DMView(mesh.dmMesh(), PETSC_VIEWER_STDOUT_WORLD);
+  PetscViewerPopFormat(PETSC_VIEWER_STDOUT_WORLD);
 
   CPPUNIT_ASSERT_EQUAL(data.cellDim, mesh.dimension());
   dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
@@ -739,6 +749,7 @@
   const PetscInt cEnd = cellsStratum.end();
   CPPUNIT_ASSERT_EQUAL(data.numCells, cellsStratum.size());
   for (PetscInt c = cStart, cell = 0, i = 0; c < cEnd; ++c, ++cell) {
+    PetscInt  vertices[32];
     PetscInt *closure = PETSC_NULL;
     PetscInt  closureSize, numCorners = 0;
 
@@ -746,15 +757,21 @@
     for(PetscInt p = 0; p < closureSize*2; p += 2) {
       const PetscInt point = closure[p];
       if ((point >= vStart) && (point < vEnd)) {
-        closure[numCorners++] = point;
+        vertices[numCorners++] = point;
       } // if
     } // for
-    err = DMPlexInvertCell(data.cellDim, numCorners, closure);PYLITH_CHECK_ERROR(err);
+    err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+    err = DMPlexInvertCell(data.cellDim, numCorners, vertices);PYLITH_CHECK_ERROR(err);
     CPPUNIT_ASSERT_EQUAL(data.numCorners[cell], numCorners);
-    for (PetscInt p = 0; p < numCorners; ++p, ++i) {
-      CPPUNIT_ASSERT_EQUAL(data.cells[i], closure[p]);
-    } // for
-    err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+    if (isInterpolated && data.cellsInt) {
+      for (PetscInt p = 0; p < numCorners; ++p, ++i) {
+        CPPUNIT_ASSERT_EQUAL(data.cellsInt[i], vertices[p]);
+      } // for
+    } else {
+      for (PetscInt p = 0; p < numCorners; ++p, ++i) {
+        CPPUNIT_ASSERT_EQUAL(data.cells[i], vertices[p]);
+      } // for
+    }
   } // for
 
   // check materials
@@ -782,10 +799,14 @@
     const char *name = NULL;
     std::string skipA = "depth";
     std::string skipB = "material-id";
+    std::string skipC = "vtk";
+    std::string skipD = "ghost";
 
     err = DMPlexGetLabelName(dmMesh, l, &name);PYLITH_CHECK_ERROR(err);
     if (std::string(name) == skipA) continue;
     if (std::string(name) == skipB) continue;
+    if (std::string(name) == skipC) continue;
+    if (std::string(name) == skipD) continue;
     err = DMPlexGetLabel(dmMesh, name, &label);PYLITH_CHECK_ERROR(err);CPPUNIT_ASSERT(label);
     err = DMLabelGetStratumIS(label, 1, &is);PYLITH_CHECK_ERROR(err);
     err = ISGetLocalSize(is, &numPoints);PYLITH_CHECK_ERROR(err);
@@ -916,10 +937,14 @@
     const char *name = NULL;
     std::string skipA = "depth";
     std::string skipB = "material-id";
+    std::string skipC = "vtk";
+    std::string skipD = "ghost";
 
     err = DMPlexGetLabelName(dmMesh, l, &name);PYLITH_CHECK_ERROR(err);
     if (std::string(name) == skipA) continue;
     if (std::string(name) == skipB) continue;
+    if (std::string(name) == skipC) continue;
+    if (std::string(name) == skipD) continue;
     err = DMPlexGetLabel(dmMesh, name, &label);PYLITH_CHECK_ERROR(err);
     CPPUNIT_ASSERT(label);
     err = DMLabelGetStratumIS(label, 1, &is);PYLITH_CHECK_ERROR(err);

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh	2013-08-07 09:32:10 UTC (rev 22707)
@@ -226,7 +226,8 @@
    */
   void _testAdjustTopology(Fault* fault,
 			   const CohesiveData& data,
-			   const bool flipFault);
+               const bool flipFault,
+			   const bool flipFaultInt);
 
   /** Test adjustTopology().
    *

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultMesh.cc	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultMesh.cc	2013-08-07 09:32:10 UTC (rev 22707)
@@ -37,7 +37,7 @@
 
   PetscErrorCode err = 0;
   { // Create mesh
-    PetscInt firstFaultVertex = 0;
+    PetscInt depth = -1, firstFaultVertex = 0;
     PetscInt firstLagrangeVertex = 0, firstFaultCell = 0;
     PetscDMLabel groupField = NULL;
     const bool useLagrangeConstraints = true;
@@ -49,10 +49,15 @@
     if (useLagrangeConstraints) {
       firstFaultCell += firstLagrangeVertex;
     } // if
+    err = DMPlexGetDepth(dmMesh, &depth);PYLITH_CHECK_ERROR(err);
     err = DMPlexGetLabel(dmMesh, faultLabel, &groupField);PYLITH_CHECK_ERROR(err);
     CPPUNIT_ASSERT(groupField);
     CohesiveTopology::createFault(faultMesh, faultBoundary, *mesh, groupField);
-    CohesiveTopology::create(mesh, *faultMesh, faultBoundary, groupField, faultId, firstFaultVertex, firstLagrangeVertex, firstFaultCell, useLagrangeConstraints);
+    if (mesh->dimension() > 1 && mesh->dimension() == depth) {
+      CohesiveTopology::createInterpolated(mesh, *faultMesh, faultBoundary, groupField, faultId, firstFaultVertex, firstLagrangeVertex, firstFaultCell, useLagrangeConstraints);
+    } else {
+      CohesiveTopology::create(mesh, *faultMesh, faultBoundary, groupField, faultId, firstFaultVertex, firstLagrangeVertex, firstFaultCell, useLagrangeConstraints);
+    }
     err = DMDestroy(&faultBoundary);PYLITH_CHECK_ERROR(err);
   } // Create mesh
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData.cc	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData.cc	2013-08-07 09:32:10 UTC (rev 22707)
@@ -28,6 +28,7 @@
   vertices(0),
   numCorners(0),
   cells(0),
+  cellsInt(0),
   materialIds(0),
   groups(0),
   groupSizes(0),

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData.hh	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData.hh	2013-08-07 09:32:10 UTC (rev 22707)
@@ -50,6 +50,7 @@
   PylithScalar* vertices; ///< Pointer to coordinates of vertices
   int* numCorners; ///< Number of vertices in cell
   int* cells; ///< Pointer to indices of vertices in cells
+  int* cellsInt; ///< Pointer to indices of vertices in cells for interpolated meshes
   int* materialIds; ///< Pointer to cell material identifiers
 
   int* groups; ///< Array of pointers to indices of points in groups

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.cc	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.cc	2013-08-07 09:32:10 UTC (rev 22707)
@@ -48,6 +48,17 @@
  *            \ |    | /
  *             \|    |/
  *              5 -- 8
+ *
+ * Interpolated mesh with fault
+ *      7-15--4
+ *     /|     |\
+ *   10 |     | 13
+ *   /  |     |  \
+ *  3 0 14 2  9 1 6
+ *   \  |     |  /
+ *   11 |     | 12
+ *     \|     |/
+ *      8-16--5
  */
 
 #include "CohesiveDataTri3b.hh"
@@ -75,10 +86,16 @@
   4
 };
 
+const int pylith::faults::CohesiveDataTri3b::_cellsInt[] = {
+  8,  7,  3,
+  5,  6,  4,
+  4,  5,  7,  8
+};
+
 const int pylith::faults::CohesiveDataTri3b::_cells[] = {
   5,  4,  3,
   8,  6,  7,
-  5,  4,  8, 7
+  5,  4,  8,  7
 };
 
 const int pylith::faults::CohesiveDataTri3b::_materialIds[] = {
@@ -115,6 +132,7 @@
   vertices = const_cast<PylithScalar*>(_vertices);
   numCorners = const_cast<int*>(_numCorners);
   cells = const_cast<int*>(_cells);
+  cellsInt = const_cast<int*>(_cellsInt);
   materialIds = const_cast<int*>(_materialIds);
   groups = const_cast<int*>(_groups);
   groupSizes = const_cast<int*>(_groupSizes);

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.hh	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.hh	2013-08-07 09:32:10 UTC (rev 22707)
@@ -50,6 +50,7 @@
   static const PylithScalar _vertices[]; ///< Pointer to coordinates of vertices
   static const int _numCorners[]; ///< Number of vertices in cell
   static const int _cells[]; ///< Pointer to indices of vertices in cells
+  static const int _cellsInt[]; ///< Pointer to indices of vertices in cells for interpolated meshes
   static const int _materialIds[]; ///< Pointer to cell material identifiers
 
   static const int _groups[]; ///< Groups of points

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.cc	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.cc	2013-08-07 09:32:10 UTC (rev 22707)
@@ -75,6 +75,12 @@
   4
 };
 
+const int pylith::faults::CohesiveDataTri3c::_cellsInt[] = {
+  7,  3,  8,
+  6,  4,  5,
+  4,  5,  7,  8
+};
+
 const int pylith::faults::CohesiveDataTri3c::_cells[] = {
   4,  3,  5,
   6,  7,  8,
@@ -115,6 +121,7 @@
   vertices = const_cast<PylithScalar*>(_vertices);
   numCorners = const_cast<int*>(_numCorners);
   cells = const_cast<int*>(_cells);
+  cellsInt = const_cast<int*>(_cellsInt);
   materialIds = const_cast<int*>(_materialIds);
   groups = const_cast<int*>(_groups);
   groupSizes = const_cast<int*>(_groupSizes);

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.hh	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.hh	2013-08-07 09:32:10 UTC (rev 22707)
@@ -50,6 +50,7 @@
   static const PylithScalar _vertices[]; ///< Pointer to coordinates of vertices
   static const int _numCorners[]; ///< Number of vertices in cell
   static const int _cells[]; ///< Pointer to indices of vertices in cells
+  static const int _cellsInt[]; ///< Pointer to indices of vertices in cells from an interpolated mesh
   static const int _materialIds[]; ///< Pointer to cell material identifiers
 
   static const int _groups[]; ///< Groups of points

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3e.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3e.cc	2013-08-07 09:28:59 UTC (rev 22706)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3e.cc	2013-08-07 09:32:10 UTC (rev 22707)
@@ -24,16 +24,16 @@
  *         9
  *        / \
  *       /   \
- *      /  2  \
+ *     17  2  16
  *     /       \
- *    8---------5
+ *    8---15----5
  *     \       /|\
- *      \  3  / | \
- *       \   /  |  \
+ *     18  3  / | \
+ *       \   12 |  14
  *        \ /   |   \
- *         4  0 | 1  7
+ *         4 0 11 1  7
  *          \   |   /
- *           \  |  /
+ *          10  |  13
  *            \ | /
  *             \|/
  *              6
@@ -61,6 +61,27 @@
  *            \ | | /
  *             \| |/
  *             13-8
+ *
+ * Interpolated Cells are 0-3, 4-5, vertices are 6-14.
+ *
+ *         11
+ *        /  \
+ *      22    21
+ *      /  2   \
+ *     /        \
+ *   10-----20----7
+ *    |    5     /|
+ *   14---25---12 |\
+ *     \       /| |  19
+ *     23  3  / |4|   \
+ *       \   17 | |    \
+ *        \ /   | 16 1  9
+ *         6 0 24 |    /
+ *          \   | |   /
+ *          15  | |  18
+ *            \ | | /
+ *             \| |/
+ *             13-8
  */
 
 #include "CohesiveDataTri3e.hh"



More information about the CIG-COMMITS mailing list