[cig-commits] r15946 - in short/3D/PyLith/branches/pylith-friction: libsrc/feassemble unittests/libtests/feassemble

brad at geodynamics.org brad at geodynamics.org
Mon Nov 9 20:34:50 PST 2009


Author: brad
Date: 2009-11-09 20:34:49 -0800 (Mon, 09 Nov 2009)
New Revision: 15946

Added:
   short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.cc
   short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.hh
Modified:
   short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/IntegratorElasticityLgDeform.cc
   short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/IntegratorElasticityLgDeform.hh
   short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/Makefile.am
Log:
Added unit tests for calcDeformation() and updated calcTotalStrain().

Modified: short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/IntegratorElasticityLgDeform.cc
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/IntegratorElasticityLgDeform.cc	2009-11-10 01:22:38 UTC (rev 15945)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/IntegratorElasticityLgDeform.cc	2009-11-10 04:34:49 UTC (rev 15946)
@@ -684,8 +684,8 @@
       0.5 * (deform[iDeform+1]*deform[iDeform+1] + 
 	     deform[iDeform+3]*deform[iDeform+3] - 1.0);
     (*strain)[iStrain+2] =
-      0.5 * (deform[iDeform  ]*deform[iDeform+2] + 
-	     deform[iDeform+1]*deform[iDeform+3]);
+      0.5 * (deform[iDeform  ]*deform[iDeform+1] + 
+	     deform[iDeform+2]*deform[iDeform+3]);
   } // for
 } // _calcTotalStrain2D
   
@@ -745,7 +745,7 @@
 pylith::feassemble::IntegratorElasticityLgDeform::_calcDeformation(
 					      double_array* deform,
 					      const double_array& basisDeriv,
-					      const double_array& coords,
+					      const double_array& vertices,
 					      const double_array& disp,
 					      const int numBasis,
 					      const int numQuadPts,
@@ -765,7 +765,7 @@
 	for (int jDim=0; jDim < dim; ++jDim, ++indexD)
 	  (*deform)[iQuad*deformSize+indexD] += 
 	    basisDeriv[iQ+iBasis*dim+jDim] *
-	    (coords[iBasis*dim+iDim] + disp[iBasis*dim+iDim]);
+	    (vertices[iBasis*dim+iDim] + disp[iBasis*dim+iDim]);
 } // _calcDeformation
   
 

Modified: short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/IntegratorElasticityLgDeform.hh
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/IntegratorElasticityLgDeform.hh	2009-11-10 01:22:38 UTC (rev 15945)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/feassemble/IntegratorElasticityLgDeform.hh	2009-11-10 04:34:49 UTC (rev 15946)
@@ -164,7 +164,7 @@
    *
    * @param deform Deformation tensor for cell at quadrature points.
    * @param basisDeriv Derivatives of basis functions at quadrature points.
-   * @param coords Coordinates of DOF of cell.
+   * @param vertices Coordinates of vertices in reference cell.
    * @param disp Displacements of DOF of cell.
    * @param numBasis Number of basis functions for cell.
    * @param numQuadPts Number of quadrature points.
