[cig-commits] [commit] knepley/fix-faults-parallel: Created unit test for adjusting topology for hex8 cells w/embedded fault. (df86522)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed May 7 10:12:10 PDT 2014


Repository : ssh://geoshell/pylith

On branch  : knepley/fix-faults-parallel
Link       : https://github.com/geodynamics/pylith/compare/634647491dc3d033637df22f018722a6e54e9097...df865220b80a43ba208f3cef3f0f16004191dad3

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

commit df865220b80a43ba208f3cef3f0f16004191dad3
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Wed May 7 10:12:01 2014 -0700

    Created unit test for adjusting topology for hex8 cells w/embedded fault.


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

df865220b80a43ba208f3cef3f0f16004191dad3
 unittests/libtests/faults/Makefile.am              |   2 +
 unittests/libtests/faults/TestFaultCohesive.cc     |  16 ++
 unittests/libtests/faults/TestFaultCohesive.hh     |   4 +
 .../libtests/faults/data/CohesiveDataHex8j.cc      | 101 ++++++++++++
 .../{CohesiveDataTri3g.hh => CohesiveDataHex8j.hh} |  14 +-
 unittests/libtests/faults/data/Makefile.am         |   1 +
 unittests/libtests/faults/data/hex8j.mesh          | 170 +++++++++++++++++++++
 7 files changed, 301 insertions(+), 7 deletions(-)

diff --git a/unittests/libtests/faults/Makefile.am b/unittests/libtests/faults/Makefile.am
index db560d7..71a87d0 100644
--- a/unittests/libtests/faults/Makefile.am
+++ b/unittests/libtests/faults/Makefile.am
@@ -111,6 +111,7 @@ testfaults_SOURCES += \
 	data/CohesiveDataHex8g.cc \
 	data/CohesiveDataHex8h.cc \
 	data/CohesiveDataHex8i.cc \
+	data/CohesiveDataHex8j.cc \
 	data/CohesiveDataHex8Lagrange.cc \
 	data/CohesiveKinData.cc \
 	data/CohesiveKinDataTri3.cc \
@@ -179,6 +180,7 @@ noinst_HEADERS += \
 	data/CohesiveDataHex8g.hh \
 	data/CohesiveDataHex8h.hh \
 	data/CohesiveDataHex8i.hh \
+	data/CohesiveDataHex8j.hh \
 	data/CohesiveDataHex8Lagrange.hh \
 	data/CohesiveKinData.hh \
 	data/CohesiveKinDataTri3.hh \
diff --git a/unittests/libtests/faults/TestFaultCohesive.cc b/unittests/libtests/faults/TestFaultCohesive.cc
index e4a0837..cd8e059 100644
--- a/unittests/libtests/faults/TestFaultCohesive.cc
+++ b/unittests/libtests/faults/TestFaultCohesive.cc
@@ -614,6 +614,22 @@ pylith::faults::TestFaultCohesive::testAdjustTopologyHex8i(void)
 } // testAdjustTopologyHex8i
 
 // ----------------------------------------------------------------------
+#include "data/CohesiveDataHex8j.hh" // USES CohesiveDataHex8j
+
+// Test adjustTopology() with 3-D hexahedral element (embedded fault).
+void
+pylith::faults::TestFaultCohesive::testAdjustTopologyHex8j(void)
+{ // testAdjustTopologyHex8j
+  PYLITH_METHOD_BEGIN;
+
+  CohesiveDataHex8j data;
+  FaultCohesiveTract fault;
+  _testAdjustTopology(&fault, data);
+
+  PYLITH_METHOD_END;
+} // testAdjustTopologyHex8j
+
+// ----------------------------------------------------------------------
 #include "data/CohesiveDataTri3Lagrange.hh" // USES CohesiveDataTri3Lagrange
 
 // Test adjustTopology() with 2-D triangular element for Lagrange
diff --git a/unittests/libtests/faults/TestFaultCohesive.hh b/unittests/libtests/faults/TestFaultCohesive.hh
index c24ee31..0b0db6c 100644
--- a/unittests/libtests/faults/TestFaultCohesive.hh
+++ b/unittests/libtests/faults/TestFaultCohesive.hh
@@ -83,6 +83,7 @@ class pylith::faults::TestFaultCohesive : public CppUnit::TestFixture
   CPPUNIT_TEST( testAdjustTopologyHex8g );
   CPPUNIT_TEST( testAdjustTopologyHex8h );
   CPPUNIT_TEST( testAdjustTopologyHex8i );
+  CPPUNIT_TEST( testAdjustTopologyHex8j );
 
   CPPUNIT_TEST( testAdjustTopologyTri3Lagrange );
   CPPUNIT_TEST( testAdjustTopologyQuad4Lagrange );
@@ -202,6 +203,9 @@ public :
   /// Test adjustTopology() with 3-D hexahedral element (edge/vertex on fault).
   void testAdjustTopologyHex8i(void);
 
+  /// Test adjustTopology() with 3-D hexahedral element (embedded fault).
+  void testAdjustTopologyHex8j(void);
+
   /// Test adjustTopology() with 2-D triangular element for Lagrange
   /// multipliers.
   void testAdjustTopologyTri3Lagrange(void);
