[cig-commits] r6874 - in short/3D/PyLith/trunk: libsrc/topology
unittests/libtests/topology unittests/libtests/topology/data
brad at geodynamics.org
brad at geodynamics.org
Mon May 14 12:23:00 PDT 2007
Author: brad
Date: 2007-05-14 12:22:59 -0700 (Mon, 14 May 2007)
New Revision: 6874
Added:
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryQuad2D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryQuad2D.hh
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTet3D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTet3D.hh
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri2D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri2D.hh
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri3D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri3D.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataQuad2D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataQuad2D.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTet3D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTet3D.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri2D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri2D.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri3D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri3D.hh
Modified:
short/3D/PyLith/trunk/libsrc/topology/GeometryPoint1D.hh
short/3D/PyLith/trunk/libsrc/topology/GeometryPoint2D.hh
short/3D/PyLith/trunk/libsrc/topology/GeometryPoint3D.hh
short/3D/PyLith/trunk/libsrc/topology/GeometryTri3D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine1D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine2D.cc
short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine3D.cc
Log:
Fixed a few bugs in computing cell geometry. Made lower dimension test more rigourous. Added tests for more cell types.
Modified: short/3D/PyLith/trunk/libsrc/topology/GeometryPoint1D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/GeometryPoint1D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/libsrc/topology/GeometryPoint1D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -17,8 +17,8 @@
* point cell.
*/
-#if !defined(pylith_topology_geometrypoint_hh)
-#define pylith_topology_geometrypoint_hh
+#if !defined(pylith_topology_geometrypoint1d_hh)
+#define pylith_topology_geometrypoint1d_hh
#include "CellGeometry.hh" // ISA CellGeometry
@@ -59,7 +59,7 @@
}; // GeometryPoint1D
-#endif // pylith_topology_geometrypoint_hh
+#endif // pylith_topology_geometrypoint1d_hh
// End of file
Modified: short/3D/PyLith/trunk/libsrc/topology/GeometryPoint2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/GeometryPoint2D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/libsrc/topology/GeometryPoint2D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -17,8 +17,8 @@
* point cell.
*/
-#if !defined(pylith_topology_geometrypoint_hh)
-#define pylith_topology_geometrypoint_hh
+#if !defined(pylith_topology_geometrypoint2d_hh)
+#define pylith_topology_geometrypoint2d_hh
#include "CellGeometry.hh" // ISA CellGeometry
@@ -59,7 +59,7 @@
}; // GeometryPoint2D
-#endif // pylith_topology_geometrypoint_hh
+#endif // pylith_topology_geometrypoint2d_hh
// End of file
Modified: short/3D/PyLith/trunk/libsrc/topology/GeometryPoint3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/GeometryPoint3D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/libsrc/topology/GeometryPoint3D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -17,8 +17,8 @@
* point cell.
*/
-#if !defined(pylith_topology_geometrypoint_hh)
-#define pylith_topology_geometrypoint_hh
+#if !defined(pylith_topology_geometrypoint3d_hh)
+#define pylith_topology_geometrypoint3d_hh
#include "CellGeometry.hh" // ISA CellGeometry
@@ -59,7 +59,7 @@
}; // GeometryPoint3D
-#endif // pylith_topology_geometrypoint_hh
+#endif // pylith_topology_geometrypoint3d_hh
// End of file
Modified: short/3D/PyLith/trunk/libsrc/topology/GeometryTri3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/GeometryTri3D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/libsrc/topology/GeometryTri3D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -23,7 +23,7 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::topology::GeometryTri3D::GeometryTri3D(void) :
- CellGeometry(2, 2, 3)
+ CellGeometry(2, 3, 3)
{ // constructor
} // constructor
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am 2007-05-14 19:22:59 UTC (rev 6874)
@@ -26,6 +26,10 @@
TestGeometryLine1D.cc \
TestGeometryLine2D.cc \
TestGeometryLine3D.cc \
+ TestGeometryTri2D.cc \
+ TestGeometryTri3D.cc \
+ TestGeometryQuad2D.cc \
+ TestGeometryTet3D.cc \
test_topology.cc
noinst_HEADERS =
@@ -35,7 +39,11 @@
TestGeometryPoint3D.hh \
TestGeometryLine1D.hh \
TestGeometryLine2D.hh \
- TestGeometryLine3D.hh
+ TestGeometryLine3D.hh \
+ TestGeometryTri2D.hh \
+ TestGeometryTri3D.hh \
+ TestGeometryQuad2D.hh \
+ TestGeometryTet3D.hh
# Source files associated with testing data
testtopology_SOURCES += \
@@ -45,7 +53,11 @@
data/GeomDataPoint3D.cc \
data/GeomDataLine1D.cc \
data/GeomDataLine2D.cc \
- data/GeomDataLine3D.cc
+ data/GeomDataLine3D.cc \
+ data/GeomDataTri2D.cc \
+ data/GeomDataTri3D.cc \
+ data/GeomDataQuad2D.cc \
+ data/GeomDataTet3D.cc
noinst_HEADERS +=
data/CellGeomData.hh \
@@ -54,7 +66,11 @@
data/GeometryDataPoint3D.hh \
data/GeometryDataLine1D.hh \
data/GeometryDataLine2D.hh \
- data/GeometryDataLine3D.hh
+ data/GeometryDataLine3D.hh \
+ data/GeometryDataTri2D.hh \
+ data/GeometryDataTri3D.hh \
+ data/GeometryDataQuad2D.hh \
+ data/GeometryDataTet3D.hh
testtopology_LDFLAGS = $(PETSC_LIB) $(PYTHON_BLDLIBRARY)
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine1D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine1D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine1D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -16,6 +16,7 @@
#include "pylith/topology/GeometryLine1D.hh"
#include "pylith/topology/GeometryPoint1D.hh"
+#include "pylith/topology/GeometryPoint2D.hh"
#include "pylith/utils/array.hh" // USES double_array
@@ -70,7 +71,9 @@
GeometryLine1D geometry;
CellGeometry* geometryLD = geometry.geometryLowerDim();
GeometryPoint1D* geometryPt = dynamic_cast<GeometryPoint1D*>(geometryLD);
- CPPUNIT_ASSERT(0 != geometryLD);
+ CPPUNIT_ASSERT(0 != geometryPt);
+ GeometryPoint2D* geometryPt2 = dynamic_cast<GeometryPoint2D*>(geometryLD);
+ CPPUNIT_ASSERT(0 == geometryPt2);
delete geometryLD; geometryLD = 0;
} // testGeomLowerDim
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine2D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine2D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine2D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -16,6 +16,7 @@
#include "pylith/topology/GeometryLine2D.hh"
#include "pylith/topology/GeometryPoint2D.hh"
+#include "pylith/topology/GeometryPoint1D.hh"
#include "pylith/utils/array.hh" // USES double_array
@@ -70,7 +71,9 @@
GeometryLine2D geometry;
CellGeometry* geometryLD = geometry.geometryLowerDim();
GeometryPoint2D* geometryPt = dynamic_cast<GeometryPoint2D*>(geometryLD);
- CPPUNIT_ASSERT(0 != geometryLD);
+ CPPUNIT_ASSERT(0 != geometryPt);
+ GeometryPoint1D* geometryPt2 = dynamic_cast<GeometryPoint1D*>(geometryLD);
+ CPPUNIT_ASSERT(0 == geometryPt2);
delete geometryLD; geometryLD = 0;
} // testGeomLowerDim
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine3D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryLine3D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -16,6 +16,7 @@
#include "pylith/topology/GeometryLine3D.hh"
#include "pylith/topology/GeometryPoint3D.hh"
+#include "pylith/topology/GeometryPoint2D.hh"
#include "pylith/utils/array.hh" // USES double_array
@@ -70,7 +71,9 @@
GeometryLine3D geometry;
CellGeometry* geometryLD = geometry.geometryLowerDim();
GeometryPoint3D* geometryPt = dynamic_cast<GeometryPoint3D*>(geometryLD);
- CPPUNIT_ASSERT(0 != geometryLD);
+ CPPUNIT_ASSERT(0 != geometryPt);
+ GeometryPoint2D* geometryPt2 = dynamic_cast<GeometryPoint2D*>(geometryLD);
+ CPPUNIT_ASSERT(0 == geometryPt2);
delete geometryLD; geometryLD = 0;
} // testGeomLowerDim
Added: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryQuad2D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryQuad2D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryQuad2D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestGeometryQuad2D.hh" // Implementation of class methods
+
+#include "pylith/topology/GeometryQuad2D.hh"
+#include "pylith/topology/GeometryLine2D.hh"
+#include "pylith/topology/GeometryPoint2D.hh"
+
+#include "pylith/utils/array.hh" // USES double_array
+
+#include "data/GeomDataQuad2D.hh"
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::topology::TestGeometryQuad2D );
+
+// ----------------------------------------------------------------------
+// Test constructor
+void
+pylith::topology::TestGeometryQuad2D::testConstructor(void)
+{ // testConstructor
+ GeometryQuad2D geometry;
+} // testConstructor
+
+// ----------------------------------------------------------------------
+// Test cellDim()
+void
+pylith::topology::TestGeometryQuad2D::testCellDim(void)
+{ // testCellDim
+ GeometryQuad2D geometry;
+ GeomDataQuad2D data;
+ _testCellDim(geometry, data);
+} // testCellDim
+
+// ----------------------------------------------------------------------
+// Test spaceDim()
+void
+pylith::topology::TestGeometryQuad2D::testSpaceDim(void)
+{ // testSpaceDim
+ GeometryQuad2D geometry;
+ GeomDataQuad2D data;
+ _testSpaceDim(geometry, data);
+} // testSpaceDim
+
+// ----------------------------------------------------------------------
+// Test numCorners()
+void
+pylith::topology::TestGeometryQuad2D::testNumCorners(void)
+{ // testNumCorners
+ GeometryQuad2D geometry;
+ GeomDataQuad2D data;
+ _testNumCorners(geometry, data);
+} // testNumCorners
+
+// ----------------------------------------------------------------------
+// Test geometryLowerDim().
+void
+pylith::topology::TestGeometryQuad2D::testGeomLowerDim(void)
+{ // testGeomLowerDim
+ GeometryQuad2D geometry;
+ CellGeometry* geometryLD = geometry.geometryLowerDim();
+ GeometryLine2D* geometryPt = dynamic_cast<GeometryLine2D*>(geometryLD);
+ CPPUNIT_ASSERT(0 != geometryPt);
+ GeometryPoint2D* geometryPt2 = dynamic_cast<GeometryPoint2D*>(geometryLD);
+ CPPUNIT_ASSERT(0 == geometryPt2);
+ delete geometryLD; geometryLD = 0;
+} // testGeomLowerDim
+
+// ----------------------------------------------------------------------
+// Test jacobian().
+void
+pylith::topology::TestGeometryQuad2D::testJacobian(void)
+{ // testJacobian
+ GeometryQuad2D geometry;
+ GeomDataQuad2D data;
+
+ _testJacobian(&geometry, data);
+} // testJacobian
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryQuad2D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryQuad2D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryQuad2D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/topology/TestGeometryQuad2D.hh
+ *
+ * @brief C++ TestGeometryQuad2D object
+ *
+ * C++ unit testing for TopologyAscii.
+ */
+
+#if !defined(pylith_topology_testgeometryquad2d_hh)
+#define pylith_topology_testgeometryquad2d_hh
+
+#include "TestCellGeometry.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace topology {
+ class TestGeometryQuad2D;
+ class CellGeomData;
+ } // topology
+} // pylith
+
+/// C++ unit testing for Quadrature2D
+class pylith::topology::TestGeometryQuad2D : public TestCellGeometry
+{ // class TestGeometryQuad2D
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestGeometryQuad2D );
+ CPPUNIT_TEST( testConstructor );
+ CPPUNIT_TEST( testCellDim );
+ CPPUNIT_TEST( testSpaceDim );
+ CPPUNIT_TEST( testNumCorners );
+ CPPUNIT_TEST( testGeomLowerDim );
+ CPPUNIT_TEST( testJacobian );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Test constructor
+ void testConstructor(void);
+
+ /// Test cellDim()
+ void testCellDim(void);
+
+ /// Test spaceDim()
+ void testSpaceDim(void);
+
+ /// Test numCorners()
+ void testNumCorners(void);
+
+ /// Test geometryLowerDim().
+ void testGeomLowerDim(void);
+
+ /// Test jacobian().
+ void testJacobian(void);
+
+}; // class TestGeometryQuad2D
+
+#endif // pylith_topology_testgeometryquad2d_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTet3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTet3D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTet3D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestGeometryTet3D.hh" // Implementation of class methods
+
+#include "pylith/topology/GeometryTet3D.hh"
+#include "pylith/topology/GeometryTri3D.hh"
+#include "pylith/topology/GeometryPoint2D.hh"
+
+#include "pylith/utils/array.hh" // USES double_array
+
+#include "data/GeomDataTet3D.hh"
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::topology::TestGeometryTet3D );
+
+// ----------------------------------------------------------------------
+// Test constructor
+void
+pylith::topology::TestGeometryTet3D::testConstructor(void)
+{ // testConstructor
+ GeometryTet3D geometry;
+} // testConstructor
+
+// ----------------------------------------------------------------------
+// Test cellDim()
+void
+pylith::topology::TestGeometryTet3D::testCellDim(void)
+{ // testCellDim
+ GeometryTet3D geometry;
+ GeomDataTet3D data;
+ _testCellDim(geometry, data);
+} // testCellDim
+
+// ----------------------------------------------------------------------
+// Test spaceDim()
+void
+pylith::topology::TestGeometryTet3D::testSpaceDim(void)
+{ // testSpaceDim
+ GeometryTet3D geometry;
+ GeomDataTet3D data;
+ _testSpaceDim(geometry, data);
+} // testSpaceDim
+
+// ----------------------------------------------------------------------
+// Test numCorners()
+void
+pylith::topology::TestGeometryTet3D::testNumCorners(void)
+{ // testNumCorners
+ GeometryTet3D geometry;
+ GeomDataTet3D data;
+ _testNumCorners(geometry, data);
+} // testNumCorners
+
+// ----------------------------------------------------------------------
+// Test geometryLowerDim().
+void
+pylith::topology::TestGeometryTet3D::testGeomLowerDim(void)
+{ // testGeomLowerDim
+ GeometryTet3D geometry;
+ CellGeometry* geometryLD = geometry.geometryLowerDim();
+ GeometryTri3D* geometryPt = dynamic_cast<GeometryTri3D*>(geometryLD);
+ CPPUNIT_ASSERT(0 != geometryPt);
+ GeometryPoint2D* geometryPt2 = dynamic_cast<GeometryPoint2D*>(geometryLD);
+ CPPUNIT_ASSERT(0 == geometryPt2);
+ delete geometryLD; geometryLD = 0;
+} // testGeomLowerDim
+
+// ----------------------------------------------------------------------
+// Test jacobian().
+void
+pylith::topology::TestGeometryTet3D::testJacobian(void)
+{ // testJacobian
+ GeometryTet3D geometry;
+ GeomDataTet3D data;
+
+ _testJacobian(&geometry, data);
+} // testJacobian
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTet3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTet3D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTet3D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/topology/TestGeometryTet3D.hh
+ *
+ * @brief C++ TestGeometryTet3D object
+ *
+ * C++ unit testing for TopologyAscii.
+ */
+
+#if !defined(pylith_topology_testgeometrytet3d_hh)
+#define pylith_topology_testgeometrytet3d_hh
+
+#include "TestCellGeometry.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace topology {
+ class TestGeometryTet3D;
+ class CellGeomData;
+ } // topology
+} // pylith
+
+/// C++ unit testing for Quadrature3D
+class pylith::topology::TestGeometryTet3D : public TestCellGeometry
+{ // class TestGeometryTet3D
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestGeometryTet3D );
+ CPPUNIT_TEST( testConstructor );
+ CPPUNIT_TEST( testCellDim );
+ CPPUNIT_TEST( testSpaceDim );
+ CPPUNIT_TEST( testNumCorners );
+ CPPUNIT_TEST( testGeomLowerDim );
+ CPPUNIT_TEST( testJacobian );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Test constructor
+ void testConstructor(void);
+
+ /// Test cellDim()
+ void testCellDim(void);
+
+ /// Test spaceDim()
+ void testSpaceDim(void);
+
+ /// Test numCorners()
+ void testNumCorners(void);
+
+ /// Test geometryLowerDim().
+ void testGeomLowerDim(void);
+
+ /// Test jacobian().
+ void testJacobian(void);
+
+}; // class TestGeometryTet3D
+
+#endif // pylith_topology_testgeometrytet3d_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri2D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri2D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri2D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestGeometryTri2D.hh" // Implementation of class methods
+
+#include "pylith/topology/GeometryTri2D.hh"
+#include "pylith/topology/GeometryLine2D.hh"
+#include "pylith/topology/GeometryPoint2D.hh"
+
+#include "pylith/utils/array.hh" // USES double_array
+
+#include "data/GeomDataTri2D.hh"
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::topology::TestGeometryTri2D );
+
+// ----------------------------------------------------------------------
+// Test constructor
+void
+pylith::topology::TestGeometryTri2D::testConstructor(void)
+{ // testConstructor
+ GeometryTri2D geometry;
+} // testConstructor
+
+// ----------------------------------------------------------------------
+// Test cellDim()
+void
+pylith::topology::TestGeometryTri2D::testCellDim(void)
+{ // testCellDim
+ GeometryTri2D geometry;
+ GeomDataTri2D data;
+ _testCellDim(geometry, data);
+} // testCellDim
+
+// ----------------------------------------------------------------------
+// Test spaceDim()
+void
+pylith::topology::TestGeometryTri2D::testSpaceDim(void)
+{ // testSpaceDim
+ GeometryTri2D geometry;
+ GeomDataTri2D data;
+ _testSpaceDim(geometry, data);
+} // testSpaceDim
+
+// ----------------------------------------------------------------------
+// Test numCorners()
+void
+pylith::topology::TestGeometryTri2D::testNumCorners(void)
+{ // testNumCorners
+ GeometryTri2D geometry;
+ GeomDataTri2D data;
+ _testNumCorners(geometry, data);
+} // testNumCorners
+
+// ----------------------------------------------------------------------
+// Test geometryLowerDim().
+void
+pylith::topology::TestGeometryTri2D::testGeomLowerDim(void)
+{ // testGeomLowerDim
+ GeometryTri2D geometry;
+ CellGeometry* geometryLD = geometry.geometryLowerDim();
+ GeometryLine2D* geometryPt = dynamic_cast<GeometryLine2D*>(geometryLD);
+ CPPUNIT_ASSERT(0 != geometryPt);
+ GeometryPoint2D* geometryPt2 = dynamic_cast<GeometryPoint2D*>(geometryLD);
+ CPPUNIT_ASSERT(0 == geometryPt2);
+ delete geometryLD; geometryLD = 0;
+} // testGeomLowerDim
+
+// ----------------------------------------------------------------------
+// Test jacobian().
+void
+pylith::topology::TestGeometryTri2D::testJacobian(void)
+{ // testJacobian
+ GeometryTri2D geometry;
+ GeomDataTri2D data;
+
+ _testJacobian(&geometry, data);
+} // testJacobian
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri2D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri2D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri2D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/topology/TestGeometryTri2D.hh
+ *
+ * @brief C++ TestGeometryTri2D object
+ *
+ * C++ unit testing for TopologyAscii.
+ */
+
+#if !defined(pylith_topology_testgeometrytri2d_hh)
+#define pylith_topology_testgeometrytri2d_hh
+
+#include "TestCellGeometry.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace topology {
+ class TestGeometryTri2D;
+ class CellGeomData;
+ } // topology
+} // pylith
+
+/// C++ unit testing for Quadrature2D
+class pylith::topology::TestGeometryTri2D : public TestCellGeometry
+{ // class TestGeometryTri2D
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestGeometryTri2D );
+ CPPUNIT_TEST( testConstructor );
+ CPPUNIT_TEST( testCellDim );
+ CPPUNIT_TEST( testSpaceDim );
+ CPPUNIT_TEST( testNumCorners );
+ CPPUNIT_TEST( testGeomLowerDim );
+ CPPUNIT_TEST( testJacobian );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Test constructor
+ void testConstructor(void);
+
+ /// Test cellDim()
+ void testCellDim(void);
+
+ /// Test spaceDim()
+ void testSpaceDim(void);
+
+ /// Test numCorners()
+ void testNumCorners(void);
+
+ /// Test geometryLowerDim().
+ void testGeomLowerDim(void);
+
+ /// Test jacobian().
+ void testJacobian(void);
+
+}; // class TestGeometryTri2D
+
+#endif // pylith_topology_testgeometrytri2d_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri3D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri3D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestGeometryTri3D.hh" // Implementation of class methods
+
+#include "pylith/topology/GeometryTri3D.hh"
+#include "pylith/topology/GeometryLine3D.hh"
+#include "pylith/topology/GeometryPoint2D.hh"
+
+#include "pylith/utils/array.hh" // USES double_array
+
+#include "data/GeomDataTri3D.hh"
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::topology::TestGeometryTri3D );
+
+// ----------------------------------------------------------------------
+// Test constructor
+void
+pylith::topology::TestGeometryTri3D::testConstructor(void)
+{ // testConstructor
+ GeometryTri3D geometry;
+} // testConstructor
+
+// ----------------------------------------------------------------------
+// Test cellDim()
+void
+pylith::topology::TestGeometryTri3D::testCellDim(void)
+{ // testCellDim
+ GeometryTri3D geometry;
+ GeomDataTri3D data;
+ _testCellDim(geometry, data);
+} // testCellDim
+
+// ----------------------------------------------------------------------
+// Test spaceDim()
+void
+pylith::topology::TestGeometryTri3D::testSpaceDim(void)
+{ // testSpaceDim
+ GeometryTri3D geometry;
+ GeomDataTri3D data;
+ _testSpaceDim(geometry, data);
+} // testSpaceDim
+
+// ----------------------------------------------------------------------
+// Test numCorners()
+void
+pylith::topology::TestGeometryTri3D::testNumCorners(void)
+{ // testNumCorners
+ GeometryTri3D geometry;
+ GeomDataTri3D data;
+ _testNumCorners(geometry, data);
+} // testNumCorners
+
+// ----------------------------------------------------------------------
+// Test geometryLowerDim().
+void
+pylith::topology::TestGeometryTri3D::testGeomLowerDim(void)
+{ // testGeomLowerDim
+ GeometryTri3D geometry;
+ CellGeometry* geometryLD = geometry.geometryLowerDim();
+ GeometryLine3D* geometryPt = dynamic_cast<GeometryLine3D*>(geometryLD);
+ CPPUNIT_ASSERT(0 != geometryPt);
+ GeometryPoint2D* geometryPt2 = dynamic_cast<GeometryPoint2D*>(geometryLD);
+ CPPUNIT_ASSERT(0 == geometryPt2);
+ delete geometryLD; geometryLD = 0;
+} // testGeomLowerDim
+
+// ----------------------------------------------------------------------
+// Test jacobian().
+void
+pylith::topology::TestGeometryTri3D::testJacobian(void)
+{ // testJacobian
+ GeometryTri3D geometry;
+ GeomDataTri3D data;
+
+ _testJacobian(&geometry, data);
+} // testJacobian
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri3D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestGeometryTri3D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/topology/TestGeometryTri3D.hh
+ *
+ * @brief C++ TestGeometryTri3D object
+ *
+ * C++ unit testing for TopologyAscii.
+ */
+
+#if !defined(pylith_topology_testgeometrytri3d_hh)
+#define pylith_topology_testgeometrytri3d_hh
+
+#include "TestCellGeometry.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace topology {
+ class TestGeometryTri3D;
+ class CellGeomData;
+ } // topology
+} // pylith
+
+/// C++ unit testing for Quadrature3D
+class pylith::topology::TestGeometryTri3D : public TestCellGeometry
+{ // class TestGeometryTri3D
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestGeometryTri3D );
+ CPPUNIT_TEST( testConstructor );
+ CPPUNIT_TEST( testCellDim );
+ CPPUNIT_TEST( testSpaceDim );
+ CPPUNIT_TEST( testNumCorners );
+ CPPUNIT_TEST( testGeomLowerDim );
+ CPPUNIT_TEST( testJacobian );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Test constructor
+ void testConstructor(void);
+
+ /// Test cellDim()
+ void testCellDim(void);
+
+ /// Test spaceDim()
+ void testSpaceDim(void);
+
+ /// Test numCorners()
+ void testNumCorners(void);
+
+ /// Test geometryLowerDim().
+ void testGeomLowerDim(void);
+
+ /// Test jacobian().
+ void testJacobian(void);
+
+}; // class TestGeometryTri3D
+
+#endif // pylith_topology_testgeometrytri3d_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataQuad2D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataQuad2D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataQuad2D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "GeomDataQuad2D.hh"
+
+const int pylith::topology::GeomDataQuad2D::_cellDim = 2;
+
+const int pylith::topology::GeomDataQuad2D::_spaceDim = 2;
+
+const int pylith::topology::GeomDataQuad2D::_numCorners = 4;
+
+const int pylith::topology::GeomDataQuad2D::_numLocs = 5;
+
+const double pylith::topology::GeomDataQuad2D::_vertices[] = {
+ 0.3, 0.1,
+ 0.8, -0.2,
+ 0.7, 1.2,
+ -0.1, 1.6
+};
+
+const double pylith::topology::GeomDataQuad2D::_locations[] = {
+ 0.0, 0.0,
+ 1.0, 0.0,
+ 0.0, 1.0,
+ 1.0, 1.0,
+ 0.4, 0.7
+};
+
+const double pylith::topology::GeomDataQuad2D::_jacobian[] = {
+ 0.5, -0.4, -0.3, 1.5,
+ 0.5, -0.1, -0.3, 1.4,
+ 0.8, -0.4, -0.4, 1.5,
+ 0.8, -0.1, -0.4, 1.4,
+ 0.71, -0.28, -0.37, 1.46
+};
+
+pylith::topology::GeomDataQuad2D::GeomDataQuad2D(void)
+{ // constructor
+ cellDim = _cellDim;
+ spaceDim = _spaceDim;
+ numCorners = _numCorners;
+ numLocs = _numLocs;
+ vertices = const_cast<double*>(_vertices);
+ locations = const_cast<double*>(_locations);
+ jacobian = const_cast<double*>(_jacobian);
+} // constructor
+
+pylith::topology::GeomDataQuad2D::~GeomDataQuad2D(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataQuad2D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataQuad2D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataQuad2D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_geomdataquad2d_hh)
+#define pylith_meshio_geomdataquad2d_hh
+
+#include "CellGeomData.hh"
+
+namespace pylith {
+ namespace topology {
+ class GeomDataQuad2D;
+ } // topology
+} // pylith
+
+class pylith::topology::GeomDataQuad2D : public CellGeomData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ GeomDataQuad2D(void);
+
+ /// Destructor
+ ~GeomDataQuad2D(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const int _cellDim; ///< Number of dimensions associated with cell
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _numCorners; ///< Number of vertices in cell
+
+ static const int _numLocs; ///< Number of locations for computing Jacobian
+
+ static const double _vertices[]; ///< Coordinates of cell's vertices
+ static const double _locations[]; ///< Locations to compute Jacobian
+ static const double _jacobian[]; ///< Jacobian at locations
+
+};
+
+#endif // pylith_meshio_geomdataquad2d_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTet3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTet3D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTet3D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "GeomDataTet3D.hh"
+
+const int pylith::topology::GeomDataTet3D::_cellDim = 3;
+
+const int pylith::topology::GeomDataTet3D::_spaceDim = 3;
+
+const int pylith::topology::GeomDataTet3D::_numCorners = 4;
+
+const int pylith::topology::GeomDataTet3D::_numLocs = 2;
+
+const double pylith::topology::GeomDataTet3D::_vertices[] = {
+ -1.3, -0.8, 0.2,
+ 2.1, -0.7, 0.1,
+ -1.0, 2.4, -0.3,
+ -0.1, 0.2, 3.0
+};
+
+const double pylith::topology::GeomDataTet3D::_locations[] = {
+ 0.345, 0.397, 0.319,
+ 0.459, 0.727, 0.693
+};
+
+const double pylith::topology::GeomDataTet3D::_jacobian[] = {
+ 3.4, 0.3, 1.2, 0.1, 3.2, 1.0, -0.1, -0.5, 2.8,
+ 3.4, 0.3, 1.2, 0.1, 3.2, 1.0, -0.1, -0.5, 2.8
+};
+
+pylith::topology::GeomDataTet3D::GeomDataTet3D(void)
+{ // constructor
+ cellDim = _cellDim;
+ spaceDim = _spaceDim;
+ numCorners = _numCorners;
+ numLocs = _numLocs;
+ vertices = const_cast<double*>(_vertices);
+ locations = const_cast<double*>(_locations);
+ jacobian = const_cast<double*>(_jacobian);
+} // constructor
+
+pylith::topology::GeomDataTet3D::~GeomDataTet3D(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTet3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTet3D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTet3D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_geomdatatet3d_hh)
+#define pylith_meshio_geomdatatet3d_hh
+
+#include "CellGeomData.hh"
+
+namespace pylith {
+ namespace topology {
+ class GeomDataTet3D;
+ } // topology
+} // pylith
+
+class pylith::topology::GeomDataTet3D : public CellGeomData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ GeomDataTet3D(void);
+
+ /// Destructor
+ ~GeomDataTet3D(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const int _cellDim; ///< Number of dimensions associated with cell
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _numCorners; ///< Number of vertices in cell
+
+ static const int _numLocs; ///< Number of locations for computing Jacobian
+
+ static const double _vertices[]; ///< Coordinates of cell's vertices
+ static const double _locations[]; ///< Locations to compute Jacobian
+ static const double _jacobian[]; ///< Jacobian at locations
+
+};
+
+#endif // pylith_meshio_geomdatatet3d_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri2D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri2D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri2D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "GeomDataTri2D.hh"
+
+const int pylith::topology::GeomDataTri2D::_cellDim = 2;
+
+const int pylith::topology::GeomDataTri2D::_spaceDim = 2;
+
+const int pylith::topology::GeomDataTri2D::_numCorners = 3;
+
+const int pylith::topology::GeomDataTri2D::_numLocs = 2;
+
+const double pylith::topology::GeomDataTri2D::_vertices[] = {
+ 1.0, 1.2,
+ 3.0, 2.0,
+ 1.5, 4.0
+};
+
+const double pylith::topology::GeomDataTri2D::_locations[] = {
+ 0.345, 0.397,
+ 0.459, 0.727
+};
+
+const double pylith::topology::GeomDataTri2D::_jacobian[] = {
+ 2.0, 0.5, 0.8, 2.8,
+ 2.0, 0.5, 0.8, 2.8
+};
+
+pylith::topology::GeomDataTri2D::GeomDataTri2D(void)
+{ // constructor
+ cellDim = _cellDim;
+ spaceDim = _spaceDim;
+ numCorners = _numCorners;
+ numLocs = _numLocs;
+ vertices = const_cast<double*>(_vertices);
+ locations = const_cast<double*>(_locations);
+ jacobian = const_cast<double*>(_jacobian);
+} // constructor
+
+pylith::topology::GeomDataTri2D::~GeomDataTri2D(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri2D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri2D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri2D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_geomdatatri2d_hh)
+#define pylith_meshio_geomdatatri2d_hh
+
+#include "CellGeomData.hh"
+
+namespace pylith {
+ namespace topology {
+ class GeomDataTri2D;
+ } // topology
+} // pylith
+
+class pylith::topology::GeomDataTri2D : public CellGeomData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ GeomDataTri2D(void);
+
+ /// Destructor
+ ~GeomDataTri2D(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const int _cellDim; ///< Number of dimensions associated with cell
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _numCorners; ///< Number of vertices in cell
+
+ static const int _numLocs; ///< Number of locations for computing Jacobian
+
+ static const double _vertices[]; ///< Coordinates of cell's vertices
+ static const double _locations[]; ///< Locations to compute Jacobian
+ static const double _jacobian[]; ///< Jacobian at locations
+
+};
+
+#endif // pylith_meshio_geomdatatri2d_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri3D.cc 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri3D.cc 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "GeomDataTri3D.hh"
+
+const int pylith::topology::GeomDataTri3D::_cellDim = 2;
+
+const int pylith::topology::GeomDataTri3D::_spaceDim = 3;
+
+const int pylith::topology::GeomDataTri3D::_numCorners = 3;
+
+const int pylith::topology::GeomDataTri3D::_numLocs = 2;
+
+const double pylith::topology::GeomDataTri3D::_vertices[] = {
+ 1.2, 1.3, -0.4,
+ -0.3, -1.7, 0.1,
+ -0.1, 0.4, 1.4
+};
+
+const double pylith::topology::GeomDataTri3D::_locations[] = {
+ 0.345, 0.397,
+ 0.459, 0.727
+};
+
+const double pylith::topology::GeomDataTri3D::_jacobian[] = {
+ -1.5, -1.3, -3.0, -0.9, 0.5, 1.8,
+ -1.5, -1.3, -3.0, -0.9, 0.5, 1.8
+};
+
+pylith::topology::GeomDataTri3D::GeomDataTri3D(void)
+{ // constructor
+ cellDim = _cellDim;
+ spaceDim = _spaceDim;
+ numCorners = _numCorners;
+ numLocs = _numLocs;
+ vertices = const_cast<double*>(_vertices);
+ locations = const_cast<double*>(_locations);
+ jacobian = const_cast<double*>(_jacobian);
+} // constructor
+
+pylith::topology::GeomDataTri3D::~GeomDataTri3D(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri3D.hh 2007-05-13 21:09:53 UTC (rev 6873)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/GeomDataTri3D.hh 2007-05-14 19:22:59 UTC (rev 6874)
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_geomdatatri3d_hh)
+#define pylith_meshio_geomdatatri3d_hh
+
+#include "CellGeomData.hh"
+
+namespace pylith {
+ namespace topology {
+ class GeomDataTri3D;
+ } // topology
+} // pylith
+
+class pylith::topology::GeomDataTri3D : public CellGeomData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ GeomDataTri3D(void);
+
+ /// Destructor
+ ~GeomDataTri3D(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const int _cellDim; ///< Number of dimensions associated with cell
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _numCorners; ///< Number of vertices in cell
+
+ static const int _numLocs; ///< Number of locations for computing Jacobian
+
+ static const double _vertices[]; ///< Coordinates of cell's vertices
+ static const double _locations[]; ///< Locations to compute Jacobian
+ static const double _jacobian[]; ///< Jacobian at locations
+
+};
+
+#endif // pylith_meshio_geomdatatri3d_hh
+
+// End of file
More information about the cig-commits
mailing list