[cig-commits] r12402 - in short/3D/PyLith/trunk: . libsrc/feassemble libsrc/materials libsrc/utils unittests/libtests/feassemble unittests/libtests/materials unittests/libtests/materials/data
brad at geodynamics.org
brad at geodynamics.org
Wed Jul 9 11:25:10 PDT 2008
Author: brad
Date: 2008-07-09 11:25:10 -0700 (Wed, 09 Jul 2008)
New Revision: 12402
Added:
short/3D/PyLith/trunk/libsrc/utils/constdefs.h
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.cc
short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.cc
short/3D/PyLith/trunk/libsrc/materials/GenMaxwellIsotropic3D.cc
short/3D/PyLith/trunk/libsrc/utils/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestGenMaxwellIsotropic3D.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestGenMaxwellIsotropic3D.hh
short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticIsotropic3DData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticIsotropic3DData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialApp.py
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStrainData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStrainData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStressData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStressData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStrain1DData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStrain1DData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStress1DData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStress1DData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDep.py
short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDepData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDepData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DElasticData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DElasticData.hh
short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDep.py
short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDepData.cc
short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDepData.hh
Log:
Added unit tests to C++ Integrator and materials for stable time step calculation.
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/TODO 2008-07-09 18:25:10 UTC (rev 12402)
@@ -2,15 +2,8 @@
CURRENT ISSUES
======================================================================
-Before June workshop
+Fix memory usage (MATT).
- Fix holding onto memory from before distribution.
-
- Update examples for step-function slip function.
-
- No peak slip rate parameter.
-
-
Other
simple strike-slip propagating rupture (performance benchmark
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -15,16 +15,12 @@
#include "Integrator.hh" // implementation of class methods
#include "Quadrature.hh" // USES Quadrature
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
#include "spatialdata/spatialdb/GravityField.hh" // USES GravityField
#include <assert.h> // USES assert()
-#include <math.h> // USES MAXFLOAT
-#if !defined(MAXFLOAT)
-#define MAXFLOAT 1.0e+30
-#endif
-
// ----------------------------------------------------------------------
// Constructor
pylith::feassemble::Integrator::Integrator(void) :
@@ -74,7 +70,7 @@
pylith::feassemble::Integrator::stableTimeStep(void) const
{ // stableTimeStep
// Assume any time step will work.
- return MAXFLOAT;
+ return pylith::MAXDOUBLE;
} // stableTimeStep
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticIsotropic3D.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -15,6 +15,7 @@
#include "ElasticIsotropic3D.hh" // implementation of object methods
#include "pylith/utils/array.hh" // USES double_array
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
#include "petsc.h" // USES PetscLogFlops
@@ -22,11 +23,6 @@
#include <sstream> // USES std::ostringstream
#include <stdexcept> // USES std::runtime_error
-#include <math.h> // USES MAXFLOAT
-#if !defined(MAXFLOAT)
-#define MAXFLOAT 1.0e+30
-#endif
-
// ----------------------------------------------------------------------
namespace pylith {
namespace materials {
@@ -234,7 +230,7 @@
pylith::materials::ElasticIsotropic3D::_stableTimeStepImplicit(const double* properties,
const int numProperties) const
{ // _stableTimeStepImplicit
- return MAXFLOAT;
+ return pylith::MAXDOUBLE;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -15,16 +15,12 @@
#include "ElasticMaterial.hh" // implementation of object methods
#include "pylith/utils/array.hh" // USES double_array
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
#include "pylith/utils/sievetypes.hh" // USES Mesh
#include <string.h> // USES memcpy()
#include <assert.h> // USES assert()
-#include <math.h> // USES MAXFLOAT
-#if !defined(MAXFLOAT)
-#define MAXFLOAT 1.0e+30
-#endif
-
// ----------------------------------------------------------------------
// Default constructor.
pylith::materials::ElasticMaterial::ElasticMaterial(const int tensorSize,
@@ -115,7 +111,7 @@
const int totalPropsQuadPt = _totalPropsQuadPt;
assert(_propertiesCell.size() == numQuadPts*totalPropsQuadPt);
- double dtStable = MAXFLOAT;
+ double dtStable = pylith::MAXDOUBLE;
for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
const double dt =
_stableTimeStepImplicit(&_propertiesCell[iQuad*totalPropsQuadPt],
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStrain.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -14,16 +14,14 @@
#include "ElasticPlaneStrain.hh" // implementation of object methods
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+
#include "petsc.h" // USES PetscLogFlops
#include <assert.h> // USES assert()
#include <sstream> // USES std::ostringstream
#include <stdexcept> // USES std::runtime_error
-#include <math.h> // USES MAXFLOAT
-#if !defined(MAXFLOAT)
-#define MAXFLOAT 1.0e+30
-#endif
// ----------------------------------------------------------------------
namespace pylith {
@@ -211,7 +209,7 @@
pylith::materials::ElasticPlaneStrain::_stableTimeStepImplicit(const double* properties,
const int numProperties) const
{ // _stableTimeStepImplicit
- return MAXFLOAT;
+ return pylith::MAXDOUBLE;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticPlaneStress.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -14,17 +14,14 @@
#include "ElasticPlaneStress.hh" // implementation of object methods
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+
#include "petsc.h" // USES PetscLogFlops
#include <assert.h> // USES assert()
#include <sstream> // USES std::ostringstream
#include <stdexcept> // USES std::runtime_error
-#include <math.h> // USES MAXFLOAT
-#if !defined(MAXFLOAT)
-#define MAXFLOAT 1.0e+30
-#endif
-
// ----------------------------------------------------------------------
namespace pylith {
namespace materials {
@@ -209,7 +206,7 @@
pylith::materials::ElasticPlaneStress::_stableTimeStepImplicit(const double* properties,
const int numProperties) const
{ // _stableTimeStepImplicit
- return MAXFLOAT;
+ return pylith::MAXDOUBLE;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticStrain1D.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -14,15 +14,12 @@
#include "ElasticStrain1D.hh" // implementation of object methods
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+
#include "petsc.h" // USES PetscLogFlops
#include <assert.h> // USES assert()
-#include <math.h> // USES MAXFLOAT
-#if !defined(MAXFLOAT)
-#define MAXFLOAT 1.0e+30
-#endif
-
// ----------------------------------------------------------------------
namespace pylith {
namespace materials {
@@ -191,7 +188,7 @@
pylith::materials::ElasticStrain1D::_stableTimeStepImplicit(const double* properties,
const int numProperties) const
{ // _stableTimeStepImplicit
- return MAXFLOAT;
+ return pylith::MAXDOUBLE;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticStress1D.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -14,15 +14,12 @@
#include "ElasticStress1D.hh" // implementation of object methods
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+
#include "petsc.h" // USES PetscLogFlops
#include <assert.h> // USES assert()
-#include <math.h> // USES MAXFLOAT
-#if !defined(MAXFLOAT)
-#define MAXFLOAT 1.0e+30
-#endif
-
// ----------------------------------------------------------------------
namespace pylith {
namespace materials {
@@ -188,7 +185,7 @@
pylith::materials::ElasticStress1D::_stableTimeStepImplicit(const double* properties,
const int numProperties) const
{ // _stableTimeStepImplicit
- return MAXFLOAT;
+ return pylith::MAXDOUBLE;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/trunk/libsrc/materials/GenMaxwellIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/GenMaxwellIsotropic3D.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/materials/GenMaxwellIsotropic3D.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -17,6 +17,7 @@
#include "ViscoelasticMaxwell.hh" // USES computeVisStrain
#include "pylith/utils/array.hh" // USES double_array
+#include "pylith/utils/constdefs.h" // USES double_array
#include "petsc.h" // USES PetscLogFlops
@@ -25,11 +26,6 @@
#include <sstream> // USES std::ostringstream
#include <stdexcept> // USES std::runtime_error
-#include <math.h> // USES MAXFLOAT
-#if !defined(MAXFLOAT)
-#define MAXFLOAT 1.0e+30
-#endif
-
// ----------------------------------------------------------------------
namespace pylith {
namespace materials {
@@ -549,7 +545,7 @@
assert(0 != properties);
assert(_totalPropsQuadPt == numProperties);
- double dtStable = MAXFLOAT;
+ double dtStable = pylith::MAXDOUBLE;
const int numMaxwellModels = _GenMaxwellIsotropic3D::numMaxwellModels;
for (int i=0; i < numMaxwellModels; ++i) {
Modified: short/3D/PyLith/trunk/libsrc/utils/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/utils/Makefile.am 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/libsrc/utils/Makefile.am 2008-07-09 18:25:10 UTC (rev 12402)
@@ -18,6 +18,7 @@
EventLogger.icc \
array.hh \
arrayfwd.hh \
+ constdefs.h \
macrodefs.h \
petscfwd.h \
sievefwd.hh \
Added: short/3D/PyLith/trunk/libsrc/utils/constdefs.h
===================================================================
--- short/3D/PyLith/trunk/libsrc/utils/constdefs.h (rev 0)
+++ short/3D/PyLith/trunk/libsrc/utils/constdefs.h 2008-07-09 18:25:10 UTC (rev 12402)
@@ -0,0 +1,31 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file pylith/utils/macrodefs.hh
+ *
+ * @brief Macro definitions for PyLith.
+ */
+
+#if !defined(pylith_utils_constdefs_h)
+#define pylith_utils_constdefs_h
+
+namespace pylith {
+ const double MAXDOUBLE = 1.0e+30;
+ const float MAXFLOAT = 1.0e+30;
+}
+
+
+#endif // pylith_utils_constdefs_h
+
+
+// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -17,6 +17,7 @@
#include "pylith/feassemble/ElasticityImplicit.hh" // USES ElasticityImplicit
#include "data/IntegratorData.hh" // USES IntegratorData
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
#include "pylith/materials/ElasticIsotropic3D.hh" // USES ElasticIsotropic3D
#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
#include "pylith/topology/FieldsManager.hh" // USES FieldsManager
@@ -91,7 +92,7 @@
integrator.material(&material);
const double stableTimeStep = integrator.stableTimeStep();
- CPPUNIT_ASSERT_EQUAL(1.0e+30, stableTimeStep);
+ CPPUNIT_ASSERT_EQUAL(pylith::MAXDOUBLE, stableTimeStep);
} // testStableTimeStep
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -17,6 +17,8 @@
#include "pylith/feassemble/ElasticityExplicit.hh" // USES ElasticityExplicit
#include "pylith/feassemble/ElasticityImplicit.hh" // USES ElasticityImplicit
#include "pylith/feassemble/Quadrature1D.hh" // USES Quadrature1D
+#include "pylith/utils/constdefs.h" // USES MAXFLOAT
+
#include "spatialdata/spatialdb/GravityField.hh" // USES GravityField
#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
@@ -26,6 +28,28 @@
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::feassemble::TestIntegrator );
// ----------------------------------------------------------------------
+// Test timeStep().
+void
+pylith::feassemble::TestIntegrator::testTimeStep(void)
+{ // testTimeStep
+ ElasticityExplicit integrator;
+ const double dt = 1.2;
+ integrator.timeStep(dt);
+
+ CPPUNIT_ASSERT_EQUAL(dt, integrator._dt);
+} // testTimeStep
+
+// ----------------------------------------------------------------------
+// Test stabletimeStep().
+void
+pylith::feassemble::TestIntegrator::testStableTimeStep(void)
+{ // testStableTimeStep
+ ElasticityExplicit integrator;
+
+ CPPUNIT_ASSERT_EQUAL(pylith::MAXDOUBLE, integrator.stableTimeStep());
+} // testStableTimeStep
+
+// ----------------------------------------------------------------------
// Test quadrature().
void
pylith::feassemble::TestIntegrator::testQuadrature(void)
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -45,6 +45,9 @@
// CPPUNIT TEST SUITE /////////////////////////////////////////////////
CPPUNIT_TEST_SUITE( TestIntegrator );
+ CPPUNIT_TEST( testTimeStep );
+ CPPUNIT_TEST( testStableTimeStep );
+
CPPUNIT_TEST( testQuadrature );
CPPUNIT_TEST( testGravityField );
CPPUNIT_TEST( testInitCellVector );
@@ -57,6 +60,12 @@
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
+ /// Test timeStep().
+ void testTimeStep(void);
+
+ /// Test stableTimeStep().
+ void testStableTimeStep(void);
+
/// Test quadrature()
void testQuadrature(void);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticIsotropic3D.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
+ CPPUNIT_TEST( test_stableTimeStepImplicit );
CPPUNIT_TEST( testUsesUpdateProperties );
CPPUNIT_TEST( testUpdateProperties );
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -234,6 +234,68 @@
} // testCalcDerivElastic
// ----------------------------------------------------------------------
+// Test calcDensity()
+void
+pylith::materials::TestElasticMaterial::testStableTimeStepImplicit(void)
+{ // testStableTimeStepImplicit
+ ALE::Obj<Mesh> mesh;
+ { // create mesh
+ const int cellDim = 1;
+ const int numCorners = 2;
+ const int spaceDim = 1;
+ const int numVertices = 2;
+ const int numCells = 1;
+ const double vertCoords[] = { -1.0, 1.0};
+ const int cells[] = { 0, 1};
+ CPPUNIT_ASSERT(0 != vertCoords);
+ CPPUNIT_ASSERT(0 != cells);
+
+ mesh = new Mesh(PETSC_COMM_WORLD, cellDim);
+ ALE::Obj<sieve_type> sieve = new sieve_type(mesh->comm());
+
+ const bool interpolate = false;
+ ALE::Obj<ALE::Mesh::sieve_type> s =
+ new ALE::Mesh::sieve_type(sieve->comm(), sieve->debug());
+
+ ALE::SieveBuilder<ALE::Mesh>::buildTopology(s, cellDim, numCells,
+ const_cast<int*>(cells), numVertices, interpolate, numCorners);
+ std::map<Mesh::point_type,Mesh::point_type> renumbering;
+ ALE::ISieveConverter::convertSieve(*s, *sieve, renumbering);
+ mesh->setSieve(sieve);
+ mesh->stratify();
+ ALE::SieveBuilder<Mesh>::buildCoordinates(mesh, spaceDim, vertCoords);
+ } // create mesh
+
+ // Get cells associated with material
+ const ALE::Obj<real_section_type>& coordinates =
+ mesh->getRealSection("coordinates");
+ const ALE::Obj<Mesh::label_sequence>& cells = mesh->heightStratum(0);
+
+ ElasticIsotropic3D material;
+ ElasticIsotropic3DData data;
+ const int numQuadPts = 2;
+ const int numParams = data.numParameters;
+ const int numParamsQuadPt = data.numParamsQuadPt;
+
+ Mesh::label_sequence::iterator c_iter = cells->begin();
+
+ const int fiberDim = numQuadPts * numParamsQuadPt;
+ material._properties = new real_section_type(mesh->comm(), mesh->debug());
+ material._properties->setChart(mesh->getSieve()->getChart());
+ material._properties->setFiberDimension(cells, fiberDim);
+ mesh->allocate(material._properties);
+
+ material._properties->updatePoint(*c_iter, data.parameterData);
+
+ material.getPropertiesCell(*c_iter, numQuadPts);
+ const double dt = material.stableTimeStepImplicit();
+
+ const double tolerance = 1.0e-06;
+ const double dtE = data.dtStableImplicit;
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, dt/dtE, tolerance);
+} // testStableTimeStepImplicit
+
+// ----------------------------------------------------------------------
// Setup testing data.
void
pylith::materials::TestElasticMaterial::setUp(void)
@@ -347,4 +409,24 @@
} // _testCalcElasticConsts
+// ----------------------------------------------------------------------
+// Test _stableTimeStepImplicit()
+void
+pylith::materials::TestElasticMaterial::test_stableTimeStepImplicit(void)
+{ // _testCalcDensity
+ CPPUNIT_ASSERT(0 != _matElastic);
+ CPPUNIT_ASSERT(0 != _dataElastic);
+ const ElasticMaterialData* data = _dataElastic;
+
+ const double dt =
+ _matElastic->_stableTimeStepImplicit(data->parameterData,
+ data->numParamsQuadPt);
+
+ const double dtE = data->dtStableImplicit;
+
+ const double tolerance = 1.0e-06;
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, dt/dtE, tolerance);
+} // _testStableTimeStepImplicit
+
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testCalcDensity );
CPPUNIT_TEST( testCalcStress );
CPPUNIT_TEST( testCalcDerivElastic );
+ CPPUNIT_TEST( testStableTimeStepImplicit );
CPPUNIT_TEST_SUITE_END();
@@ -57,6 +58,9 @@
/// Test calcDerivElastic()
void testCalcDerivElastic(void);
+ /// Test stableTimeStepImplicit().
+ void testStableTimeStepImplicit(void);
+
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
@@ -79,7 +83,10 @@
/// Test _calcElasticConsts().
void test_calcElasticConsts(void);
+ /// Test _stableTimeStepImplicit().
+ void test_stableTimeStepImplicit(void);
+
// PROTECTED MEMBERS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStrain.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
+ CPPUNIT_TEST( test_stableTimeStepImplicit );
CPPUNIT_TEST( testUsesUpdateProperties );
CPPUNIT_TEST( testUpdateProperties );
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticPlaneStress.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
+ CPPUNIT_TEST( test_stableTimeStepImplicit );
CPPUNIT_TEST( testUsesUpdateProperties );
CPPUNIT_TEST( testUpdateProperties );
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStrain1D.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
+ CPPUNIT_TEST( test_stableTimeStepImplicit );
CPPUNIT_TEST( testUsesUpdateProperties );
CPPUNIT_TEST( testUpdateProperties );
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticStress1D.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -45,6 +45,7 @@
CPPUNIT_TEST( test_calcDensity );
CPPUNIT_TEST( test_calcStress );
CPPUNIT_TEST( test_calcElasticConsts );
+ CPPUNIT_TEST( test_stableTimeStepImplicit );
CPPUNIT_TEST( testUsesUpdateProperties );
CPPUNIT_TEST( testUpdateProperties );
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestGenMaxwellIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestGenMaxwellIsotropic3D.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestGenMaxwellIsotropic3D.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -288,5 +288,17 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(parametersE[i], parameters[i], tolerance);
} // testUpdatePropertiesTimeDep
+// ----------------------------------------------------------------------
+// Test _stableTimeStepImplicit()
+void
+pylith::materials::TestGenMaxwellIsotropic3D::test_stableTimeStepImplicit(void)
+{ // test_stableTimeStepImplicit
+ CPPUNIT_ASSERT(0 != _matElastic);
+ delete _dataElastic; _dataElastic = new GenMaxwellIsotropic3DTimeDepData();
+
+ TestElasticMaterial::test_stableTimeStepImplicit();
+} // test_stableTimeStepImplicit
+
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestGenMaxwellIsotropic3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestGenMaxwellIsotropic3D.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestGenMaxwellIsotropic3D.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -54,6 +54,7 @@
CPPUNIT_TEST( testUsesUpdateProperties );
CPPUNIT_TEST( testUpdatePropertiesElastic );
CPPUNIT_TEST( testUpdatePropertiesTimeDep );
+ CPPUNIT_TEST( test_stableTimeStepImplicit );
CPPUNIT_TEST_SUITE_END();
@@ -90,6 +91,9 @@
/// Test updatePropertiesTimeDep()
void testUpdatePropertiesTimeDep(void);
+ /// Test _stableTimeStepImplicit()
+ void test_stableTimeStepImplicit(void);
+
}; // class TestGenMaxwellIsotropic3D
#endif // pylith_materials_testgenmaxwellisotropic3d_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -259,5 +259,17 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(parametersE[i], parameters[i], tolerance);
} // testUpdatePropertiesTimeDep
+// ----------------------------------------------------------------------
+// Test _stableTimeStepImplicit()
+void
+pylith::materials::TestMaxwellIsotropic3D::test_stableTimeStepImplicit(void)
+{ // test_stableTimeStepImplicit
+ CPPUNIT_ASSERT(0 != _matElastic);
+ delete _dataElastic; _dataElastic = new MaxwellIsotropic3DTimeDepData();
+
+ TestElasticMaterial::test_stableTimeStepImplicit();
+} // test_stableTimeStepImplicit
+
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -54,6 +54,7 @@
CPPUNIT_TEST( testUsesUpdateProperties );
CPPUNIT_TEST( testUpdatePropertiesElastic );
CPPUNIT_TEST( testUpdatePropertiesTimeDep );
+ CPPUNIT_TEST( test_stableTimeStepImplicit );
CPPUNIT_TEST_SUITE_END();
@@ -90,6 +91,9 @@
/// Test updatePropertiesTimeDep()
void testUpdatePropertiesTimeDep(void);
+ /// Test _stableTimeStepImplicit()
+ void test_stableTimeStepImplicit(void);
+
}; // class TestMaxwellIsotropic3D
#endif // pylith_materials_testmaxwellisotropic3d_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticIsotropic3DData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticIsotropic3DData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticIsotropic3DData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::ElasticIsotropic3DData::_numLocs = 2;
+const double pylith::materials::ElasticIsotropic3DData::_dtStableImplicit = 1.00000000e+30;
+
const int pylith::materials::ElasticIsotropic3DData::_numParamValues[] = {
1,
1,
@@ -142,6 +144,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticIsotropic3DData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticIsotropic3DData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticIsotropic3DData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialApp.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialApp.py 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialApp.py 2008-07-09 18:25:10 UTC (rev 12402)
@@ -73,6 +73,7 @@
self.strain = None
self.stress = None
self.elasticConsts = None
+ self.dtStableImplicit = 1.0e+30
return
@@ -136,6 +137,9 @@
self.data.addArray(vtype="double", name="_elasticConsts",
values=self.elasticConsts,
format="%16.8e", ncols=1)
+ self.data.addScalar(vtype="double", name="_dtStableImplicit",
+ value=self.dtStableImplicit,
+ format="%16.8e")
return
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -13,6 +13,7 @@
#include "ElasticMaterialData.hh"
pylith::materials::ElasticMaterialData::ElasticMaterialData(void) :
+ dtStableImplicit(0.0),
density(0),
strain(0),
stress(0),
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticMaterialData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -36,6 +36,7 @@
// PUBLIC MEMBERS ///////////////////////////////////////////////////////
public:
+ double dtStableImplicit; ///< Stable time step for implicit time stepping
double* density; ///< Density at locations
double* strain; ///< Strain at locations
double* stress; ///< Stress at locations
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStrainData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStrainData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStrainData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::ElasticPlaneStrainData::_numLocs = 2;
+const double pylith::materials::ElasticPlaneStrainData::_dtStableImplicit = 1.00000000e+30;
+
const int pylith::materials::ElasticPlaneStrainData::_numParamValues[] = {
1,
1,
@@ -100,6 +102,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStrainData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStrainData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStrainData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStressData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStressData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStressData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::ElasticPlaneStressData::_numLocs = 2;
+const double pylith::materials::ElasticPlaneStressData::_dtStableImplicit = 1.00000000e+30;
+
const int pylith::materials::ElasticPlaneStressData::_numParamValues[] = {
1,
1,
@@ -100,6 +102,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStressData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStressData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticPlaneStressData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStrain1DData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStrain1DData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStrain1DData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::ElasticStrain1DData::_numLocs = 2;
+const double pylith::materials::ElasticStrain1DData::_dtStableImplicit = 1.00000000e+30;
+
const int pylith::materials::ElasticStrain1DData::_numParamValues[] = {
1,
1,
@@ -82,6 +84,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStrain1DData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStrain1DData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStrain1DData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStress1DData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStress1DData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStress1DData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::ElasticStress1DData::_numLocs = 2;
+const double pylith::materials::ElasticStress1DData::_dtStableImplicit = 1.00000000e+30;
+
const int pylith::materials::ElasticStress1DData::_numParamValues[] = {
1,
1,
@@ -82,6 +84,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStress1DData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStress1DData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/ElasticStress1DData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::GenMaxwellIsotropic3DElasticData::_numLocs = 2;
+const double pylith::materials::GenMaxwellIsotropic3DElasticData::_dtStableImplicit = 1.00000000e+30;
+
const int pylith::materials::GenMaxwellIsotropic3DElasticData::_numParamValues[] = {
1,
1,
@@ -224,6 +226,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDep.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDep.py 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDep.py 2008-07-09 18:25:10 UTC (rev 12402)
@@ -137,6 +137,8 @@
self._calcStress(strainB, muB, lambdaB,
shearRatioB, maxwellTimeB,
strainTB, visStrainB)
+ self.dtStableImplicit = 0.1*min(min(maxwellTimeA),
+ min(maxwellTimeB))
return
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDepData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDepData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDepData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::GenMaxwellIsotropic3DTimeDepData::_numLocs = 2;
+const double pylith::materials::GenMaxwellIsotropic3DTimeDepData::_dtStableImplicit = 4.44444444e+06;
+
const int pylith::materials::GenMaxwellIsotropic3DTimeDepData::_numParamValues[] = {
1,
1,
@@ -224,6 +226,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDepData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDepData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/GenMaxwellIsotropic3DTimeDepData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DElasticData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DElasticData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DElasticData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::MaxwellIsotropic3DElasticData::_numLocs = 2;
+const double pylith::materials::MaxwellIsotropic3DElasticData::_dtStableImplicit = 1.00000000e+30;
+
const int pylith::materials::MaxwellIsotropic3DElasticData::_numParamValues[] = {
1,
1,
@@ -174,6 +176,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DElasticData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DElasticData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DElasticData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDep.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDep.py 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDep.py 2008-07-09 18:25:10 UTC (rev 12402)
@@ -103,9 +103,13 @@
dtype=numpy.float64)
(self.elasticConsts[0,:], self.stress[0,:]) = \
- self._calcStress(strainA, muA, lambdaA, maxwellTimeA, strainTA, visStrainA)
+ self._calcStress(strainA, muA, lambdaA,
+ maxwellTimeA, strainTA, visStrainA)
(self.elasticConsts[1,:], self.stress[1,:]) = \
- self._calcStress(strainB, muB, lambdaB, maxwellTimeB, strainTB, visStrainB)
+ self._calcStress(strainB, muB, lambdaB,
+ maxwellTimeB, strainTB, visStrainB)
+
+ self.dtStableImplicit = 0.1*min(maxwellTimeA, maxwellTimeB)
return
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDepData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDepData.cc 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDepData.cc 2008-07-09 18:25:10 UTC (rev 12402)
@@ -25,6 +25,8 @@
const int pylith::materials::MaxwellIsotropic3DTimeDepData::_numLocs = 2;
+const double pylith::materials::MaxwellIsotropic3DTimeDepData::_dtStableImplicit = 4.44444444e+06;
+
const int pylith::materials::MaxwellIsotropic3DTimeDepData::_numParamValues[] = {
1,
1,
@@ -174,6 +176,7 @@
numParameters = _numParameters;
numParamsQuadPt = _numParamsQuadPt;
numLocs = _numLocs;
+ dtStableImplicit = _dtStableImplicit;
numParamValues = const_cast<int*>(_numParamValues);
dbValues = const_cast<char**>(_dbValues);
dbData = const_cast<double*>(_dbData);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDepData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDepData.hh 2008-07-09 18:23:25 UTC (rev 12401)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/data/MaxwellIsotropic3DTimeDepData.hh 2008-07-09 18:25:10 UTC (rev 12402)
@@ -47,6 +47,8 @@
static const int _numLocs;
+ static const double _dtStableImplicit;
+
static const int _numParamValues[];
static const char* _dbValues[];
More information about the cig-commits
mailing list