[cig-commits] r15191 - in short/3D/PyLith/trunk: . libsrc/materials modulesrc/materials unittests/libtests/materials unittests/pytests/materials
brad at geodynamics.org
brad at geodynamics.org
Wed Jun 10 17:40:57 PDT 2009
Author: brad
Date: 2009-06-10 17:40:55 -0700 (Wed, 10 Jun 2009)
New Revision: 15191
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.hh
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.hh
short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.hh
short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.hh
short/3D/PyLith/trunk/modulesrc/materials/ElasticIsotropic3D.i
short/3D/PyLith/trunk/modulesrc/materials/ElasticPlaneStrain.i
short/3D/PyLith/trunk/modulesrc/materials/ElasticPlaneStress.i
short/3D/PyLith/trunk/modulesrc/materials/ElasticStrain1D.i
short/3D/PyLith/trunk/modulesrc/materials/ElasticStress1D.i
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.hh
short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticIsotropic3D.py
short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticPlaneStrain.py
short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticPlaneStress.py
short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticStrain1D.py
short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticStress1D.py
Log:
Add optimized stableTimeStepImplicit() [return MAXDOUBLE, no looping over cells].
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/TODO 2009-06-11 00:40:55 UTC (rev 15191)
@@ -44,15 +44,10 @@
1. Tidy up
- Add simple stableTimeStep() for elastic materials.
-
Switch Components to PetscComponents.
Add _cleanup() to components to deallocate local data structures.
Add cleanup() to non-components to deallocate local data structures.
- Add check before calling newSection() when want to enforce at
- least 1 value.
-
2. Add missing unit tests
libtests/topology/TestMesh::testNondimensionalize()
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -323,6 +323,14 @@
// ----------------------------------------------------------------------
// Get stable time step for implicit time integration.
double
+pylith::materials::ElasticIsotropic3D::stableTimeStepImplicit(
+ const topology::Mesh& mesh) {
+ return pylith::PYLITH_MAXDOUBLE;
+}
+
+// ----------------------------------------------------------------------
+// Get stable time step for implicit time integration.
+double
pylith::materials::ElasticIsotropic3D::_stableTimeStepImplicit(
const double* properties,
const int numProperties,
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -47,6 +47,15 @@
/// Destructor
~ElasticIsotropic3D(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -302,6 +302,14 @@
// ----------------------------------------------------------------------
// Get stable time step for implicit time integration.
double
+pylith::materials::ElasticPlaneStrain::stableTimeStepImplicit(
+ const topology::Mesh& mesh) {
+ return pylith::PYLITH_MAXDOUBLE;
+}
+
+// ----------------------------------------------------------------------
+// Get stable time step for implicit time integration.
+double
pylith::materials::ElasticPlaneStrain::_stableTimeStepImplicit(
const double* properties,
const int numProperties,
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -47,6 +47,15 @@
/// Destructor
~ElasticPlaneStrain(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -305,6 +305,14 @@
// ----------------------------------------------------------------------
// Get stable time step for implicit time integration.
double
+pylith::materials::ElasticPlaneStress::stableTimeStepImplicit(
+ const topology::Mesh& mesh) {
+ return pylith::PYLITH_MAXDOUBLE;
+}
+
+// ----------------------------------------------------------------------
+// Get stable time step for implicit time integration.
+double
pylith::materials::ElasticPlaneStress::_stableTimeStepImplicit(
const double* properties,
const int numProperties,
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -47,6 +47,15 @@
/// Destructor
~ElasticPlaneStress(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -285,6 +285,14 @@
// ----------------------------------------------------------------------
// Get stable time step for implicit time integration.
double
+pylith::materials::ElasticStrain1D::stableTimeStepImplicit(
+ const topology::Mesh& mesh) {
+ return pylith::PYLITH_MAXDOUBLE;
+}
+
+// ----------------------------------------------------------------------
+// Get stable time step for implicit time integration.
+double
pylith::materials::ElasticStrain1D::_stableTimeStepImplicit(
const double* properties,
const int numProperties,
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -46,6 +46,15 @@
/// Destructor
~ElasticStrain1D(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -285,6 +285,14 @@
// ----------------------------------------------------------------------
// Get stable time step for implicit time integration.
double
+pylith::materials::ElasticStress1D::stableTimeStepImplicit(
+ const topology::Mesh& mesh) {
+ return pylith::PYLITH_MAXDOUBLE;
+}
+
+// ----------------------------------------------------------------------
+// Get stable time step for implicit time integration.
+double
pylith::materials::ElasticStress1D::_stableTimeStepImplicit(
const double* properties,
const int numProperties,
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -48,6 +48,15 @@
/// Destructor
~ElasticStress1D(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/modulesrc/materials/ElasticIsotropic3D.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/ElasticIsotropic3D.i 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/modulesrc/materials/ElasticIsotropic3D.i 2009-06-11 00:40:55 UTC (rev 15191)
@@ -30,6 +30,16 @@
/// Destructor
~ElasticIsotropic3D(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined
+ * in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const pylith::topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/modulesrc/materials/ElasticPlaneStrain.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/ElasticPlaneStrain.i 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/modulesrc/materials/ElasticPlaneStrain.i 2009-06-11 00:40:55 UTC (rev 15191)
@@ -30,6 +30,16 @@
/// Destructor
~ElasticPlaneStrain(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined
+ * in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const pylith::topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/modulesrc/materials/ElasticPlaneStress.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/ElasticPlaneStress.i 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/modulesrc/materials/ElasticPlaneStress.i 2009-06-11 00:40:55 UTC (rev 15191)
@@ -30,6 +30,16 @@
/// Destructor
~ElasticPlaneStress(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined
+ * in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const pylith::topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/modulesrc/materials/ElasticStrain1D.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/ElasticStrain1D.i 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/modulesrc/materials/ElasticStrain1D.i 2009-06-11 00:40:55 UTC (rev 15191)
@@ -30,6 +30,16 @@
/// Destructor
~ElasticStrain1D(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined
+ * in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const pylith::topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/modulesrc/materials/ElasticStress1D.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/ElasticStress1D.i 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/modulesrc/materials/ElasticStress1D.i 2009-06-11 00:40:55 UTC (rev 15191)
@@ -30,6 +30,16 @@
/// Destructor
~ElasticStress1D(void);
+ /** Get stable time step for implicit time integration.
+ *
+ * Default is MAXDOUBLE (or 1.0e+30 if MAXFLOAT is not defined
+ * in math.h).
+ *
+ * @param mesh Finite-element mesh.
+ * @returns Time step
+ */
+ double stableTimeStepImplicit(const pylith::topology::Mesh& mesh);
+
// PROTECTED METHODS //////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -18,6 +18,9 @@
#include "pylith/materials/ElasticIsotropic3D.hh" // USES ElasticIsotropic3D
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/topology/Mesh.hh" // USES Mesh
+
// ----------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::materials::TestElasticIsotropic3D );
@@ -33,5 +36,18 @@
setupNormalizer();
} // setUp
+// ----------------------------------------------------------------------
+// Test stableTimeStepImplicit().
+void
+pylith::materials::TestElasticIsotropic3D::testStableTimeStepImplicit(void)
+{ // testStableTimeStepImplicit
+ assert(0 != _matElastic);
+ topology::Mesh mesh;
+
+ const double dt = _matElastic->stableTimeStepImplicit(mesh);
+ CPPUNIT_ASSERT_EQUAL(1.0, dt/pylith::PYLITH_MAXDOUBLE);
+} // testStableTimeStepImplicit
+
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( testDBToStateVars );
CPPUNIT_TEST( testNonDimStateVars );
CPPUNIT_TEST( testDimStateVars );
+ CPPUNIT_TEST( testStableTimeStepImplicit );
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
@@ -59,6 +60,9 @@
/// Setup testing data.
void setUp(void);
+ /// Test stableTimeStepImplicit().
+ void testStableTimeStepImplicit(void);
+
}; // class TestElasticIsotropic3D
#endif // pylith_materials_testelasticisotropic3d_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -18,6 +18,9 @@
#include "pylith/materials/ElasticPlaneStrain.hh" // USES ElasticPlaneStrain
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/topology/Mesh.hh" // USES Mesh
+
// ----------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::materials::TestElasticPlaneStrain );
@@ -33,5 +36,18 @@
setupNormalizer();
} // setUp
+// ----------------------------------------------------------------------
+// Test stableTimeStepImplicit().
+void
+pylith::materials::TestElasticPlaneStrain::testStableTimeStepImplicit(void)
+{ // testStableTimeStepImplicit
+ assert(0 != _matElastic);
+ topology::Mesh mesh;
+
+ const double dt = _matElastic->stableTimeStepImplicit(mesh);
+ CPPUNIT_ASSERT_EQUAL(1.0, dt/pylith::PYLITH_MAXDOUBLE);
+} // testStableTimeStepImplicit
+
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( testDBToStateVars );
CPPUNIT_TEST( testNonDimStateVars );
CPPUNIT_TEST( testDimStateVars );
+ CPPUNIT_TEST( testStableTimeStepImplicit );
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
@@ -59,6 +60,9 @@
/// Setup testing data.
void setUp(void);
+ /// Test stableTimeStepImplicit().
+ void testStableTimeStepImplicit(void);
+
}; // class TestElasticPlaneStrain
#endif // pylith_materials_testelasticplanestrain_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -18,6 +18,9 @@
#include "pylith/materials/ElasticPlaneStress.hh" // USES ElasticPlaneStress
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/topology/Mesh.hh" // USES Mesh
+
// ----------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::materials::TestElasticPlaneStress );
@@ -33,5 +36,18 @@
setupNormalizer();
} // setUp
+// ----------------------------------------------------------------------
+// Test stableTimeStepImplicit().
+void
+pylith::materials::TestElasticPlaneStress::testStableTimeStepImplicit(void)
+{ // testStableTimeStepImplicit
+ assert(0 != _matElastic);
+ topology::Mesh mesh;
+
+ const double dt = _matElastic->stableTimeStepImplicit(mesh);
+ CPPUNIT_ASSERT_EQUAL(1.0, dt/pylith::PYLITH_MAXDOUBLE);
+} // testStableTimeStepImplicit
+
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( testDBToStateVars );
CPPUNIT_TEST( testNonDimStateVars );
CPPUNIT_TEST( testDimStateVars );
+ CPPUNIT_TEST( testStableTimeStepImplicit );
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
@@ -59,6 +60,9 @@
/// Setup testing data.
void setUp(void);
+ /// Test stableTimeStepImplicit().
+ void testStableTimeStepImplicit(void);
+
}; // class TestElasticPlaneStress
#endif // pylith_materials_testelasticplanestress_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -18,6 +18,9 @@
#include "pylith/materials/ElasticStrain1D.hh" // USES ElasticStrain1D
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/topology/Mesh.hh" // USES Mesh
+
// ----------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::materials::TestElasticStrain1D );
@@ -33,5 +36,18 @@
setupNormalizer();
} // setUp
+// ----------------------------------------------------------------------
+// Test stableTimeStepImplicit().
+void
+pylith::materials::TestElasticStrain1D::testStableTimeStepImplicit(void)
+{ // testStableTimeStepImplicit
+ assert(0 != _matElastic);
+ topology::Mesh mesh;
+
+ const double dt = _matElastic->stableTimeStepImplicit(mesh);
+ CPPUNIT_ASSERT_EQUAL(1.0, dt/pylith::PYLITH_MAXDOUBLE);
+} // testStableTimeStepImplicit
+
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( testDBToStateVars );
CPPUNIT_TEST( testNonDimStateVars );
CPPUNIT_TEST( testDimStateVars );
+ CPPUNIT_TEST( testStableTimeStepImplicit );
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
@@ -59,6 +60,9 @@
/// Setup testing data.
void setUp(void);
+ /// Test stableTimeStepImplicit().
+ void testStableTimeStepImplicit(void);
+
}; // class TestElasticStrain1D
#endif // pylith_materials_testelasticstrain1d_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.cc 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.cc 2009-06-11 00:40:55 UTC (rev 15191)
@@ -18,6 +18,9 @@
#include "pylith/materials/ElasticStress1D.hh" // USES ElasticStress1D
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/topology/Mesh.hh" // USES Mesh
+
// ----------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::materials::TestElasticStress1D );
@@ -33,5 +36,18 @@
setupNormalizer();
} // setUp
+// ----------------------------------------------------------------------
+// Test stableTimeStepImplicit().
+void
+pylith::materials::TestElasticStress1D::testStableTimeStepImplicit(void)
+{ // testStableTimeStepImplicit
+ assert(0 != _matElastic);
+ topology::Mesh mesh;
+
+ const double dt = _matElastic->stableTimeStepImplicit(mesh);
+ CPPUNIT_ASSERT_EQUAL(1.0, dt/pylith::PYLITH_MAXDOUBLE);
+} // testStableTimeStepImplicit
+
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.hh 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.hh 2009-06-11 00:40:55 UTC (rev 15191)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( testDBToStateVars );
CPPUNIT_TEST( testNonDimStateVars );
CPPUNIT_TEST( testDimStateVars );
+ CPPUNIT_TEST( testStableTimeStepImplicit );
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
@@ -59,6 +60,9 @@
/// Setup testing data.
void setUp(void);
+ /// Test stableTimeStepImplicit().
+ void testStableTimeStepImplicit(void);
+
}; // class TestElasticStress1D
#endif // pylith_materials_testelasticstress1d_hh
Modified: short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticIsotropic3D.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticIsotropic3D.py 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticIsotropic3D.py 2009-06-11 00:40:55 UTC (rev 15191)
@@ -70,6 +70,16 @@
self.material.timeStep(2.0)
self.failIf(self.material.needNewJacobian())
return
+
+
+ def testStableTimeStepImplicit(self):
+ """
+ Test stableTimeStepImplicit().
+ """
+ from pylith.topology.Mesh import Mesh
+ mesh = Mesh()
+ dt = self.material.stableTimeStepImplicit(mesh)
+ self.failIf(dt < 1.0e+30)
# End of file
Modified: short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticPlaneStrain.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticPlaneStrain.py 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticPlaneStrain.py 2009-06-11 00:40:55 UTC (rev 15191)
@@ -72,4 +72,14 @@
return
+ def testStableTimeStepImplicit(self):
+ """
+ Test stableTimeStepImplicit().
+ """
+ from pylith.topology.Mesh import Mesh
+ mesh = Mesh()
+ dt = self.material.stableTimeStepImplicit(mesh)
+ self.failIf(dt < 1.0e+30)
+
+
# End of file
Modified: short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticPlaneStress.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticPlaneStress.py 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticPlaneStress.py 2009-06-11 00:40:55 UTC (rev 15191)
@@ -72,4 +72,14 @@
return
+ def testStableTimeStepImplicit(self):
+ """
+ Test stableTimeStepImplicit().
+ """
+ from pylith.topology.Mesh import Mesh
+ mesh = Mesh()
+ dt = self.material.stableTimeStepImplicit(mesh)
+ self.failIf(dt < 1.0e+30)
+
+
# End of file
Modified: short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticStrain1D.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticStrain1D.py 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticStrain1D.py 2009-06-11 00:40:55 UTC (rev 15191)
@@ -72,4 +72,14 @@
return
+ def testStableTimeStepImplicit(self):
+ """
+ Test stableTimeStepImplicit().
+ """
+ from pylith.topology.Mesh import Mesh
+ mesh = Mesh()
+ dt = self.material.stableTimeStepImplicit(mesh)
+ self.failIf(dt < 1.0e+30)
+
+
# End of file
Modified: short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticStress1D.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticStress1D.py 2009-06-11 00:37:29 UTC (rev 15190)
+++ short/3D/PyLith/trunk/unittests/pytests/materials/TestElasticStress1D.py 2009-06-11 00:40:55 UTC (rev 15191)
@@ -72,4 +72,14 @@
return
+ def testStableTimeStepImplicit(self):
+ """
+ Test stableTimeStepImplicit().
+ """
+ from pylith.topology.Mesh import Mesh
+ mesh = Mesh()
+ dt = self.material.stableTimeStepImplicit(mesh)
+ self.failIf(dt < 1.0e+30)
+
+
# End of file
More information about the CIG-COMMITS
mailing list