[cig-commits] r7129 - in
short/3D/PyLith/trunk/unittests/libtests/faults: . data
brad at geodynamics.org
brad at geodynamics.org
Mon Jun 11 10:31:08 PDT 2007
Author: brad
Date: 2007-06-11 10:31:07 -0700 (Mon, 11 Jun 2007)
New Revision: 7129
Added:
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/tri3b.mesh
short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3c.mesh
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
short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am
Log:
Added more unit tests for creating cohesive cells for tri3 mesh (different cell 'edges' are on fault).
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am 2007-06-11 17:31:07 UTC (rev 7129)
@@ -51,6 +51,8 @@
data/CohesiveDataLine2.cc \
data/CohesiveDataLine2Lagrange.cc \
data/CohesiveDataTri3.cc \
+ data/CohesiveDataTri3b.cc \
+ data/CohesiveDataTri3c.cc \
data/CohesiveDataTri3Lagrange.cc \
data/CohesiveDataQuad4.cc \
data/CohesiveDataQuad4Lagrange.cc \
@@ -70,6 +72,8 @@
data/CohesiveDataLine2.hh \
data/CohesiveDataLine2Lagrange.hh \
data/CohesiveDataTri3.hh \
+ data/CohesiveDataTri3b.hh \
+ data/CohesiveDataTri3c.hh \
data/CohesiveDataTri3Lagrange.hh \
data/CohesiveDataQuad4.hh \
data/CohesiveDataQuad4Lagrange.hh \
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.cc 2007-06-11 17:31:07 UTC (rev 7129)
@@ -24,6 +24,8 @@
#include "data/CohesiveDataLine2.hh" // USES CohesiveDataLine2
#include "data/CohesiveDataTri3.hh" // USES CohesiveDataTri3
+#include "data/CohesiveDataTri3b.hh" // USES CohesiveDataTri3b
+#include "data/CohesiveDataTri3c.hh" // USES CohesiveDataTri3c
#include "data/CohesiveDataQuad4.hh" // USES CohesiveDataQuad4
#include "data/CohesiveDataTet4.hh" // USES CohesiveDataTet4
#include "data/CohesiveDataHex8.hh" // USES CohesiveDataHex8
@@ -58,6 +60,26 @@
} // testAdjustTopologyTri3
// ----------------------------------------------------------------------
+// Test adjustTopology() with 2-D triangular element.
+void
+pylith::faults::TestFaultCohesive::testAdjustTopologyTri3b(void)
+{ // testAdjustTopologyTri3b
+ CohesiveDataTri3b data;
+ FaultCohesiveDyn fault;
+ _testAdjustTopology(&fault, data);
+} // testAdjustTopologyTri3b
+
+// ----------------------------------------------------------------------
+// Test adjustTopology() with 2-D triangular element.
+void
+pylith::faults::TestFaultCohesive::testAdjustTopologyTri3c(void)
+{ // testAdjustTopologyTri3c
+ CohesiveDataTri3c data;
+ FaultCohesiveDyn fault;
+ _testAdjustTopology(&fault, data);
+} // testAdjustTopologyTri3c
+
+// ----------------------------------------------------------------------
// Test adjustTopology() with 2-D quadrilateral element.
void
pylith::faults::TestFaultCohesive::testAdjustTopologyQuad4(void)
@@ -256,7 +278,7 @@
ALE::Obj<ALE::Mesh> mesh;
meshio::MeshIOAscii iohandler;
iohandler.filename(data.filename);
- iohandler.debug(false);
+ iohandler.debug(true);
iohandler.interpolate(false);
iohandler.read(&mesh);
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesive.hh 2007-06-11 17:31:07 UTC (rev 7129)
@@ -43,6 +43,8 @@
CPPUNIT_TEST( testAdjustTopologyLine2 );
CPPUNIT_TEST( testAdjustTopologyTri3 );
+ CPPUNIT_TEST( testAdjustTopologyTri3b );
+ CPPUNIT_TEST( testAdjustTopologyTri3c );
CPPUNIT_TEST( testAdjustTopologyQuad4 );
CPPUNIT_TEST( testAdjustTopologyTet4 );
CPPUNIT_TEST( testAdjustTopologyHex8 );
@@ -68,6 +70,12 @@
/// Test adjustTopology() with 2-D triangular element.
void testAdjustTopologyTri3(void);
+ /// Test adjustTopology() with 2-D triangular element (edge b).
+ void testAdjustTopologyTri3b(void);
+
+ /// Test adjustTopology() with 2-D triangular element (edge c).
+ void testAdjustTopologyTri3c(void);
+
/// Test adjustTopology() with 2-D quadrilateral element.
void testAdjustTopologyQuad4(void);
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc 2007-06-11 17:31:07 UTC (rev 7129)
@@ -256,7 +256,7 @@
err = MatAssemblyEnd(jacobian, MAT_FINAL_ASSEMBLY);
CPPUNIT_ASSERT(0 == err);
- MatView(jacobian, PETSC_VIEWER_STDOUT_WORLD);
+ //MatView(jacobian, PETSC_VIEWER_STDOUT_WORLD);
const double* valsE = _data->valsJacobian;
const int nrowsE = dispT->sizeWithBC();
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.cc 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.cc 2007-06-11 17:31:07 UTC (rev 7129)
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-1, vertices are 2-5.
+ *
+ * 3
+ * /|\
+ * / | \
+ * / | \
+ * / | \
+ * 2 | 5
+ * \ | /
+ * \ | /
+ * \ | /
+ * \|/
+ * 4
+ *
+ *
+ * After adding cohesive elements
+ *
+ * Cells are 0-1, 8, vertices are 2-7.
+ *
+ * 3 -- 6
+ * /| |\
+ * / | | \
+ * / | | \
+ * / | | \
+ * 2 | | 5
+ * \ | | /
+ * \ | | /
+ * \ | | /
+ * \| |/
+ * 4 -- 7
+ */
+
+#include "CohesiveDataTri3b.hh"
+
+const int pylith::faults::CohesiveDataTri3b::_numVertices = 6;
+
+const int pylith::faults::CohesiveDataTri3b::_spaceDim = 2;
+
+const int pylith::faults::CohesiveDataTri3b::_numCells = 3;
+
+const int pylith::faults::CohesiveDataTri3b::_cellDim = 2;
+
+const double pylith::faults::CohesiveDataTri3b::_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::CohesiveDataTri3b::_numCorners[] = {
+ 3,
+ 3,
+ 4
+};
+
+const int pylith::faults::CohesiveDataTri3b::_cells[] = {
+ 4, 3, 2,
+ 7, 5, 6,
+ 3, 4, 6, 7
+};
+
+const int pylith::faults::CohesiveDataTri3b::_materialIds[] = {
+ 0, 0,
+ 1
+};
+
+const int pylith::faults::CohesiveDataTri3b::_numGroups = 2;
+
+const int pylith::faults::CohesiveDataTri3b::_groupSizes[] =
+ { 4, 5 };
+
+const int pylith::faults::CohesiveDataTri3b::_groups[] = {
+ 3, 4, 6, 7,
+ 3, 4, 5, 6, 7
+};
+
+const char* pylith::faults::CohesiveDataTri3b::_groupNames[] = {
+ "fault", "output"
+};
+
+const char* pylith::faults::CohesiveDataTri3b::_groupTypes[] = {
+ "vertex", "vertex"
+};
+
+const char* pylith::faults::CohesiveDataTri3b::_filename = "data/tri3b.mesh";
+
+pylith::faults::CohesiveDataTri3b::CohesiveDataTri3b(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::CohesiveDataTri3b::~CohesiveDataTri3b(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.hh 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3b.hh 2007-06-11 17:31:07 UTC (rev 7129)
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesivedatatri3b_hh)
+#define pylith_faults_cohesivedatatri3b_hh
+
+#include "CohesiveData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveDataTri3b;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveDataTri3b : public CohesiveData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveDataTri3b(void);
+
+ /// Destructor
+ ~CohesiveDataTri3b(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_cohesivedatatri3b_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.cc 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.cc 2007-06-11 17:31:07 UTC (rev 7129)
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-1, vertices are 2-5.
+ *
+ * 3
+ * /|\
+ * / | \
+ * / | \
+ * / | \
+ * 2 | 5
+ * \ | /
+ * \ | /
+ * \ | /
+ * \|/
+ * 4
+ *
+ *
+ * After adding cohesive elements
+ *
+ * Cells are 0-1, 8, vertices are 2-7.
+ *
+ * 3 -- 6
+ * /| |\
+ * / | | \
+ * / | | \
+ * / | | \
+ * 2 | | 5
+ * \ | | /
+ * \ | | /
+ * \ | | /
+ * \| |/
+ * 4 -- 7
+ */
+
+#include "CohesiveDataTri3c.hh"
+
+const int pylith::faults::CohesiveDataTri3c::_numVertices = 6;
+
+const int pylith::faults::CohesiveDataTri3c::_spaceDim = 2;
+
+const int pylith::faults::CohesiveDataTri3c::_numCells = 3;
+
+const int pylith::faults::CohesiveDataTri3c::_cellDim = 2;
+
+const double pylith::faults::CohesiveDataTri3c::_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::CohesiveDataTri3c::_numCorners[] = {
+ 3,
+ 3,
+ 4
+};
+
+const int pylith::faults::CohesiveDataTri3c::_cells[] = {
+ 3, 2, 4,
+ 5, 6, 7,
+ 3, 4, 6, 7
+};
+
+const int pylith::faults::CohesiveDataTri3c::_materialIds[] = {
+ 0, 0,
+ 1
+};
+
+const int pylith::faults::CohesiveDataTri3c::_numGroups = 2;
+
+const int pylith::faults::CohesiveDataTri3c::_groupSizes[] =
+ { 4, 5 };
+
+const int pylith::faults::CohesiveDataTri3c::_groups[] = {
+ 3, 4, 6, 7,
+ 3, 4, 5, 6, 7
+};
+
+const char* pylith::faults::CohesiveDataTri3c::_groupNames[] = {
+ "fault", "output"
+};
+
+const char* pylith::faults::CohesiveDataTri3c::_groupTypes[] = {
+ "vertex", "vertex"
+};
+
+const char* pylith::faults::CohesiveDataTri3c::_filename = "data/tri3c.mesh";
+
+pylith::faults::CohesiveDataTri3c::CohesiveDataTri3c(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::CohesiveDataTri3c::~CohesiveDataTri3c(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.hh 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDataTri3c.hh 2007-06-11 17:31:07 UTC (rev 7129)
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesivedatatri3c_hh)
+#define pylith_faults_cohesivedatatri3c_hh
+
+#include "CohesiveData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveDataTri3c;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveDataTri3c : public CohesiveData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveDataTri3c(void);
+
+ /// Destructor
+ ~CohesiveDataTri3c(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_cohesivedatatri3c_hh
+
+// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am 2007-06-11 17:31:07 UTC (rev 7129)
@@ -16,6 +16,8 @@
line2_sliptime.spatialdb \
line2_peakrate.spatialdb \
tri3.mesh \
+ tri3b.mesh \
+ tri3c.mesh \
tri3_finalslip.spatialdb \
tri3_sliptime.spatialdb \
tri3_peakrate.spatialdb \
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3b.mesh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3b.mesh 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3b.mesh 2007-06-11 17:31:07 UTC (rev 7129)
@@ -0,0 +1,45 @@
+mesh = {
+ dimension = 2
+ use-index-zero = true
+ vertices = {
+ dimension = 2
+ count = 4
+ coordinates = {
+ 0 -1.0 0.0
+ 1 0.0 1.0
+ 2 0.0 -1.0
+ 3 1.0 0.0
+ }
+ }
+ cells = {
+ count = 2
+ num-corners = 3
+ simplices = {
+ 0 2 1 0
+ 1 2 3 1
+ }
+ material-ids = {
+ 0 0
+ 1 0
+ }
+ }
+ group = {
+ name = fault
+ type = vertices
+ count = 2
+ indices = {
+ 1
+ 2
+ }
+ }
+ group = {
+ name = output
+ type = vertices
+ count = 3
+ indices = {
+ 1
+ 2
+ 3
+ }
+ }
+}
Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3c.mesh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3c.mesh 2007-06-11 16:55:40 UTC (rev 7128)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3c.mesh 2007-06-11 17:31:07 UTC (rev 7129)
@@ -0,0 +1,45 @@
+mesh = {
+ dimension = 2
+ use-index-zero = true
+ vertices = {
+ dimension = 2
+ count = 4
+ coordinates = {
+ 0 -1.0 0.0
+ 1 0.0 1.0
+ 2 0.0 -1.0
+ 3 1.0 0.0
+ }
+ }
+ cells = {
+ count = 2
+ num-corners = 3
+ simplices = {
+ 0 1 0 2
+ 1 3 1 2
+ }
+ material-ids = {
+ 0 0
+ 1 0
+ }
+ }
+ group = {
+ name = fault
+ type = vertices
+ count = 2
+ indices = {
+ 1
+ 2
+ }
+ }
+ group = {
+ name = output
+ type = vertices
+ count = 3
+ indices = {
+ 1
+ 2
+ 3
+ }
+ }
+}
More information about the cig-commits
mailing list