@@ -173,7 +173,7 @@
   static
   void _calcDeformation(double_array* deform,
 			const double_array& basisDeriv,
-			const double_array& coords,
+			const double_array& vertices,
 			const double_array& disp,
 			const int numBasis,
 			const int numQuadPts,

Modified: short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/Makefile.am	2009-11-10 01:22:38 UTC (rev 15945)
+++ short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/Makefile.am	2009-11-10 04:34:49 UTC (rev 15946)
@@ -66,6 +66,7 @@
 	TestElasticityImplicitGrav2DQuadratic.cc \
 	TestElasticityImplicitGrav3DLinear.cc \
 	TestElasticityImplicitGrav3DQuadratic.cc \
+	TestIntegratorElasticityLgDeform.cc \
 	test_feassemble.cc
 
 

Added: short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.cc
===================================================================
--- short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.cc	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.cc	2009-11-10 04:34:49 UTC (rev 15946)
@@ -0,0 +1,436 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestIntegratorElasticityLgDeform.hh" // Implementation of class methods
+
+#include "pylith/feassemble/IntegratorElasticityLgDeform.hh" // USES IntegratorElasticityLgDeform
+
+#include <math.h> // USES fabs()
+
+#include <stdexcept>
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::feassemble::TestIntegratorElasticityLgDeform );
+
+// ----------------------------------------------------------------------
+// Test calcDeformation() for 1-D.
+void
+pylith::feassemble::TestIntegratorElasticityLgDeform::testCalcDeformation1D(void)
+{ // testCalcDeformation1D
+  // N0 = 0.5 * (1 - x)
+  // N1 = 0.5 * (1 + x)
+  // dN0/dx = -0.5
+  // dN1/dx = +0.5
+  const int dim = 1;
+  const int numBasis = 2;
+  const int numQuadPts = 2;
+  const double verticesVals[] = { -1.0, 1.0 };
+  const double basisDerivVals[] = {
+    -0.50, 0.50,
+    -0.50, 0.50 };
+  const int tensorSize = 1;
+
+  const int size = numQuadPts * dim*dim;
+  double_array deform(size);    
+  double_array basisDeriv(basisDerivVals, numQuadPts*numBasis*dim);
+  double_array vertices(verticesVals, numBasis*dim);
+
+  const double tolerance = 1.0e-06;
+
+  { // Rigid body translation
+    // u(x) = 1.0
+    const double dispVals[] = { 1.0, 1.0 };
+    const double deformE[] = { 1.0, 1.0 };
+    
+    double_array disp(dispVals, numBasis*dim);
+    
+    IntegratorElasticityLgDeform::_calcDeformation(&deform,
+						   basisDeriv, vertices, disp,
+						   numBasis, numQuadPts, dim);
+    
+    CPPUNIT_ASSERT_EQUAL(size, int(deform.size()));
+    for (int i=0; i < size; ++i)
+      CPPUNIT_ASSERT_DOUBLES_EQUAL(deformE[i], deform[i], tolerance);
+  } // Rigid body translation
+
+  { // Uniform strain
+    // u(x) = 0.1*x
+    const double dispVals[] = { -0.1, 0.1 };
+    const double deformE[] = { 1.1, 1.1 };
+    
+    double_array disp(dispVals, numBasis*dim);
+    
+    IntegratorElasticityLgDeform::_calcDeformation(&deform,
+						   basisDeriv, vertices, disp,
+						   numBasis, numQuadPts, dim);
+    
+    CPPUNIT_ASSERT_EQUAL(size, int(deform.size()));
+    for (int i=0; i < size; ++i)
+      CPPUNIT_ASSERT_DOUBLES_EQUAL(deformE[i], deform[i], tolerance);
+  } // Uniform strain
+} // testCalcDeformation1D
+
+// ----------------------------------------------------------------------
+// Test calcDeformation() for 2-D.
+void
+pylith::feassemble::TestIntegratorElasticityLgDeform::testCalcDeformation2D(void)
+{ // testCalcDeformation2D
+  // N0 = x
+  // N1 = y
+  // N2 = 1 - x - y
+  // dN0/dx = +1.0, dN0/dy =  0.0
+  // dN1/dx =  0.0, dN1/dy = +1.0
+  // dN2/dx = -1.0, dN2/dy = -1.0
+  const int dim = 2;
+  const int numBasis = 3;
+  const int numQuadPts = 2;
+  const double verticesVals[] = {
+    1.0, 0.0,
+    0.0, 1.0, 
+    0.0, 0.0,
+  };
+  const double basisDerivVals[] = {
+    +1.0,  0.0,   0.0, +1.0,   -1.0, -1.0,
+    +1.0,  0.0,   0.0, +1.0,   -1.0, -1.0
+  };
+  const int tensorSize = 3;
+
+  const int size = numQuadPts * dim*dim;
+  double_array deform(size);    
+  double_array basisDeriv(basisDerivVals, numQuadPts*numBasis*dim);
+  double_array vertices(verticesVals, numBasis*dim);
+
+  const double tolerance = 1.0e-06;
+
+  { // Rigid body translation
+    // ux(x,y) = 0.5
+    // uy(x,y) = 0.2
+    const double dispVals[] = {
+      0.5, 0.2,
+      0.5, 0.2,
+      0.5, 0.2,
+    };
+    const double deformE[] = {
+      1.0, 0.0,   0.0, 1.0,
+      1.0, 0.0,   0.0, 1.0,
+    };
+    
+    double_array disp(dispVals, numBasis*dim);
+    
+    IntegratorElasticityLgDeform::_calcDeformation(&deform,
+						   basisDeriv, vertices, disp,
+						   numBasis, numQuadPts, dim);
+    
+    CPPUNIT_ASSERT_EQUAL(size, int(deform.size()));
+    for (int i=0; i < size; ++i)
+      CPPUNIT_ASSERT_DOUBLES_EQUAL(deformE[i], deform[i], tolerance);
+  } // Rigid body translation
+
+  { // Rigid body translation + rotation
+    // ux(x,y) = 0.5 + cos(theta)*x + sin(theta)*y - x0
+    // uy(x,y) = 0.2 - sin(theta)*x + cos(theta)*y - y0
+    // theta = pi/6
+    const double pi = 4.0*atan(1.0);
+    const double theta = pi / 6.0;
+    const double dispVals[] = {
+      0.5+cos(theta)*1.0+sin(theta)*0.0-1.0,
+      0.2-sin(theta)*1.0+cos(theta)*0.0-0.0,
+
+      0.5+cos(theta)*0.0+sin(theta)*1.0-0.0,
+      0.2-sin(theta)*0.0+cos(theta)*1.0-1.0,
+
+      0.5+cos(theta)*0.0+sin(theta)*0.0-0.0,
+      0.2-sin(theta)*0.0+cos(theta)*0.0-0.0,
+    };
+    const double deformE[] = {
+      cos(theta), sin(theta), -sin(theta), cos(theta),
+      cos(theta), sin(theta), -sin(theta), cos(theta),
+    };
+    
+    double_array disp(dispVals, numBasis*dim);
+    
+    IntegratorElasticityLgDeform::_calcDeformation(&deform,
+						   basisDeriv, vertices, disp,
+						   numBasis, numQuadPts, dim);
+    
+    CPPUNIT_ASSERT_EQUAL(size, int(deform.size()));
+    for (int i=0; i < size; ++i)
+      CPPUNIT_ASSERT_DOUBLES_EQUAL(deformE[i], deform[i], tolerance);
+  } // Rigid body translation + rotation
+
+  { // Uniform strain
+    // Let ux(x,y) = +0.4 + 0.3*x + 0.8*y
+    // Ley uy(x,y) = -2.0 + 0.5*x - 0.2*y
+    const double dispVals[] = {
+      0.7, -1.5,
+      1.2, -2.2,
+      0.4, -2.0
+    };
+    const double deformE[] = {
+      1.3, 0.8,   0.5, 0.8,
+      1.3, 0.8,   0.5, 0.8,
+    };
+    
+    double_array disp(dispVals, numBasis*dim);
+    
+    IntegratorElasticityLgDeform::_calcDeformation(&deform,
+						   basisDeriv, vertices, disp,
+						   numBasis, numQuadPts, dim);
+    
+    CPPUNIT_ASSERT_EQUAL(size, int(deform.size()));
+    for (int i=0; i < size; ++i)
+      CPPUNIT_ASSERT_DOUBLES_EQUAL(deformE[i], deform[i], tolerance);
+  } // Uniform strain
+} // testCalcDeformation2D
+
+// ----------------------------------------------------------------------
+// Test calcDeformation() for 3-D.
+void
+pylith::feassemble::TestIntegratorElasticityLgDeform::testCalcDeformation3D(void)
+{ // testCalcDeformation3D
+  // N0 = 0.125 * (1-x) * (1-y) * (1-z)
+  // N1 = 0.125 * (1+x) * (1-y) * (1-z)
+  // N2 = 0.125 * (1+x) * (1+y) * (1-z)
+  // N3 = 0.125 * (1-x) * (1+y) * (1-z)
+  // N4 = 0.125 * (1-x) * (1-y) * (1+z)
+  // N5 = 0.125 * (1+x) * (1-y) * (1+z)
+  // N6 = 0.125 * (1+x) * (1+y) * (1+z)
+  // N7 = 0.125 * (1-x) * (1+y) * (1+z)
+  // dN0/dx=-0.125, dN0/dy=-0.125, dN0/dz=-0.125
+  // dN1/dx=+0.125, dN1/dy=-0.125, dN1/dz=-0.125
+  // dN2/dx=+0.125, dN2/dy=+0.125, dN2/dz=-0.125
+  // dN3/dx=-0.125, dN3/dy=+0.125, dN3/dz=-0.125
+  // dN4/dx=-0.125, dN0/dy=-0.125, dN0/dz=+0.125
+  // dN5/dx=+0.125, dN1/dy=-0.125, dN1/dz=+0.125
+  // dN6/dx=+0.125, dN2/dy=+0.125, dN2/dz=+0.125
+  // dN7/dx=-0.125, dN3/dy=+0.125, dN3/dz=+0.125
+  const int dim = 3;
+  const int numBasis = 8;
+  const int numQuadPts = 1;
+  const double verticesVals[] = {
+    -1.0, -1.0, -1.0,
+    +1.0, -1.0, -1.0,
+    +1.0, +1.0, -1.0,
+    -1.0, +1.0, -1.0,
+    -1.0, -1.0, +1.0,
+    +1.0, -1.0, +1.0,
+    +1.0, +1.0, +1.0,
+    -1.0, +1.0, +1.0,
+  };
+  const double basisDerivVals[] = {
+    -0.125, -0.125, -0.125,
+    +0.125, -0.125, -0.125,
+    +0.125, +0.125, -0.125,
+    -0.125, +0.125, -0.125,
+    -0.125, -0.125, +0.125,
+    +0.125, -0.125, +0.125,
+    +0.125, +0.125, +0.125,
+    -0.125, +0.125, +0.125,
+  };
+  const int tensorSize = 3;
+
+  const int size = numQuadPts * dim*dim;
+  double_array deform(size);    
+  double_array basisDeriv(basisDerivVals, numQuadPts*numBasis*dim);
+  double_array vertices(verticesVals, numBasis*dim);
+
+  const double tolerance = 1.0e-06;
+
+  { // Rigid body translation
+    // ux(x,y,z) = 0.5
+    // uy(x,y,z) = 0.2
+    // uz(x,y,z) = 0.3
+    const double dispVals[] = {
+      0.5, 0.2, 0.3,
+      0.5, 0.2, 0.3,
+      0.5, 0.2, 0.3,
+      0.5, 0.2, 0.3,
+      0.5, 0.2, 0.3,
+      0.5, 0.2, 0.3,
+      0.5, 0.2, 0.3,
+      0.5, 0.2, 0.3,
+    };
+    const double deformE[] = {
+      1.0, 0.0, 0.0,   0.0, 1.0, 0.0,  0.0, 0.0, 1.0,
+      1.0, 0.0, 0.0,   0.0, 1.0, 0.0,  0.0, 0.0, 1.0,
+    };
+    
+    double_array disp(dispVals, numBasis*dim);
+    
+    IntegratorElasticityLgDeform::_calcDeformation(&deform,
+						   basisDeriv, vertices, disp,
+						   numBasis, numQuadPts, dim);
+    
+    CPPUNIT_ASSERT_EQUAL(size, int(deform.size()));
+    for (int i=0; i < size; ++i)
+      CPPUNIT_ASSERT_DOUBLES_EQUAL(deformE[i], deform[i], tolerance);
+  } // Rigid body translation
+
+  { // Uniform strain
+    // Let ux(x,y,z) = +0.4 + 0.3*x + 0.8*y - 0.2*z
+    // Ley uy(x,y,z) = -2.0 + 0.5*x - 0.2*y + 0.6*z
+    // Ley uz(x,y,z) = +0.7 + 0.8*x - 0.9*y - 0.1*z
+    const double dispVals[] = {
+      +0.4+0.3*-1+0.8*-1-0.2*-1,
+      -2.0+0.5*-1-0.2*-1+0.6*-1,
+      +0.7+0.8*-1-0.9*-1-0.1*-1,
+
+      +0.4+0.3*+1+0.8*-1-0.2*-1,
+      -2.0+0.5*+1-0.2*-1+0.6*-1,
+      +0.7+0.8*+1-0.9*-1-0.1*-1,
+
+      +0.4+0.3*+1+0.8*+1-0.2*-1,
+      -2.0+0.5*+1-0.2*+1+0.6*-1,
+      +0.7+0.8*+1-0.9*+1-0.1*-1,
+
+      +0.4+0.3*-1+0.8*+1-0.2*-1,
+      -2.0+0.5*-1-0.2*+1+0.6*-1,
+      +0.7+0.8*-1-0.9*+1-0.1*-1,
+
+      +0.4+0.3*-1+0.8*-1-0.2*+1,
+      -2.0+0.5*-1-0.2*-1+0.6*+1,
+      +0.7+0.8*-1-0.9*-1-0.1*+1,
+
+      +0.4+0.3*+1+0.8*-1-0.2*+1,
+      -2.0+0.5*+1-0.2*-1+0.6*+1,
+      +0.7+0.8*+1-0.9*-1-0.1*+1,
+
+      +0.4+0.3*+1+0.8*+1-0.2*+1,
+      -2.0+0.5*+1-0.2*+1+0.6*+1,
+      +0.7+0.8*+1-0.9*+1-0.1*+1,
+
+      +0.4+0.3*-1+0.8*+1-0.2*+1,
+      -2.0+0.5*-1-0.2*+1+0.6*+1,
+      +0.7+0.8*-1-0.9*+1-0.1*+1,
+
+    };
+    const double deformE[] = {
+      1.3, 0.8, -0.2,
+      0.5, 0.8, 0.6,
+      0.8, -0.9, 0.9,
+    };
+    
+    double_array disp(dispVals, numBasis*dim);
+    
+    IntegratorElasticityLgDeform::_calcDeformation(&deform,
+						   basisDeriv, vertices, disp,
+						   numBasis, numQuadPts, dim);
+    
+    CPPUNIT_ASSERT_EQUAL(size, int(deform.size()));
+    for (int i=0; i < size; ++i)
+      CPPUNIT_ASSERT_DOUBLES_EQUAL(deformE[i], deform[i], tolerance);
+  } // Uniform strain
+} // testCalcDeformation3D
+
+// ----------------------------------------------------------------------
+// Test calcTotalStrain1D().
+void
+pylith::feassemble::TestIntegratorElasticityLgDeform::testCalcTotalStrain1D(void)
+{ // testCalcTotalStrain1D
+  // Deformation tensor X
+  // X = [ 2.0 ], [ 0.4 ]
+  const int dim = 1;
+  const int numQuadPts = 2;
+  const double deformVals[] = {
+    2.0,  0.4,
+  };
+  const double strainE[] = {
+    0.5*(2.0*2.0-1.0),  0.5*(0.4*0.4-1.0),
+  };
+  const int tensorSize = 1;
+
+  const int size = numQuadPts * tensorSize;
+  double_array strain(size);
+
+  double_array deform(deformVals, numQuadPts*dim*dim);
+
+  IntegratorElasticityLgDeform::_calcTotalStrain1D(&strain,
+						   deform, numQuadPts);
+
+  const double tolerance = 1.0e-06;
+  CPPUNIT_ASSERT_EQUAL(size, int(strain.size()));
+  for (int i=0; i < size; ++i)
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(strainE[i], strain[i], tolerance);
+} // testCalcTotalStrain1D
+
+// ----------------------------------------------------------------------
+// Test calcTotalStrain2D().
+void
+pylith::feassemble::TestIntegratorElasticityLgDeform::testCalcTotalStrain2D(void)
+{ // testCalcTotalStrain2D
+  // Deformation tensor X
+  // X = [ 2.0, 0.4 ]    [  1.5, 0.2 ]
+  //     [ 0.6, 1.4 ],   [ -0.9, 0.8 ]
+  const int dim = 2;
+  const int numQuadPts = 2;
+  const double deformVals[] = {
+    2.0,  0.4, 0.6, 1.4,
+    1.5, 0.2, -0.9, 0.8,
+  };
+  const double strainE[] = {
+    1.68, 0.56, 0.82,
+    1.03, -0.16, -0.21,
+  };
+  const int tensorSize = 3;
+
+  const int size = numQuadPts * tensorSize;
+  double_array strain(size);
+
+  double_array deform(deformVals, numQuadPts*dim*dim);
+
+  IntegratorElasticityLgDeform::_calcTotalStrain2D(&strain,
+						   deform, numQuadPts);
+
+  const double tolerance = 1.0e-06;
+  CPPUNIT_ASSERT_EQUAL(size, int(strain.size()));
+  for (int i=0; i < size; ++i)
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(strainE[i], strain[i], tolerance);
+} // testCalcTotalStrain2D
+
+// ----------------------------------------------------------------------
+// Test calcTotalStrain3D().
+void
+pylith::feassemble::TestIntegratorElasticityLgDeform::testCalcTotalStrain3D(void)
+{ // testCalcTotalStrain3D
+  // Deformation tensor X
+  // X = [  2.0, 0.4,  0.3 ]    [  1.5, 0.2, -0.1 ]
+  //     [  0.6, 1.4, -0.8 ]    [ -0.9, 0.8,  0.3 ]
+  //     [ -0.1, 0.6,  1.0 ],   [ -0.8, 0.5,  1.2 ]
+  const int dim = 3;
+  const int numQuadPts = 2;
+  const double deformVals[] = {
+    2.0,  0.4, 0.3,  0.6, 1.4, -0.8,  -0.1, 0.6, 1.0,
+    1.5, 0.2, -0.1,  -0.9, 0.8, 0.3,  -0.8, 0.5, 1.2,
+  };
+  const double strainE[] = {
+    1.685, 0.74, 0.365, 0.79, -0.2, 0.01,
+    1.35, -0.035, 0.27, -0.41, 0.41, -0.69,
+  };
+  const int tensorSize = 6;
+
+  const int size = numQuadPts * tensorSize;
+  double_array strain(size);
+
+  double_array deform(deformVals, numQuadPts*dim*dim);
+
+  IntegratorElasticityLgDeform::_calcTotalStrain3D(&strain,
+						   deform, numQuadPts);
+
+  const double tolerance = 1.0e-06;
+  CPPUNIT_ASSERT_EQUAL(size, int(strain.size()));
+  for (int i=0; i < size; ++i)
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(strainE[i], strain[i], tolerance);
+} // testCalcTotalStrain3D
+
+
+// End of file 