diff --git a/unittests/libtests/faults/data/CohesiveDataHex8j.cc b/unittests/libtests/faults/data/CohesiveDataHex8j.cc
new file mode 100644
index 0000000..d3bc533
--- /dev/null
+++ b/unittests/libtests/faults/data/CohesiveDataHex8j.cc
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2014 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-6 and vertices are 8-43
+ */
+
+#include "CohesiveDataHex8j.hh"
+
+const int pylith::faults::CohesiveDataHex8j::_numVertices = 61;
+
+const int pylith::faults::CohesiveDataHex8j::_spaceDim = 3;
+
+const int pylith::faults::CohesiveDataHex8j::_numCells = 22;
+
+const int pylith::faults::CohesiveDataHex8j::_cellDim = 3;
+
+const int pylith::faults::CohesiveDataHex8j::_numCorners[22] = {
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+  8,
+};
+
+const int pylith::faults::CohesiveDataHex8j::_materialIds[22] = {
+  10, 10, 11, 11, 10, 10, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11, 11, 11, 10, 10,
+  1,  1,
+};
+
+const int pylith::faults::CohesiveDataHex8j::_numGroups = 3;
+
+const int pylith::faults::CohesiveDataHex8j::_groupSizes[3] = {
+  21+31+10, 5+4, 6+7+2 // vertices+edges+faces 
+};
+
+const char* pylith::faults::CohesiveDataHex8j::_groupNames[3] = {
+  "output", "fault_edge", "fault"
+};
+
+const char* pylith::faults::CohesiveDataHex8j::_groupTypes[3] = {
+  "vertex", "vertex", "vertex"
+};
+
+const char* pylith::faults::CohesiveDataHex8j::_filename = "data/hex8j.mesh";
+const char* pylith::faults::CohesiveDataHex8j::_fault = "fault";
+const char* pylith::faults::CohesiveDataHex8j::_edge = "fault_edge";
+
+pylith::faults::CohesiveDataHex8j::CohesiveDataHex8j(void)
+{ // constructor
+  numVertices = _numVertices;
+  spaceDim = _spaceDim;
+  numCells = _numCells;
+  cellDim = _cellDim;
+  numCorners = const_cast<int*>(_numCorners);
+  materialIds = const_cast<int*>(_materialIds);
+  groupSizes = const_cast<int*>(_groupSizes);
+  groupNames = const_cast<char**>(_groupNames);
+  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::CohesiveDataHex8j::~CohesiveDataHex8j(void)
+{}
+
+
+// End of file
diff --git a/unittests/libtests/faults/data/CohesiveDataTri3g.hh b/unittests/libtests/faults/data/CohesiveDataHex8j.hh
similarity index 85%
copy from unittests/libtests/faults/data/CohesiveDataTri3g.hh
copy to unittests/libtests/faults/data/CohesiveDataHex8j.hh
index cdefbe4..83d6341 100644
--- a/unittests/libtests/faults/data/CohesiveDataTri3g.hh
+++ b/unittests/libtests/faults/data/CohesiveDataHex8j.hh
@@ -16,28 +16,28 @@
 // ======================================================================
 //
 
-#if !defined(pylith_faults_cohesivedatatri3g_hh)
-#define pylith_faults_cohesivedatatri3g_hh
+#if !defined(pylith_faults_cohesivedatahex8j_hh)
+#define pylith_faults_cohesivedatahex8j_hh
 
 #include "CohesiveData.hh"
 
 namespace pylith {
   namespace faults {
-     class CohesiveDataTri3g;
+     class CohesiveDataHex8j;
   } // pylith
 } // faults
 
-class pylith::faults::CohesiveDataTri3g : public CohesiveData
+class pylith::faults::CohesiveDataHex8j : public CohesiveData
 {
 
 // PUBLIC METHODS ///////////////////////////////////////////////////////
 public: 
 
   /// Constructor
-  CohesiveDataTri3g(void);
+  CohesiveDataHex8j(void);
 
   /// Destructor
-  ~CohesiveDataTri3g(void);
+  ~CohesiveDataHex8j(void);
 
 // PRIVATE MEMBERS //////////////////////////////////////////////////////
 private:
@@ -60,6 +60,6 @@ private:
   static const char* _edge; ///< Label for fault edge.
 };
 
-#endif // pylith_faults_cohesivedatatri3g_hh
+#endif // pylith_faults_cohesivedatahex8j_hh
 
 // End of file
diff --git a/unittests/libtests/faults/data/Makefile.am b/unittests/libtests/faults/data/Makefile.am
index a1edf9a..3449d9d 100644
--- a/unittests/libtests/faults/data/Makefile.am
+++ b/unittests/libtests/faults/data/Makefile.am
@@ -91,6 +91,7 @@ dist_noinst_DATA = \
 	hex8g.mesh \
 	hex8h.mesh \
 	hex8i.mesh \
+	hex8j.mesh \
 	hex8_finalslip.spatialdb \
 	hex8_sliptime.spatialdb \
 	hex8_risetime.spatialdb \
diff --git a/unittests/libtests/faults/data/hex8j.mesh b/unittests/libtests/faults/data/hex8j.mesh
new file mode 100644
index 0000000..def732f
--- /dev/null
+++ b/unittests/libtests/faults/data/hex8j.mesh
@@ -0,0 +1,170 @@
+mesh = {
+  dimension = 3
+  use-index-zero = false
+  vertices = {
+    dimension = 3
+    count = 60
+    coordinates = {
+       1  10.0 70.0   0.0
+       2  20.0 70.0   0.0
+       3  30.0 70.0   0.0
+       4  10.0 60.0   0.0
+       5  30.0 60.0   0.0
+       6  20.0 50.0   0.0
+       7  40.0 50.0   0.0
+       8  10.0 40.0   0.0
+       9  30.0 40.0   0.0
+      10   0.0 30.0   0.0
+      11  20.0 30.0   0.0
+      12  30.0 30.0   0.0
+      13  10.0 20.0   0.0
+      14  30.0 20.0   0.0
+      15  10.0 10.0   0.0
+      16  20.0 10.0   0.0
+      17  40.0 10.0   0.0
+      18  10.0  0.0   0.0
+      19  20.0  0.0   0.0
+      20  30.0  0.0   0.0
+      21  10.0 70.0 -10.0
+      22  20.0 70.0 -10.0
+      23  30.0 70.0 -10.0
+      24  10.0 60.0 -10.0
+      25  30.0 60.0 -10.0
+      26  20.0 50.0 -10.0
+      27  40.0 50.0 -10.0
+      28  10.0 40.0 -10.0
+      29  30.0 40.0 -10.0
+      30   0.0 30.0 -10.0
+      31  20.0 30.0 -10.0
+      32  30.0 30.0 -10.0
+      33  10.0 20.0 -10.0
+      34  30.0 20.0 -10.0
+      35  10.0 10.0 -10.0
+      36  20.0 10.0 -10.0
+      37  40.0 10.0 -10.0
+      38  10.0  0.0 -10.0
+      39  20.0  0.0 -10.0
+      40  30.0  0.0 -10.0
+      41  10.0 70.0 -20.0
+      42  20.0 70.0 -20.0
+      43  30.0 70.0 -20.0
+      44  10.0 60.0 -20.0
+      45  30.0 60.0 -20.0
+      46  20.0 50.0 -20.0
+      47  40.0 50.0 -20.0
+      48  10.0 40.0 -20.0
+      49  30.0 40.0 -20.0
+      50   0.0 30.0 -20.0
+      51  20.0 30.0 -20.0
+      52  30.0 30.0 -20.0
+      53  10.0 20.0 -20.0
+      54  30.0 20.0 -20.0
+      55  10.0 10.0 -20.0
+      56  20.0 10.0 -20.0
+      57  40.0 10.0 -20.0
+      58  10.0  0.0 -20.0
+      59  20.0  0.0 -20.0
+      60  30.0  0.0 -20.0
+    }
+  }
+  cells = {
+    count = 20
+    num-corners = 8
+    simplices = {
+             1    21 24 26 22  1  4  6  2
+             2    41 44 46 42 21 24 26 22
+             3    22 26 25 23  2  6  5  3
+             4    42 46 45 43 22 26 25 23
+             5    24 28 31 26  4  8 11  6
+             6    44 48 51 46 24 28 31 26
+             7    26 29 27 25  6  9  7  5
+             8    46 49 47 45 26 29 27 25
+             9    26 31 32 29  6 11 12  9
+            10    46 51 52 49 26 31 32 29
+            11    28 30 33 31  8 10 13 11
+            12    48 50 53 51 28 30 33 31
+            13    33 35 36 31 13 15 16 11
+            14    53 55 56 51 33 35 36 31
+            15    31 36 34 32 11 16 14 12
+            16    51 56 54 52 31 36 34 32
+            17    34 36 40 37 14 16 20 17
+            18    54 56 60 57 34 36 40 37
+            19    35 38 39 36 15 18 19 16
+            20    55 58 59 56 35 38 39 36
+    }
+    material-ids = {
+             1   10
+             2   10
+             3   11
+             4   11
+             5   10
+             6   10
+             7   11
+             8   11
+             9   11
+            10   11
+            11   10
+            12   10
+            13   10
+            14   10
+            15   11
+            16   11
+            17   11
+            18   11
+            19   10
+            20   10
+    }
+  }
+  group = {
+    name = fault
+    type = vertices
+    count = 6
+    indices = {
+      6
+     11
+     16
+     26
+     31
+     36
+    }
+  }
+  group = {
+    name = fault_edge
+    type = vertices
+    count = 5
+    indices = {
+      6
+     26
+     31
+     26
+     16
+    }
+  }
+  group = {
+    name = output
+    type = vertices
+    count = 20
+    indices = {
+      1
+      2
+      3
+      4
+      5
+      6
+      7
+      8
+      9
+     10
+     11
+     12
+     13
+     14
+     15
+     16
+     17
+     18
+     19
+     20
+    }
+  }
+}



More information about the CIG-COMMITS mailing list