[cig-commits] r6599 - in
short/3D/PyLith/trunk/unittests/libtests/faults: . data
brad at geodynamics.org
brad at geodynamics.org
Wed Apr 18 17:01:29 PDT 2007
Author: brad
Date: 2007-04-18 17:01:29 -0700 (Wed, 18 Apr 2007)
New Revision: 6599
Added:
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataLine2.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataLine2.hh
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.hh
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3.hh
Removed:
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.hh
Modified:
short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh
Log:
Added tests for creating cohesive elements for triangle and tetrahedral elements.
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am 2007-04-19 00:01:29 UTC (rev 6599)
@@ -32,11 +32,15 @@
# Source files associated with testing data
testfaults_SOURCES += \
data/CohesiveData.cc \
- data/CohesiveData1D.cc
+ data/CohesiveDataLine2.cc \
+ data/CohesiveDataTri3.cc \
+ data/CohesiveDataTet4.cc
noinst_HEADERS += \
data/CohesiveData.hh \
- data/CohesiveData1D.hh
+ data/CohesiveDataLine2.hh \
+ data/CohesiveDataTri3.hh \
+ data/CohesiveDataTet4.hh
testfaults_LDFLAGS = $(PETSC_LIB)
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc 2007-04-19 00:01:29 UTC (rev 6599)
@@ -14,29 +14,48 @@
#include "TestFaultCohesive.hh" // Implementation of class methods
-#include "data/CohesiveData1D.hh" // USES CohesiveData1D
-
#include "pylith/faults/FaultCohesiveKin.hh" // USES FaultsCohesiveKin
#include "pylith/utils/sievetypes.hh" // USES PETSc Mesh
#include "pylith/utils/array.hh" // USES int_array
#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
-#include <stdexcept> // TEMPORARY
+#include "data/CohesiveDataLine2.hh" // USES CohesiveDataLine2
+#include "data/CohesiveDataTri3.hh" // USES CohesiveDataTri3
+#include "data/CohesiveDataTet4.hh" // USES CohesiveDataTet4
+
// ----------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestFaultCohesive );
// ----------------------------------------------------------------------
// Test adjustTopology() with 1-D line element.
void
-pylith::faults::TestFaultCohesive::testAdjustTopologyLine(void)
-{ // testAdjustTopologyLine
- CohesiveData1D data;
+pylith::faults::TestFaultCohesive::testAdjustTopologyLine2(void)
+{ // testAdjustTopologyLine2
+ CohesiveDataLine2 data;
_testAdjustTopology(data);
-} // testAdjustTopologyLine
+} // testAdjustTopologyLine2
// ----------------------------------------------------------------------
+// Test adjustTopology() with 2-D triangular element.
+void
+pylith::faults::TestFaultCohesive::testAdjustTopologyTri3(void)
+{ // testAdjustTopologyTri3
+ CohesiveDataTri3 data;
+ _testAdjustTopology(data);
+} // testAdjustTopologyTri3
+
+// ----------------------------------------------------------------------
+// Test adjustTopology() with 3-D tetrahedral element.
+void
+pylith::faults::TestFaultCohesive::testAdjustTopologyTet4(void)
+{ // testAdjustTopologyTet4
+ CohesiveDataTet4 data;
+ _testAdjustTopology(data);
+} // testAdjustTopologyTet4
+
+// ----------------------------------------------------------------------
// Test adjustTopology().
void
pylith::faults::TestFaultCohesive::_testAdjustTopology(const CohesiveData& data)
@@ -75,13 +94,12 @@
coordsField->restrictPoint(*v_iter);
const double tolerance = 1.0e-06;
for (int iDim=0; iDim < spaceDim; ++iDim)
- if (data.vertices[i] < 1.0) {
+ if (data.vertices[i] < 1.0)
CPPUNIT_ASSERT_DOUBLES_EQUAL(data.vertices[i++], vertexCoords[iDim],
tolerance);
- } else {
+ else
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vertexCoords[iDim]/data.vertices[i++],
tolerance);
- }
} // for
// check cells
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh 2007-04-19 00:01:29 UTC (rev 6599)
@@ -40,15 +40,23 @@
// CPPUNIT TEST SUITE /////////////////////////////////////////////////
CPPUNIT_TEST_SUITE( TestFaultCohesive );
- CPPUNIT_TEST( testAdjustTopologyLine );
+ CPPUNIT_TEST( testAdjustTopologyLine2 );
+ CPPUNIT_TEST( testAdjustTopologyTri3 );
+ CPPUNIT_TEST( testAdjustTopologyTet4 );
CPPUNIT_TEST_SUITE_END();
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
/// Test adjustTopology() with 1-D line element.
- void testAdjustTopologyLine(void);
+ void testAdjustTopologyLine2(void);
+ /// Test adjustTopology() with 2-D triangular element.
+ void testAdjustTopologyTri3(void);
+
+ /// Test adjustTopology() with 3-D tetrahedral element.
+ void testAdjustTopologyTet4(void);
+
// PROTECTED METHODS //////////////////////////////////////////////////
public :
Deleted: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.cc 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.cc 2007-04-19 00:01:29 UTC (rev 6599)
@@ -1,96 +0,0 @@
-// -*- C++ -*-
-//
-// ======================================================================
-//
-// Brad T. Aagaard
-// U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ======================================================================
-//
-
-/* Original mesh
- *
- * 0 -------- 1 -------- 2
- *
- * After adding cohesive elements
- * 0 -------- 1 -- 3 -------- 2
- */
-
-#include "CohesiveData1D.hh"
-
-const int pylith::faults::CohesiveData1D::_numVertices = 3;
-
-const int pylith::faults::CohesiveData1D::_spaceDim = 1;
-
-const int pylith::faults::CohesiveData1D::_numCells = 3;
-
-const int pylith::faults::CohesiveData1D::_cellDim = 1;
-
-const double pylith::faults::CohesiveData1D::_vertices[] = {
- -1.0,
- 0.0,
- 1.0
-};
-
-const int pylith::faults::CohesiveData1D::_numCorners[] = {
- 2,
- 2,
- 2
-};
-
-const int pylith::faults::CohesiveData1D::_cells[] = {
- 0, 1,
- 3, 2,
- 1, 3,
-};
-
-const int pylith::faults::CohesiveData1D::_materialIds[] = {
- 0, 0,
- 1
-};
-
-const int pylith::faults::CohesiveData1D::_numGroups = 2;
-
-const int pylith::faults::CohesiveData1D::_groupSizes[] =
- { 1, 2 };
-
-const int pylith::faults::CohesiveData1D::_groups[] = {
- 1,
- 0, 1
-};
-
-const char* pylith::faults::CohesiveData1D::_groupNames[] = {
- "fault", "output"
-};
-
-const char* pylith::faults::CohesiveData1D::_groupTypes[] = {
- "vertex", "vertex"
-};
-
-const char* pylith::faults::CohesiveData1D::_filename = "data/meshLine.txt";
-
-pylith::faults::CohesiveData1D::CohesiveData1D(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);
- materialIds = const_cast<int*>(_materialIds);
- groups = const_cast<int*>(_groups);
- groupSizes = const_cast<int*>(_groupSizes);
- groupNames = const_cast<char**>(_groupNames);
- groupTypes = const_cast<char**>(_groupTypes);
- numGroups = _numGroups;
- filename = const_cast<char*>(_filename);
-} // constructor
-
-pylith::faults::CohesiveData1D::~CohesiveData1D(void)
-{}
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.hh 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.hh 2007-04-19 00:01:29 UTC (rev 6599)
@@ -1,60 +0,0 @@
-// -*- C++ -*-
-//
-// ======================================================================
-//
-// Brad T. Aagaard
-// U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ======================================================================
-//
-
-#if !defined(pylith_faults_cohesivedata1d_hh)
-#define pylith_faults_cohesivedata1d_hh
-
-#include "CohesiveData.hh"
-
-namespace pylith {
- namespace faults {
- class CohesiveData1D;
- } // pylith
-} // faults
-
-class pylith::faults::CohesiveData1D : public CohesiveData
-{
-
-// PUBLIC METHODS ///////////////////////////////////////////////////////
-public:
-
- /// Constructor
- CohesiveData1D(void);
-
- /// Destructor
- ~CohesiveData1D(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 int _materialIds[]; ///< Pointer to cell material identifiers
-
- static const int _groups[]; ///< Groups of points
- static const int _groupSizes[]; ///< Sizes of groups
- static const char* _groupNames[]; ///< Array of group names
- static const char* _groupTypes[]; ///< Array of group types
- static const int _numGroups; ///< Number of groups
-
- static const char* _filename; ///< Filename of input mesh
-};
-
-#endif // pylith_faults_cohesivedata1d_hh
-
-// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataLine2.cc (from rev 6598, short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.cc 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataLine2.cc 2007-04-19 00:01:29 UTC (rev 6599)
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * 0 -------- 1 -------- 2
+ *
+ * After adding cohesive elements
+ * 0 -------- 1 -- 3 -------- 2
+ */
+
+#include "CohesiveDataLine2.hh"
+
+const int pylith::faults::CohesiveDataLine2::_numVertices = 4;
+
+const int pylith::faults::CohesiveDataLine2::_spaceDim = 1;
+
+const int pylith::faults::CohesiveDataLine2::_numCells = 3;
+
+const int pylith::faults::CohesiveDataLine2::_cellDim = 1;
+
+const double pylith::faults::CohesiveDataLine2::_vertices[] = {
+ -1.0,
+ 0.0,
+ 1.0,
+ 0.0
+};
+
+const int pylith::faults::CohesiveDataLine2::_numCorners[] = {
+ 2,
+ 2,
+ 2
+};
+
+const int pylith::faults::CohesiveDataLine2::_cells[] = {
+ 0, 1,
+ 3, 2,
+ 1, 3,
+};
+
+const int pylith::faults::CohesiveDataLine2::_materialIds[] = {
+ 0, 0,
+ 1
+};
+
+const int pylith::faults::CohesiveDataLine2::_numGroups = 2;
+
+const int pylith::faults::CohesiveDataLine2::_groupSizes[] =
+ { 1, 2 };
+
+const int pylith::faults::CohesiveDataLine2::_groups[] = {
+ 1,
+ 0, 1
+};
+
+const char* pylith::faults::CohesiveDataLine2::_groupNames[] = {
+ "fault", "output"
+};
+
+const char* pylith::faults::CohesiveDataLine2::_groupTypes[] = {
+ "vertex", "vertex"
+};
+
+const char* pylith::faults::CohesiveDataLine2::_filename = "data/meshLine.txt";
+
+pylith::faults::CohesiveDataLine2::CohesiveDataLine2(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);
+ materialIds = const_cast<int*>(_materialIds);
+ groups = const_cast<int*>(_groups);
+ groupSizes = const_cast<int*>(_groupSizes);
+ groupNames = const_cast<char**>(_groupNames);
+ groupTypes = const_cast<char**>(_groupTypes);
+ numGroups = _numGroups;
+ filename = const_cast<char*>(_filename);
+} // constructor
+
+pylith::faults::CohesiveDataLine2::~CohesiveDataLine2(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataLine2.hh (from rev 6597, short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveData1D.hh 2007-04-18 22:53:04 UTC (rev 6597)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataLine2.hh 2007-04-19 00:01:29 UTC (rev 6599)
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesivedataline2_hh)
+#define pylith_faults_cohesivedataline2_hh
+
+#include "CohesiveData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveDataLine2;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveDataLine2 : public CohesiveData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveDataLine2(void);
+
+ /// Destructor
+ ~CohesiveDataLine2(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 int _materialIds[]; ///< Pointer to cell material identifiers
+
+ static const int _groups[]; ///< Groups of points
+ static const int _groupSizes[]; ///< Sizes of groups
+ static const char* _groupNames[]; ///< Array of group names
+ static const char* _groupTypes[]; ///< Array of group types
+ static const int _numGroups; ///< Number of groups
+
+ static const char* _filename; ///< Filename of input mesh
+};
+
+#endif // pylith_faults_cohesivedataline2_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.cc 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.cc 2007-04-19 00:01:29 UTC (rev 6599)
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * 1
+ * /|\
+ * / | \
+ * / | \
+ * / | \
+ * 0 | 3
+ * \ | /
+ * \ | /
+ * \ | /
+ * \|/
+ * 2
+ *
+ *
+ * After adding cohesive elements
+ *
+ * 1 -- 4
+ * /| |\
+ * / | | \
+ * / | | \
+ * / | | \
+ * 0 | | 3
+ * \ | | /
+ * \ | | /
+ * \ | | /
+ * \| |/
+ * 2 -- 5
+ */
+
+#include "CohesiveDataTet4.hh"
+
+const int pylith::faults::CohesiveDataTet4::_numVertices = 8;
+
+const int pylith::faults::CohesiveDataTet4::_spaceDim = 3;
+
+const int pylith::faults::CohesiveDataTet4::_numCells = 3;
+
+const int pylith::faults::CohesiveDataTet4::_cellDim = 3;
+
+const double pylith::faults::CohesiveDataTet4::_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,
+ 0.0, -1.0, 0.0,
+ 0.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0
+};
+
+const int pylith::faults::CohesiveDataTet4::_numCorners[] = {
+ 4,
+ 4,
+ 6
+};
+
+const int pylith::faults::CohesiveDataTet4::_cells[] = {
+ 1, 2, 3, 0,
+ 5, 7, 6, 4,
+ 1, 3, 2, 5, 7, 6
+};
+
+const int pylith::faults::CohesiveDataTet4::_materialIds[] = {
+ 0, 0,
+ 1
+};
+
+const int pylith::faults::CohesiveDataTet4::_numGroups = 2;
+
+const int pylith::faults::CohesiveDataTet4::_groupSizes[] =
+ { 3, 3 };
+
+const int pylith::faults::CohesiveDataTet4::_groups[] = {
+ 1, 2, 3,
+ 0, 2, 3
+};
+
+const char* pylith::faults::CohesiveDataTet4::_groupNames[] = {
+ "fault", "output"
+};
+
+const char* pylith::faults::CohesiveDataTet4::_groupTypes[] = {
+ "vertex", "vertex"
+};
+
+const char* pylith::faults::CohesiveDataTet4::_filename = "data/meshTet4A.txt";
+
+pylith::faults::CohesiveDataTet4::CohesiveDataTet4(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);
+ materialIds = const_cast<int*>(_materialIds);
+ groups = const_cast<int*>(_groups);
+ groupSizes = const_cast<int*>(_groupSizes);
+ groupNames = const_cast<char**>(_groupNames);
+ groupTypes = const_cast<char**>(_groupTypes);
+ numGroups = _numGroups;
+ filename = const_cast<char*>(_filename);
+} // constructor
+
+pylith::faults::CohesiveDataTet4::~CohesiveDataTet4(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.hh 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTet4.hh 2007-04-19 00:01:29 UTC (rev 6599)
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesivedatatet4_hh)
+#define pylith_faults_cohesivedatatet4_hh
+
+#include "CohesiveData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveDataTet4;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveDataTet4 : public CohesiveData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveDataTet4(void);
+
+ /// Destructor
+ ~CohesiveDataTet4(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 int _materialIds[]; ///< Pointer to cell material identifiers
+
+ static const int _groups[]; ///< Groups of points
+ static const int _groupSizes[]; ///< Sizes of groups
+ static const char* _groupNames[]; ///< Array of group names
+ static const char* _groupTypes[]; ///< Array of group types
+ static const int _numGroups; ///< Number of groups
+
+ static const char* _filename; ///< Filename of input mesh
+};
+
+#endif // pylith_faults_cohesivedatatet4_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3.cc 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3.cc 2007-04-19 00:01:29 UTC (rev 6599)
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * 1
+ * /|\
+ * / | \
+ * / | \
+ * / | \
+ * 0 | 3
+ * \ | /
+ * \ | /
+ * \ | /
+ * \|/
+ * 2
+ *
+ *
+ * After adding cohesive elements
+ *
+ * 1 -- 4
+ * /| |\
+ * / | | \
+ * / | | \
+ * / | | \
+ * 0 | | 3
+ * \ | | /
+ * \ | | /
+ * \ | | /
+ * \| |/
+ * 2 -- 5
+ */
+
+#include "CohesiveDataTri3.hh"
+
+const int pylith::faults::CohesiveDataTri3::_numVertices = 6;
+
+const int pylith::faults::CohesiveDataTri3::_spaceDim = 2;
+
+const int pylith::faults::CohesiveDataTri3::_numCells = 3;
+
+const int pylith::faults::CohesiveDataTri3::_cellDim = 2;
+
+const double pylith::faults::CohesiveDataTri3::_vertices[] = {
+ -1.0, 0.0,
+ 0.0, 1.0,
+ 0.0, -1.0,
+ 1.0, 0.0,
+ 0.0, 1.0,
+ 0.0, -1.0
+};
+
+const int pylith::faults::CohesiveDataTri3::_numCorners[] = {
+ 3,
+ 3,
+ 4
+};
+
+const int pylith::faults::CohesiveDataTri3::_cells[] = {
+ 0, 2, 1,
+ 4, 5, 3,
+ 1, 2, 4, 5
+};
+
+const int pylith::faults::CohesiveDataTri3::_materialIds[] = {
+ 0, 0,
+ 1
+};
+
+const int pylith::faults::CohesiveDataTri3::_numGroups = 2;
+
+const int pylith::faults::CohesiveDataTri3::_groupSizes[] =
+ { 2, 3 };
+
+const int pylith::faults::CohesiveDataTri3::_groups[] = {
+ 1, 2,
+ 1, 2, 3
+};
+
+const char* pylith::faults::CohesiveDataTri3::_groupNames[] = {
+ "fault", "output"
+};
+
+const char* pylith::faults::CohesiveDataTri3::_groupTypes[] = {
+ "vertex", "vertex"
+};
+
+const char* pylith::faults::CohesiveDataTri3::_filename = "data/meshTri3A.txt";
+
+pylith::faults::CohesiveDataTri3::CohesiveDataTri3(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);
+ materialIds = const_cast<int*>(_materialIds);
+ groups = const_cast<int*>(_groups);
+ groupSizes = const_cast<int*>(_groupSizes);
+ groupNames = const_cast<char**>(_groupNames);
+ groupTypes = const_cast<char**>(_groupTypes);
+ numGroups = _numGroups;
+ filename = const_cast<char*>(_filename);
+} // constructor
+
+pylith::faults::CohesiveDataTri3::~CohesiveDataTri3(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3.hh 2007-04-18 23:05:37 UTC (rev 6598)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3.hh 2007-04-19 00:01:29 UTC (rev 6599)
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesivedatatri3_hh)
+#define pylith_faults_cohesivedatatri3_hh
+
+#include "CohesiveData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveDataTri3;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveDataTri3 : public CohesiveData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveDataTri3(void);
+
+ /// Destructor
+ ~CohesiveDataTri3(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 int _materialIds[]; ///< Pointer to cell material identifiers
+
+ static const int _groups[]; ///< Groups of points
+ static const int _groupSizes[]; ///< Sizes of groups
+ static const char* _groupNames[]; ///< Array of group names
+ static const char* _groupTypes[]; ///< Array of group types
+ static const int _numGroups; ///< Number of groups
+
+ static const char* _filename; ///< Filename of input mesh
+};
+
+#endif // pylith_faults_cohesivedatatri3_hh
+
+// End of file
More information about the cig-commits
mailing list