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

knepley at geodynamics.org knepley at geodynamics.org
Thu Jul 5 19:13:18 PDT 2007


Author: knepley
Date: 2007-07-05 19:13:17 -0700 (Thu, 05 Jul 2007)
New Revision: 7605

Added:
   short/3D/PyLith/trunk/unittests/libtests/faults/data/BoundaryDataTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/BoundaryDataTet4.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/tet4traction.mesh
Modified:
   short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
   short/3D/PyLith/trunk/unittests/libtests/faults/TestBoundary.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestBoundary.hh
Log:
Added a tet4 test for the boundary stuff


Modified: short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am	2007-07-05 23:45:19 UTC (rev 7604)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am	2007-07-06 02:13:17 UTC (rev 7605)
@@ -102,7 +102,8 @@
 	data/CohesiveKinDataTet4f.cc \
 	data/CohesiveKinDataHex8.cc \
 	data/BoundaryData.cc \
-	data/BoundaryDataTri3.cc
+	data/BoundaryDataTri3.cc \
+	data/BoundaryDataTet4.cc
 
 noinst_HEADERS += \
 	data/CohesiveData.hh \
@@ -150,7 +151,8 @@
 	data/CohesiveKinDataTet4f.hh \
 	data/CohesiveKinDataHex8.hh \
 	data/BoundaryData.hh \
-	data/BoundaryDataTri3.hh
+	data/BoundaryDataTri3.hh \
+	data/BoundaryDataTet4.hh
 
 AM_CPPFLAGS = $(PETSC_SIEVE_FLAGS) $(PETSC_INCLUDE)
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestBoundary.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestBoundary.cc	2007-07-05 23:45:19 UTC (rev 7604)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestBoundary.cc	2007-07-06 02:13:17 UTC (rev 7605)
@@ -21,12 +21,13 @@
 #include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
 
 #include "data/BoundaryDataTri3.hh" // USES BoundaryDataTri3
+#include "data/BoundaryDataTet4.hh" // USES BoundaryDataTet4
 
 // ----------------------------------------------------------------------
 CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestBoundary );
 
 // ----------------------------------------------------------------------
-// Test createBoundary() with 2-D triangular element.
+// Test createBoundary() with 2-D triangular elements.
 void
 pylith::faults::TestBoundary::testCreateBoundaryTri3(void)
 { // testCreateBoundaryTri3
@@ -35,6 +36,15 @@
 } // testCreateBoundaryTri3
 
 // ----------------------------------------------------------------------
+// Test createBoundary() with 3-D tetrahedral elements.
+void
+pylith::faults::TestBoundary::testCreateBoundaryTet4(void)
+{ // testCreateBoundaryTet4
+  BoundaryDataTet4 data;
+  _testCreateBoundary(data);
+} // testCreateBoundaryTet4
+
+// ----------------------------------------------------------------------
 // Test createBoundary().
 void
 pylith::faults::TestBoundary::_testCreateBoundary(const BoundaryData& data)

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestBoundary.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestBoundary.hh	2007-07-05 23:45:19 UTC (rev 7604)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestBoundary.hh	2007-07-06 02:13:17 UTC (rev 7605)
@@ -41,6 +41,7 @@
   CPPUNIT_TEST_SUITE( TestBoundary );
 
   CPPUNIT_TEST( testCreateBoundaryTri3 );
+  CPPUNIT_TEST( testCreateBoundaryTet4 );
 
   CPPUNIT_TEST_SUITE_END();
 
@@ -49,6 +50,8 @@
 
   /// Test createBoundary() with 2-D triangular element.
   void testCreateBoundaryTri3(void);