Added: short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.hh
===================================================================
--- short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.hh	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-friction/unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.hh	2009-11-10 04:34:49 UTC (rev 15946)
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/feassemble/TestIntegratorElasticityLgDeform.hh
+ *
+ * @brief C++ TestIntegratorElasticityLgDeform object
+ *
+ * C++ unit testing for IntegratorElasticityLgDeform.
+ */
+
+#if !defined(pylith_feassemble_testintegratorelasticitylgdeform_hh)
+#define pylith_feassemble_testintegratorelasticitylgdeform_hh
+
+#include <cppunit/extensions/HelperMacros.h>
+
+/// Namespace for pylith package
+namespace pylith {
+  namespace feassemble {
+    class TestIntegratorElasticityLgDeform;
+  } // feassemble
+} // pylith
+
+/// C++ unit testing for Elasticity
+class pylith::feassemble::TestIntegratorElasticityLgDeform : public CppUnit::TestFixture
+{ // class TestIntegratorElasticityLgDeform
+
+  // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+  CPPUNIT_TEST_SUITE( TestIntegratorElasticityLgDeform );
+
+  CPPUNIT_TEST( testCalcDeformation1D );
+  CPPUNIT_TEST( testCalcDeformation2D );
+  CPPUNIT_TEST( testCalcDeformation3D );
+  CPPUNIT_TEST( testCalcTotalStrain1D );
+  CPPUNIT_TEST( testCalcTotalStrain2D );
+  CPPUNIT_TEST( testCalcTotalStrain3D );
+
+  CPPUNIT_TEST_SUITE_END();
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Test calcDeformation() for 1-D.
+  void testCalcDeformation1D(void);
+
+  /// Test calcDeformation() for 2-D.
+  void testCalcDeformation2D(void);
+
+  /// Test calcDeformation() for 3-D.
+  void testCalcDeformation3D(void);
+
+  /// Test calcTotalStrain1D().
+  void testCalcTotalStrain1D(void);
+
+  /// Test calcTotalStrain2D().
+  void testCalcTotalStrain2D(void);
+
+  /// Test calcTotalStrain3D().
+  void testCalcTotalStrain3D(void);
+
+}; // class TestIntegratorElasticityLgDeform
+
+#endif // pylith_feassemble_testintegratorelasticitylgdeform_hh
+
+
+// End of file 



More information about the CIG-COMMITS mailing list