[cig-commits] [commit] knepley/fix-faults-parallel: Update 2-D adjust topology tests for embedded faults to use fault edge. (4005988)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue May 6 12:16:34 PDT 2014


Repository : ssh://geoshell/pylith

On branch  : knepley/fix-faults-parallel
Link       : https://github.com/geodynamics/pylith/compare/8db09a41c2c343e14056a2efdabe319d8fa7fe5b...8f8fd96b68466722a83a80eebfcba574c803d3fb

>---------------------------------------------------------------

commit 40059889df9fda0a8085d2fe6fe8a0339a348102
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Tue May 6 11:15:25 2014 -0700

    Update 2-D adjust topology tests for embedded faults to use fault edge.


>---------------------------------------------------------------

40059889df9fda0a8085d2fe6fe8a0339a348102
 unittests/libtests/faults/TestFaultCohesive.cc     | 10 +++---
 unittests/libtests/faults/data/CohesiveData.cc     |  4 ++-
 unittests/libtests/faults/data/CohesiveData.hh     |  2 ++
 .../libtests/faults/data/CohesiveDataQuad4i.cc     | 39 ++++++++++++----------
 .../libtests/faults/data/CohesiveDataQuad4i.hh     |  2 ++
 .../libtests/faults/data/CohesiveDataTri3g.cc      | 30 +++++++++--------
 .../libtests/faults/data/CohesiveDataTri3g.hh      |  2 ++
 .../libtests/faults/data/CohesiveDataTri3h.cc      | 30 +++++++++--------
 .../libtests/faults/data/CohesiveDataTri3h.hh      |  2 ++
 unittests/libtests/faults/data/quad4i.mesh         |  8 +++++
 unittests/libtests/faults/data/tri3g.mesh          |  8 +++++
 unittests/libtests/faults/data/tri3h.mesh          |  9 +++++
 12 files changed, 97 insertions(+), 49 deletions(-)