+  /// Test createBoundary() with 3-D tetrahedral element.
+  void testCreateBoundaryTet4(void);
 
   // PROTECTED METHODS //////////////////////////////////////////////////
 public :

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/BoundaryDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/BoundaryDataTet4.cc	2007-07-05 23:45:19 UTC (rev 7604)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/BoundaryDataTet4.cc	2007-07-06 02:13:17 UTC (rev 7605)
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-1, vertices are 2-6.
+ *
+ * 2   3,4,5  6
+ *
+ *     ^^^^^ Face in x-y plane
+ *
+ * After adding cohesive elements
+ *
+ * Cells are 0-1,10, vertices are 2-9.
+ *
+ * 2   3,4,5  7,8,9   6
+ *
+ *     ^^^^^^^^^^^^ Cohesive element in x-y plane.
+ */
+
+#include "BoundaryDataTet4.hh"
+
+const int pylith::faults::BoundaryDataTet4::_numVertices = 5;
+
+const int pylith::faults::BoundaryDataTet4::_spaceDim = 3;
+
+const int pylith::faults::BoundaryDataTet4::_numCells = 6;
+
+const int pylith::faults::BoundaryDataTet4::_cellDim = 2;
+
+const double pylith::faults::BoundaryDataTet4::_vertices[] = {
+  -1.0,  0.0,  0.0,
+   0.0, -1.0,  0.0,
+   0.0,  0.0,  1.0,
+   0.0,  1.0,  0.0,
+   1.0,  0.0,  0.0,
+};
+
+const int pylith::faults::BoundaryDataTet4::_numCorners[] = {
+  3,
+  3,
+  3,
+  3,
+  3,
+  3
+};
+
+const int pylith::faults::BoundaryDataTet4::_cells[] = {
+  3,  4,  2,
+  2,  5,  3,
+  4,  5,  2,
+  6,  4,  3,
+  3,  5,  6,
+  5,  4,  6,
+};
+
+const char* pylith::faults::BoundaryDataTet4::_filename = "data/tet4traction.mesh";
+
+pylith::faults::BoundaryDataTet4::BoundaryDataTet4(void)
+{ // constructor
+  numVertices = _numVertices;
+  spaceDim = _spaceDim;
+  numCells = _numCells;
+  cellDim = _cellDim;
+  vertices = const_cast<double*>(_vertices);
+  numCorners = const_cast<int*>(_numCorners);
+  cells = const_cast<int*>(_cells);
+  filename = const_cast<char*>(_filename);
+} // constructor
+
+pylith::faults::BoundaryDataTet4::~BoundaryDataTet4(void)
+{}
+
+
+// End of file

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/BoundaryDataTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/BoundaryDataTet4.hh	2007-07-05 23:45:19 UTC (rev 7604)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/BoundaryDataTet4.hh	2007-07-06 02:13:17 UTC (rev 7605)
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_boundarydatatet4_hh)
+#define pylith_faults_boundarydatatet4_hh
+
+#include "BoundaryData.hh"
+
+namespace pylith {
+  namespace faults {
+     class BoundaryDataTet4;
+  } // pylith
+} // faults
+
+class pylith::faults::BoundaryDataTet4 : public BoundaryData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public: 
+
+  /// Constructor
+  BoundaryDataTet4(void);
+
+  /// Destructor
+  ~BoundaryDataTet4(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+  static const int _numVertices; ///< Number of vertices
+  static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+  static const int _numCells; ///< Number of cells
+  static const int _cellDim; ///< Number of dimensions associated with cell
+
+  static const double _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 char* _filename; ///< Filename of input mesh
+};
+
+#endif // pylith_faults_boundarydatatet4_hh
+
+// End of file

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/tet4traction.mesh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/tet4traction.mesh	2007-07-05 23:45:19 UTC (rev 7604)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/tet4traction.mesh	2007-07-06 02:13:17 UTC (rev 7605)
@@ -0,0 +1,49 @@
+mesh = {
+  dimension = 3
+  use-index-zero = true
+  vertices = {
+    dimension = 3
+    count = 5
+    coordinates = {
+             0     -1.0  0.0  0.0
+             1      0.0 -1.0  0.0
+             2      0.0  0.0  1.0
+             3      0.0  1.0  0.0
+             4      1.0  0.0  0.0
+    }
+  }
+  cells = {
+    count = 2
+    num-corners = 4
+    simplices = {
+             0       1  2  3  0
+             1       1  3  2  4
+    }
+    material-ids = {
+             0   0
+             1   0
+    }
+  }
+  group = {
+    name = fault
+    type = vertices
+    count = 3
+    indices = {
+      1
+      2
+      3
+    }
+  }
+  group = {
+    name = traction
+    type = vertices
+    count = 5
+    indices = {
+      0
+      1
+      2
+      3
+      4
+    }
+  }
+}



More information about the cig-commits mailing list