diff --git a/unittests/libtests/faults/TestFaultCohesive.cc b/unittests/libtests/faults/TestFaultCohesive.cc
index 13583d5..e4a0837 100644
--- a/unittests/libtests/faults/TestFaultCohesive.cc
+++ b/unittests/libtests/faults/TestFaultCohesive.cc
@@ -690,12 +690,12 @@ pylith::faults::TestFaultCohesive::_testAdjustTopology(Fault* fault,
   PYLITH_METHOD_BEGIN;
 
   CPPUNIT_ASSERT(fault);
+  CPPUNIT_ASSERT(data.fault);
 
   topology::Mesh mesh;
   meshio::MeshIOAscii iohandler;
   iohandler.filename(data.filename);
   iohandler.debug(false);
-  iohandler.interpolate(false);
   iohandler.read(&mesh);
 
   spatialdata::geocoords::CSCart cs;
@@ -712,13 +712,16 @@ pylith::faults::TestFaultCohesive::_testAdjustTopology(Fault* fault,
   PetscErrorCode err;
 
   err = DMPlexGetDepth(dmMesh, &depth);PYLITH_CHECK_ERROR(err);
-  err = DMPlexGetStratumSize(dmMesh, "fault", 1, &firstLagrangeVertex);PYLITH_CHECK_ERROR(err);
+  err = DMPlexGetStratumSize(dmMesh, data.fault, 1, &firstLagrangeVertex);PYLITH_CHECK_ERROR(err);
   firstFaultCell = firstLagrangeVertex;
   if (dynamic_cast<FaultCohesive*>(fault)->useLagrangeConstraints()) {
     firstFaultCell += firstLagrangeVertex;
   } // if
   fault->id(1);
-  fault->label("fault");
+  fault->label(data.fault);
+  if (data.edge) {
+    fault->edge(data.edge);
+  } // if
   fault->adjustTopology(&mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell);
 #if 0 // DEBUGGING
   PetscViewerPushFormat(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_ASCII_INFO_DETAIL);
@@ -838,7 +841,6 @@ pylith::faults::TestFaultCohesive::_testAdjustTopology(Fault* faultA,
   meshio::MeshIOAscii iohandler;
   iohandler.filename(data.filename);
   iohandler.debug(false);
-  iohandler.interpolate(false);
   iohandler.read(&mesh);
 
   PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
diff --git a/unittests/libtests/faults/data/CohesiveData.cc b/unittests/libtests/faults/data/CohesiveData.cc
index 17473a6..fc0ab46 100644
--- a/unittests/libtests/faults/data/CohesiveData.cc
+++ b/unittests/libtests/faults/data/CohesiveData.cc
@@ -31,7 +31,9 @@ pylith::faults::CohesiveData::CohesiveData(void) :
   groupNames(0),
   groupTypes(0),
   numGroups(0),
-  filename(0)
+  filename(0),
+  fault("fault"),
+  edge(0)
 { // constructor
 } // constructor
 
diff --git a/unittests/libtests/faults/data/CohesiveData.hh b/unittests/libtests/faults/data/CohesiveData.hh
index 00c4281..c405045 100644
--- a/unittests/libtests/faults/data/CohesiveData.hh
+++ b/unittests/libtests/faults/data/CohesiveData.hh
@@ -56,6 +56,8 @@ public:
   int numGroups; ///< Number of groups
 
   char* filename; ///< Filename for input mesh
+  char* fault; ///< Label for fault.
+  char* edge; ///< Label for fault edge.
 };
 
 #endif // pylith_faults_cohesivedata_hh
diff --git a/unittests/libtests/faults/data/CohesiveDataQuad4i.cc b/unittests/libtests/faults/data/CohesiveDataQuad4i.cc
index 8de1688..cf22f35 100644
--- a/unittests/libtests/faults/data/CohesiveDataQuad4i.cc
+++ b/unittests/libtests/faults/data/CohesiveDataQuad4i.cc
@@ -47,56 +47,57 @@
  * |  0   |   1   |
  * |      |       |
  * |      |  6    |
- *12 ----13-21-----14
+ *12 ----13------14
  * |      |  |      |
  * |      |7 |      |
  * |  2   |  |  3   |
  * |      |  |      |
- *15 ----16-22-----17
+ *15 ----16-21-----17
  * |      |  |      |
  * |  4   |  |  5   |
  * |      |8 |      |
  * |      |  |      |
- *18 ----19-23 ----20
+ *18 ----19-22 ----20
  *
  */
 
 #include "CohesiveDataQuad4i.hh"
 
-const int pylith::faults::CohesiveDataQuad4i::_numVertices = 15;
+const int pylith::faults::CohesiveDataQuad4i::_numVertices = 14;
 
 const int pylith::faults::CohesiveDataQuad4i::_spaceDim = 2;
 
-const int pylith::faults::CohesiveDataQuad4i::_numCells = 9;
+const int pylith::faults::CohesiveDataQuad4i::_numCells = 8;
 
 const int pylith::faults::CohesiveDataQuad4i::_cellDim = 2;
 
-const int pylith::faults::CohesiveDataQuad4i::_numCorners[9] = {
+const int pylith::faults::CohesiveDataQuad4i::_numCorners[8] = {
   4, 4, 4, 4, 4, 4,
-  3, 4, 4,
+  3, 4,
 };
 
-const int pylith::faults::CohesiveDataQuad4i::_materialIds[9] = {
+const int pylith::faults::CohesiveDataQuad4i::_materialIds[8] = {
   10, 10, 10, 11, 10, 11,
-  1, 1, 1,
+  1, 1,
 };
 
-const int pylith::faults::CohesiveDataQuad4i::_numGroups = 3;
+const int pylith::faults::CohesiveDataQuad4i::_numGroups = 4;
 
-const int pylith::faults::CohesiveDataQuad4i::_groupSizes[3] = {
-  3+2, 4+2, 6+4, // vertices+edges
+const int pylith::faults::CohesiveDataQuad4i::_groupSizes[4] = {
+  3+2, 4+2, 1, 5+4, // vertices+edges
 };
 
-const char* pylith::faults::CohesiveDataQuad4i::_groupNames[3] = {
-  "output2", "output1", "fault",
+const char* pylith::faults::CohesiveDataQuad4i::_groupNames[4] = {
+  "output2", "output1", "edge", "fault",
 };
 
-const char* pylith::faults::CohesiveDataQuad4i::_groupTypes[3] = {
-  "vertex", "vertex", "vertex",
+const char* pylith::faults::CohesiveDataQuad4i::_groupTypes[4] = {
+  "vertex", "vertex", "vertex", "vertex",
 };
 
-const char* pylith::faults::CohesiveDataQuad4i::_filename = 
-  "data/quad4i.mesh";
+const char* pylith::faults::CohesiveDataQuad4i::_filename = "data/quad4i.mesh";
+const char* pylith::faults::CohesiveDataQuad4i::_fault = "fault";
+const char* pylith::faults::CohesiveDataQuad4i::_edge = "edge";
 
 pylith::faults::CohesiveDataQuad4i::CohesiveDataQuad4i(void)
 { // constructor
@@ -111,6 +112,8 @@ pylith::faults::CohesiveDataQuad4i::CohesiveDataQuad4i(void)
   groupTypes = const_cast<char**>(_groupTypes);
   numGroups = _numGroups;
   filename = const_cast<char*>(_filename);
+  fault = const_cast<char*>(_fault);
+  edge = const_cast<char*>(_edge);
 } // constructor
 
 pylith::faults::CohesiveDataQuad4i::~CohesiveDataQuad4i(void)
diff --git a/unittests/libtests/faults/data/CohesiveDataQuad4i.hh b/unittests/libtests/faults/data/CohesiveDataQuad4i.hh
index 9a773ac..75317a8 100644
--- a/unittests/libtests/faults/data/CohesiveDataQuad4i.hh
+++ b/unittests/libtests/faults/data/CohesiveDataQuad4i.hh
@@ -56,6 +56,8 @@ private:
   static const int _numGroups; ///< Number of groups
 
   static const char* _filename; ///< Filename of input mesh
+  static const char* _fault; ///< Label for fault.
+  static const char* _edge; ///< Label for fault edge.
 };
 
 #endif // pylith_faults_cohesivedataquad4i_hh
diff --git a/unittests/libtests/faults/data/CohesiveDataTri3g.cc b/unittests/libtests/faults/data/CohesiveDataTri3g.cc
index 4877cf4..5e4258c 100644
--- a/unittests/libtests/faults/data/CohesiveDataTri3g.cc
+++ b/unittests/libtests/faults/data/CohesiveDataTri3g.cc
@@ -22,38 +22,40 @@
 
 #include "CohesiveDataTri3g.hh"
 
-const int pylith::faults::CohesiveDataTri3g::_numVertices = 9;
+const int pylith::faults::CohesiveDataTri3g::_numVertices = 8;
 
 const int pylith::faults::CohesiveDataTri3g::_spaceDim = 2;
 
-const int pylith::faults::CohesiveDataTri3g::_numCells = 8;
+const int pylith::faults::CohesiveDataTri3g::_numCells = 7;
 
 const int pylith::faults::CohesiveDataTri3g::_cellDim = 2;
 
-const int pylith::faults::CohesiveDataTri3g::_numCorners[8] = {
+const int pylith::faults::CohesiveDataTri3g::_numCorners[7] = {
   3, 3, 3, 3, 3, 3,
-  3, 4,
+  3,
 };
 
-const int pylith::faults::CohesiveDataTri3g::_materialIds[8] = {
+const int pylith::faults::CohesiveDataTri3g::_materialIds[7] = {
   0,  2,  0,  2,  0,  2,
-  1, 1,
+  1,
 };
 
-const int pylith::faults::CohesiveDataTri3g::_numGroups = 2;
+const int pylith::faults::CohesiveDataTri3g::_numGroups = 3;
 
-const int pylith::faults::CohesiveDataTri3g::_groupSizes[2] = 
-  { 5+3, 4+2 }; // vertices+edges
+const int pylith::faults::CohesiveDataTri3g::_groupSizes[3] = 
+  { 5+3, 1, 3+2 }; // vertices+edges
 
-const char* pylith::faults::CohesiveDataTri3g::_groupNames[2] = {
-  "output", "fault"
+const char* pylith::faults::CohesiveDataTri3g::_groupNames[3] = {
+  "output", "edge", "fault"
 };
 
-const char* pylith::faults::CohesiveDataTri3g::_groupTypes[2] = {
-  "vertex", "vertex"
+const char* pylith::faults::CohesiveDataTri3g::_groupTypes[3] = {
+  "vertex", "vertex", "vertex"
 };
 
 const char* pylith::faults::CohesiveDataTri3g::_filename = "data/tri3g.mesh";
+const char* pylith::faults::CohesiveDataTri3g::_fault = "fault";
+const char* pylith::faults::CohesiveDataTri3g::_edge = "edge";
 
 pylith::faults::CohesiveDataTri3g::CohesiveDataTri3g(void)
 { // constructor
@@ -68,6 +70,8 @@ pylith::faults::CohesiveDataTri3g::CohesiveDataTri3g(void)
   groupTypes = const_cast<char**>(_groupTypes);
   numGroups = _numGroups;
   filename = const_cast<char*>(_filename);
+  fault = const_cast<char*>(_fault);
+  edge = const_cast<char*>(_edge);
 } // constructor
 
 pylith::faults::CohesiveDataTri3g::~CohesiveDataTri3g(void)
diff --git a/unittests/libtests/faults/data/CohesiveDataTri3g.hh b/unittests/libtests/faults/data/CohesiveDataTri3g.hh
index 18d36f8..cdefbe4 100644
--- a/unittests/libtests/faults/data/CohesiveDataTri3g.hh
+++ b/unittests/libtests/faults/data/CohesiveDataTri3g.hh
@@ -56,6 +56,8 @@ private:
   static const int _numGroups; ///< Number of groups
 
   static const char* _filename; ///< Filename of input mesh
+  static const char* _fault; ///< Label for fault.
+  static const char* _edge; ///< Label for fault edge.
 };
 
 #endif // pylith_faults_cohesivedatatri3g_hh
diff --git a/unittests/libtests/faults/data/CohesiveDataTri3h.cc b/unittests/libtests/faults/data/CohesiveDataTri3h.cc
index 0cfe476..cfa0e8d 100644
--- a/unittests/libtests/faults/data/CohesiveDataTri3h.cc
+++ b/unittests/libtests/faults/data/CohesiveDataTri3h.cc
@@ -22,39 +22,41 @@
 
 #include "CohesiveDataTri3h.hh"
 
-const int pylith::faults::CohesiveDataTri3h::_numVertices = 13;
+const int pylith::faults::CohesiveDataTri3h::_numVertices = 11;
 
 const int pylith::faults::CohesiveDataTri3h::_spaceDim = 2;
 
-const int pylith::faults::CohesiveDataTri3h::_numCells = 15;
+const int pylith::faults::CohesiveDataTri3h::_numCells = 13;
 
 const int pylith::faults::CohesiveDataTri3h::_cellDim = 2;
 
-const int pylith::faults::CohesiveDataTri3h::_numCorners[15] = {
+const int pylith::faults::CohesiveDataTri3h::_numCorners[13] = {
   3, 3, 3, 3, 3, 3, 3, 3, 3, 3,  3,
-  4, 3, 4, 3,
+  3, 3,
 };
 
-const int pylith::faults::CohesiveDataTri3h::_materialIds[15] = {
+const int pylith::faults::CohesiveDataTri3h::_materialIds[13] = {
   0, 0, 0, 0, 
   2, 2, 3, 3, 3, 2, 3,
-  1, 1, 1, 1,
+  1, 1, 
 };
 
-const int pylith::faults::CohesiveDataTri3h::_numGroups = 2;
+const int pylith::faults::CohesiveDataTri3h::_numGroups = 3;
 
-const int pylith::faults::CohesiveDataTri3h::_groupSizes[2] = 
-  { 3+2, 6+4 }; // vertices+edges
+const int pylith::faults::CohesiveDataTri3h::_groupSizes[3] = 
+  { 3+2, 2, 4+4 }; // vertices+edges
 
-const char* pylith::faults::CohesiveDataTri3h::_groupNames[2] = {
-  "output", "fault"
+const char* pylith::faults::CohesiveDataTri3h::_groupNames[3] = {
+  "output", "edge", "fault"
 };
 
-const char* pylith::faults::CohesiveDataTri3h::_groupTypes[2] = {
-  "vertex", "vertex"
+const char* pylith::faults::CohesiveDataTri3h::_groupTypes[3] = {
+  "vertex", "vertex", "vertex"
 };
 
 const char* pylith::faults::CohesiveDataTri3h::_filename = "data/tri3h.mesh";
+const char* pylith::faults::CohesiveDataTri3h::_fault = "fault";
+const char* pylith::faults::CohesiveDataTri3h::_edge = "edge";
 
 pylith::faults::CohesiveDataTri3h::CohesiveDataTri3h(void)
 { // constructor
@@ -69,6 +71,8 @@ pylith::faults::CohesiveDataTri3h::CohesiveDataTri3h(void)
   groupTypes = const_cast<char**>(_groupTypes);
   numGroups = _numGroups;
   filename = const_cast<char*>(_filename);
+  fault = const_cast<char*>(_fault);
+  edge = const_cast<char*>(_edge);
 } // constructor
 
 pylith::faults::CohesiveDataTri3h::~CohesiveDataTri3h(void)
diff --git a/unittests/libtests/faults/data/CohesiveDataTri3h.hh b/unittests/libtests/faults/data/CohesiveDataTri3h.hh
index 9b08327..53b0a94 100644
--- a/unittests/libtests/faults/data/CohesiveDataTri3h.hh
+++ b/unittests/libtests/faults/data/CohesiveDataTri3h.hh
@@ -56,6 +56,8 @@ private:
   static const int _numGroups; ///< Number of groups
 
   static const char* _filename; ///< Filename of input mesh
+  static const char* _fault; ///< Label for fault.
+  static const char* _edge; ///< Label for fault edge.
 };
 
 #endif // pylith_faults_cohesivedatatri3h_hh
diff --git a/unittests/libtests/faults/data/quad4i.mesh b/unittests/libtests/faults/data/quad4i.mesh
index a38bd83..60a8714 100644
--- a/unittests/libtests/faults/data/quad4i.mesh
+++ b/unittests/libtests/faults/data/quad4i.mesh
@@ -50,6 +50,14 @@ mesh = {
     }
   }
   group = {
+    name = edge
+    type = vertices
+    count = 1
+    indices = {
+      4
+    }
+  }
+  group = {
     name = output1
     type = vertices
     count = 3
diff --git a/unittests/libtests/faults/data/tri3g.mesh b/unittests/libtests/faults/data/tri3g.mesh
index 5d803f3..5eb54ec 100644
--- a/unittests/libtests/faults/data/tri3g.mesh
+++ b/unittests/libtests/faults/data/tri3g.mesh
@@ -60,6 +60,14 @@ mesh = {
     }
   }
   group = {
+    name = edge
+    type = vertices
+    count = 1
+    indices = {
+      2
+    }
+  }
+  group = {
     name = output
     type = vertices
     count = 4
diff --git a/unittests/libtests/faults/data/tri3h.mesh b/unittests/libtests/faults/data/tri3h.mesh
index 60df063..67c3350 100644
--- a/unittests/libtests/faults/data/tri3h.mesh
+++ b/unittests/libtests/faults/data/tri3h.mesh
@@ -58,6 +58,15 @@ mesh = {
     }
   }
   group = {
+    name = edge
+    type = vertices
+    count = 2
+    indices = {
+      4
+      7
+    }
+  }
+  group = {
     name = output
     type = vertices
     count = 3



More information about the CIG-COMMITS mailing list