[cig-commits] r14850 - in short/3D/PyLith/branches/pylith-swig: examples/3d/hex8 libsrc/feassemble libsrc/materials modulesrc/feassemble modulesrc/materials pylith/meshio pylith/problems pylith/topology unittests/libtests/feassemble unittests/libtests/materials unittests/pytests/bc unittests/pytests/faults unittests/pytests/feassemble unittests/pytests/materials unittests/pytests/problems
brad at geodynamics.org
brad at geodynamics.org
Sun May 3 15:07:04 PDT 2009
Author: brad
Date: 2009-05-03 15:07:00 -0700 (Sun, 03 May 2009)
New Revision: 14850
Modified:
short/3D/PyLith/branches/pylith-swig/examples/3d/hex8/savageprescott.cfg
short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.cc
short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.hh
short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.cc
short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh
short/3D/PyLith/branches/pylith-swig/libsrc/materials/ElasticMaterial.cc
short/3D/PyLith/branches/pylith-swig/libsrc/materials/ElasticMaterial.hh
short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/ElasticityImplicit.i
short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/Integrator.i
short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticMaterial.i
short/3D/PyLith/branches/pylith-swig/pylith/meshio/OutputManager.py
short/3D/PyLith/branches/pylith-swig/pylith/problems/Formulation.py
short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStep.py
short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepAdapt.py
short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepUniform.py
short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepUser.py
short/3D/PyLith/branches/pylith-swig/pylith/topology/Mesh.py
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit1DLinear.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit1DQuadratic.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit2DLinear.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit2DQuadratic.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit3DLinear.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit3DQuadratic.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit1DLinear.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit1DQuadratic.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit2DLinear.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit2DQuadratic.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit3DLinear.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit3DQuadratic.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestIntegrator.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticMaterial.cc
short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestAbsorbingDampers.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestNeumann.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/faults/TestFaultCohesiveKin.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/TestElasticityExplicit.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/TestElasticityImplicit.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticIsotropic3D.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStrain.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStress.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStrain1D.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStress1D.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestMaxwellIsotropic3D.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStep.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepAdapt.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepUniform.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepUser.py
Log:
Fixed calculation of stable time step for materials.
Modified: short/3D/PyLith/branches/pylith-swig/examples/3d/hex8/savageprescott.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-swig/examples/3d/hex8/savageprescott.cfg 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/examples/3d/hex8/savageprescott.cfg 2009-05-03 22:07:00 UTC (rev 14850)
@@ -88,7 +88,6 @@
[pylithapp.timedependent.interfaces.fault]
label = 10
-quadrature = pylith.feassemble.quadrature.Quadrature2Din3D
quadrature.cell = pylith.feassemble.FIATLagrange
quadrature.cell.dimension = 2
mat_db.iohandler.filename = mat_elastic.spatialdb
@@ -152,7 +151,7 @@
# Give basename for VTK output of state variables.
[pylithapp.timedependent.materials.elastic.output]
skip = 9
-cell_filter = pylith.meshio.CellFilterAvg
+cell_filter = pylith.meshio.CellFilterAvgMesh
writer.filename = savageprescott-statevars-elastic.vtk
writer.time_format = %04.0f
writer.time_constant = 1.0*year
@@ -160,7 +159,7 @@
[pylithapp.timedependent.materials.viscoelastic.output]
cell_info_fields = [density,mu,lambda,maxwell_time]
skip = 9
-cell_filter = pylith.meshio.CellFilterAvg
+cell_filter = pylith.meshio.CellFilterAvgMesh
writer.filename = savageprescott-statevars-viscoelastic.vtk
writer.time_format = %04.0f
writer.time_constant = 1.0*year
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.cc 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.cc 2009-05-03 22:07:00 UTC (rev 14850)
@@ -70,10 +70,10 @@
// ----------------------------------------------------------------------
// Get stable time step for advancing from time t to time t+dt.
double
-pylith::feassemble::ElasticityImplicit::stableTimeStep(void) const
+pylith::feassemble::ElasticityImplicit::stableTimeStep(const topology::Mesh& mesh) const
{ // stableTimeStep
assert(0 != _material);
- return _material->stableTimeStepImplicit();
+ return _material->stableTimeStepImplicit(mesh);
} // stableTimeStep
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -74,9 +74,10 @@
*
* Default is current time step.
*
+ * @param mesh Finite-element mesh.
* @returns Time step
*/
- double stableTimeStep(void) const;
+ double stableTimeStep(const topology::Mesh& mesh) const;
/** Set flag for setting constraints for total field solution or
* incremental field solution.
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.cc 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.cc 2009-05-03 22:07:00 UTC (rev 14850)
@@ -85,7 +85,7 @@
// Get stable time step for advancing from time t to time t+dt.
template<typename quadrature_type>
double
-pylith::feassemble::Integrator<quadrature_type>::stableTimeStep(void) const
+pylith::feassemble::Integrator<quadrature_type>::stableTimeStep(const topology::Mesh& mesh)
{ // stableTimeStep
// Assume any time step will work.
return pylith::PYLITH_MAXDOUBLE;
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -81,10 +81,11 @@
*
* Default is MAXFLOAT (or 1.0e+30 if MAXFLOAT is not defined in math.h).
*
+ * @param mesh Finite-element mesh.
* @returns Time step
*/
virtual
- double stableTimeStep(void) const;
+ double stableTimeStep(const topology::Mesh& mesh);
/** Check whether Jacobian needs to be recomputed.
*
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/materials/ElasticMaterial.cc 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/materials/ElasticMaterial.cc 2009-05-03 22:07:00 UTC (rev 14850)
@@ -232,7 +232,7 @@
// ----------------------------------------------------------------------
// Get stable time step for implicit time integration.
double
-pylith::materials::ElasticMaterial::stableTimeStepImplicit(void) const
+pylith::materials::ElasticMaterial::stableTimeStepImplicit(const topology::Mesh& mesh)
{ // stableTimeStepImplicit
const int numQuadPts = _numQuadPts;
const int numPropsQuadPt = _numPropsQuadPt;
@@ -245,14 +245,30 @@
assert(_initialStrainCell.size() == numQuadPts*_tensorSize);
double dtStable = pylith::PYLITH_MAXDOUBLE;
- for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
- const double dt =
- _stableTimeStepImplicit(&_propertiesCell[iQuad*numPropsQuadPt],
- numPropsQuadPt,
- &_stateVarsCell[iQuad*numVarsQuadPt],
- numVarsQuadPt);
- if (dt < dtStable)
- dtStable = dt;
+
+ // Get cells associated with material
+ const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
+ assert(!sieveMesh.isNull());
+ const ALE::Obj<SieveMesh::label_sequence>& cells =
+ sieveMesh->getLabelStratum("material-id", id());
+ assert(!cells.isNull());
+ const SieveMesh::label_sequence::iterator cellsBegin = cells->begin();
+ const SieveMesh::label_sequence::iterator cellsEnd = cells->end();
+
+ for (SieveMesh::label_sequence::iterator c_iter=cells->begin();
+ c_iter != cellsEnd;
+ ++c_iter) {
+ retrievePropsAndVars(*c_iter);
+
+ for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
+ const double dt =
+ _stableTimeStepImplicit(&_propertiesCell[iQuad*numPropsQuadPt],
+ numPropsQuadPt,
+ &_stateVarsCell[iQuad*numVarsQuadPt],
+ numVarsQuadPt);
+ if (dt < dtStable)
+ dtStable = dt;
+ } // for
} // for
return dtStable;
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/materials/ElasticMaterial.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/materials/ElasticMaterial.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/materials/ElasticMaterial.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -165,10 +165,11 @@
*
* Default is MAXFLOAT (or 1.0e+30 if MAXFLOAT is not defined in math.h).
*
+ * @param mesh Finite-element mesh.
* @returns Time step
*/
virtual
- double stableTimeStepImplicit(void) const;
+ double stableTimeStepImplicit(const topology::Mesh& mesh);
/** Set whether elastic or inelastic constitutive relations are used.
*
Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/ElasticityImplicit.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/ElasticityImplicit.i 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/ElasticityImplicit.i 2009-05-03 22:07:00 UTC (rev 14850)
@@ -40,9 +40,10 @@
*
* Default is current time step.
*
+ * @param mesh Finite-element mesh.
* @returns Time step
*/
- double stableTimeStep(void) const;
+ double stableTimeStep(const pylith::topology::Mesh& mesh);
/** Set flag for setting constraints for total field solution or
* incremental field solution.
Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/Integrator.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/Integrator.i 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/Integrator.i 2009-05-03 22:07:00 UTC (rev 14850)
@@ -62,10 +62,11 @@
*
* Default is MAXFLOAT (or 1.0e+30 if MAXFLOAT is not defined in math.h).
*
+ * @param mesh Finite-element mesh.
* @returns Time step
*/
virtual
- double stableTimeStep(void) const;
+ double stableTimeStep(const pylith::topology::Mesh& mesh);
/** Check whether Jacobian needs to be recomputed.
*
Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticMaterial.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticMaterial.i 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/materials/ElasticMaterial.i 2009-05-03 22:07:00 UTC (rev 14850)
@@ -69,7 +69,7 @@
* @returns Time step
*/
virtual
- double stableTimeStepImplicit(void) const;
+ double stableTimeStepImplicit(const pylith::topology::Mesh& mesh);
/** Set whether elastic or inelastic constitutive relations are used.
*
Modified: short/3D/PyLith/branches/pylith-swig/pylith/meshio/OutputManager.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/meshio/OutputManager.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/pylith/meshio/OutputManager.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -157,7 +157,7 @@
if numTimeSteps > 0 and self.outputFreq == "skip" and self.skip > 0:
nsteps = int(numTimeSteps / (1+self.skip))
elif numTimeSteps > 0 and self.outputFreq == "time_step":
- nsteps = 1 + int(totalTime / self.dtN)
+ nsteps = int(1 + totalTime / self.dtN)
(mesh, label, labelId) = self.dataProvider.getDataMesh()
self._open(mesh, nsteps, label, labelId)
Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/Formulation.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/Formulation.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -237,7 +237,8 @@
logEvent = "%stimestep" % self._loggingPrefix
self._logger.eventBegin(logEvent)
- dt = self.timeStep.timeStep(self.integratorsMesh + self.integratorsSubMesh)
+ dt = self.timeStep.timeStep(self.mesh,
+ self.integratorsMesh + self.integratorsSubMesh)
self._logger.eventEnd(logEvent)
return dt
Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStep.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStep.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStep.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -88,7 +88,7 @@
return 0
- def timeStep(self, integrators):
+ def timeStep(self, mesh, integrators):
"""
Get stable time step for advancing forward in time.
"""
Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepAdapt.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepAdapt.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepAdapt.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -104,17 +104,17 @@
Get number of total time steps (or best guess if adaptive).
"""
# Guess using maximum time step
- nsteps = 1.0 + int(self.totalTime / self.maxDt)
+ nsteps = int(1.0 + self.totalTime / self.maxDt)
return nsteps
- def timeStep(self, integrators):
+ def timeStep(self, mesh, integrators):
"""
Adjust stable time step for advancing forward in time.
"""
dtStable = 1.0e+30
for integrator in integrators:
- dt = integrator.stableTimeStep()
+ dt = integrator.stableTimeStep(mesh)
if dt < dtStable:
dtStable = dt
Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepUniform.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepUniform.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepUniform.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -71,11 +71,11 @@
"""
Get number of total time steps (or best guess if adaptive).
"""
- nsteps = 1 + int(self.totalTime / self.dt)
+ nsteps = int(1 + self.totalTime / self.dt)
return nsteps
- def timeStep(self, integrators):
+ def timeStep(self, mesh, integrators):
"""
Adjust stable time step for advancing forward in time.
"""
Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepUser.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepUser.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/TimeStepUser.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -145,7 +145,7 @@
return nsteps
- def timeStep(self, integrators):
+ def timeStep(self, mesh, integrators):
"""
Get time step for advancing forward in time.
"""
Modified: short/3D/PyLith/branches/pylith-swig/pylith/topology/Mesh.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/topology/Mesh.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/pylith/topology/Mesh.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -33,7 +33,7 @@
elif comm is None:
ModuleMesh.__init__(self, dim)
else:
- ModuleMesh.__init__(self, dim, comm)
+ ModuleMesh.__init__(self, dim, comm.handle)
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit.cc 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit.cc 2009-05-03 22:07:00 UTC (rev 14850)
@@ -86,17 +86,6 @@
} // testTimeStep
// ----------------------------------------------------------------------
-// Test StableTimeStep().
-void
-pylith::feassemble::TestElasticityExplicit::testStableTimeStep(void)
-{ // testStableTimeStep
- ElasticityExplicit integrator;
-
- const double stableTimeStep = integrator.stableTimeStep();
- CPPUNIT_ASSERT_EQUAL(1.0e+30, stableTimeStep);
-} // testStableTimeStep
-
-// ----------------------------------------------------------------------
// Test material().
void
pylith::feassemble::TestElasticityExplicit::testMaterial(void)
@@ -275,6 +264,20 @@
} // testUpdateStateVars
// ----------------------------------------------------------------------
+// Test StableTimeStep().
+void
+pylith::feassemble::TestElasticityExplicit::testStableTimeStep(void)
+{ // testStableTimeStep
+ topology::Mesh mesh;
+ ElasticityExplicit integrator;
+ topology::SolutionFields fields(mesh);
+ _initialize(&mesh, &integrator, &fields);
+
+ const double stableTimeStep = integrator.stableTimeStep(mesh);
+ CPPUNIT_ASSERT_EQUAL(1.0e+30, stableTimeStep);
+} // testStableTimeStep
+
+// ----------------------------------------------------------------------
// Initialize elasticity integrator.
void
pylith::feassemble::TestElasticityExplicit::_initialize(
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -46,7 +46,6 @@
CPPUNIT_TEST( testConstructor );
CPPUNIT_TEST( testTimeStep );
- CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST( testMaterial );
CPPUNIT_TEST( testNeedNewJacobian );
CPPUNIT_TEST( testUseSolnIncr );
@@ -72,9 +71,6 @@
/// Test timeStep().
void testTimeStep(void);
- /// Test StableTimeStep().
- void testStableTimeStep(void);
-
/// Test material().
void testMaterial(void);
@@ -96,6 +92,9 @@
/// Test updateStateVars().
void testUpdateStateVars(void);
+ /// Test StableTimeStep().
+ void testStableTimeStep(void);
+
// PROTECTED MEMBERS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit1DLinear.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit1DLinear.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit1DLinear.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit1DQuadratic.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit1DQuadratic.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit1DQuadratic.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit2DLinear.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit2DLinear.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit2DLinear.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit2DQuadratic.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit2DQuadratic.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit2DQuadratic.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit3DLinear.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit3DLinear.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit3DLinear.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit3DQuadratic.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit3DQuadratic.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityExplicit3DQuadratic.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit.cc 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit.cc 2009-05-03 22:07:00 UTC (rev 14850)
@@ -85,24 +85,6 @@
} // testTimeStep
// ----------------------------------------------------------------------
-// Test StableTimeStep().
-void
-pylith::feassemble::TestElasticityImplicit::testStableTimeStep(void)
-{ // testStableTimeStep
- ElasticityImplicit integrator;
-
- materials::ElasticIsotropic3D material;
- const int id = 3;
- const std::string label("my material");
- material.id(id);
- material.label(label.c_str());
- integrator.material(&material);
-
- const double stableTimeStep = integrator.stableTimeStep();
- CPPUNIT_ASSERT_EQUAL(pylith::PYLITH_MAXDOUBLE, stableTimeStep);
-} // testStableTimeStep
-
-// ----------------------------------------------------------------------
// Test material().
void
pylith::feassemble::TestElasticityImplicit::testMaterial(void)
@@ -275,6 +257,21 @@
} // testUpdateStateVars
// ----------------------------------------------------------------------
+// Test StableTimeStep().
+void
+pylith::feassemble::TestElasticityImplicit::testStableTimeStep(void)
+{ // testStableTimeStep
+
+ topology::Mesh mesh;
+ ElasticityImplicit integrator;
+ topology::SolutionFields fields(mesh);
+ _initialize(&mesh, &integrator, &fields);
+
+ const double stableTimeStep = integrator.stableTimeStep(mesh);
+ CPPUNIT_ASSERT_EQUAL(pylith::PYLITH_MAXDOUBLE, stableTimeStep);
+} // testStableTimeStep
+
+// ----------------------------------------------------------------------
// Initialize elasticity integrator.
void
pylith::feassemble::TestElasticityImplicit::_initialize(
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -46,7 +46,6 @@
CPPUNIT_TEST( testConstructor );
CPPUNIT_TEST( testTimeStep );
- CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST( testMaterial );
CPPUNIT_TEST( testNeedNewJacobian );
CPPUNIT_TEST( testUseSolnIncr );
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit1DLinear.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit1DLinear.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit1DLinear.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit1DQuadratic.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit1DQuadratic.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit1DQuadratic.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit2DLinear.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit2DLinear.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit2DLinear.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit2DQuadratic.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit2DQuadratic.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit2DQuadratic.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit3DLinear.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit3DLinear.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit3DLinear.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit3DQuadratic.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit3DQuadratic.hh 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestElasticityImplicit3DQuadratic.hh 2009-05-03 22:07:00 UTC (rev 14850)
@@ -42,6 +42,7 @@
CPPUNIT_TEST( testIntegrateResidual );
CPPUNIT_TEST( testIntegrateJacobian );
CPPUNIT_TEST( testUpdateStateVars );
+ CPPUNIT_TEST( testStableTimeStep );
CPPUNIT_TEST_SUITE_END();
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestIntegrator.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestIntegrator.cc 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/feassemble/TestIntegrator.cc 2009-05-03 22:07:00 UTC (rev 14850)
@@ -43,8 +43,9 @@
pylith::feassemble::TestIntegrator::testStableTimeStep(void)
{ // testStableTimeStep
ElasticityExplicit integrator;
+ topology::Mesh mesh;
- CPPUNIT_ASSERT_EQUAL(pylith::PYLITH_MAXDOUBLE, integrator.stableTimeStep());
+ CPPUNIT_ASSERT_EQUAL(pylith::PYLITH_MAXDOUBLE, integrator.stableTimeStep(mesh));
} // testStableTimeStep
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticMaterial.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticMaterial.cc 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticMaterial.cc 2009-05-03 22:07:00 UTC (rev 14850)
@@ -377,7 +377,7 @@
SieveMesh::point_type cell = *cells->begin();
material.retrievePropsAndVars(cell);
- const double dt = material.stableTimeStepImplicit();
+ const double dt = material.stableTimeStepImplicit(mesh);
const double tolerance = 1.0e-06;
const double dtE = data.dtStableImplicit;
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestAbsorbingDampers.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestAbsorbingDampers.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestAbsorbingDampers.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -74,7 +74,7 @@
"""
(mesh, bc, fields) = self._initialize()
- self.assertEqual(1.0e+30, bc.stableTimeStep())
+ self.assertEqual(1.0e+30, bc.stableTimeStep(mesh))
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestNeumann.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestNeumann.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestNeumann.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -74,7 +74,7 @@
"""
(mesh, bc, fields) = self._initialize()
- self.assertEqual(1.0e+30, bc.stableTimeStep())
+ self.assertEqual(1.0e+30, bc.stableTimeStep(mesh))
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/faults/TestFaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/faults/TestFaultCohesiveKin.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/faults/TestFaultCohesiveKin.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -147,7 +147,7 @@
"""
(mesh, fault, fields) = self._initialize()
- self.assertEqual(1.0e+30, fault.stableTimeStep())
+ self.assertEqual(1.0e+30, fault.stableTimeStep(mesh))
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/TestElasticityExplicit.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/TestElasticityExplicit.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/TestElasticityExplicit.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -99,7 +99,7 @@
(mesh, integrator) = self._preinitialize()
fields = self._initialize(mesh, integrator)
- self.assertEqual(1.0e+30, integrator.stableTimeStep())
+ self.assertEqual(1.0e+30, integrator.stableTimeStep(mesh))
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/TestElasticityImplicit.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/TestElasticityImplicit.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/TestElasticityImplicit.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -99,7 +99,7 @@
(mesh, integrator) = self._preinitialize()
fields = self._initialize(mesh, integrator)
- self.assertEqual(1.0e+30, integrator.stableTimeStep())
+ self.assertEqual(1.0e+30, integrator.stableTimeStep(mesh))
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticIsotropic3D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticIsotropic3D.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticIsotropic3D.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -53,12 +53,6 @@
return
- def testStableTimeStepImplicit(self):
- maxfloat = 1.0e+30
- self.assertEqual(maxfloat, self.material.stableTimeStepImplicit())
- return
-
-
def testTensorSize(self):
self.assertEqual(6, self.material.tensorSize())
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStrain.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStrain.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStrain.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -53,12 +53,6 @@
return
- def testStableTimeStepImplicit(self):
- maxfloat = 1.0e+30
- self.assertEqual(maxfloat, self.material.stableTimeStepImplicit())
- return
-
-
def testTensorSize(self):
self.assertEqual(3, self.material.tensorSize())
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStress.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStress.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticPlaneStress.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -53,12 +53,6 @@
return
- def testStableTimeStepImplicit(self):
- maxfloat = 1.0e+30
- self.assertEqual(maxfloat, self.material.stableTimeStepImplicit())
- return
-
-
def testTensorSize(self):
self.assertEqual(3, self.material.tensorSize())
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStrain1D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStrain1D.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStrain1D.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -53,12 +53,6 @@
return
- def testStableTimeStepImplicit(self):
- maxfloat = 1.0e+30
- self.assertEqual(maxfloat, self.material.stableTimeStepImplicit())
- return
-
-
def testTensorSize(self):
self.assertEqual(1, self.material.tensorSize())
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStress1D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStress1D.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestElasticStress1D.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -53,12 +53,6 @@
return
- def testStableTimeStepImplicit(self):
- maxfloat = 1.0e+30
- self.assertEqual(maxfloat, self.material.stableTimeStepImplicit())
- return
-
-
def testTensorSize(self):
self.assertEqual(1, self.material.tensorSize())
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestMaxwellIsotropic3D.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestMaxwellIsotropic3D.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/materials/TestMaxwellIsotropic3D.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -53,12 +53,6 @@
return
- def testStableTimeStepImplicit(self):
- maxfloat = 1.0e+30
- self.assertEqual(maxfloat, self.material.stableTimeStepImplicit())
- return
-
-
def testTensorSize(self):
self.assertEqual(6, self.material.tensorSize())
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStep.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStep.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStep.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -100,7 +100,8 @@
tstep._configure()
integrators = None
- self.assertEqual(0.0, tstep.timeStep(integrators))
+ mesh = None
+ self.assertEqual(0.0, tstep.timeStep(mesh, integrators))
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepAdapt.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepAdapt.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepAdapt.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -19,14 +19,13 @@
from pyre.units.time import second
-# ----------------------------------------------------------------------
class Integrator:
def __init__(self, dt):
self.dt = dt
- def stableTimeStep(self):
+ def stableTimeStep(self, mesh):
return self.dt
@@ -85,42 +84,43 @@
tstep.adaptSkip = 2
integrators = [Integrator(2.0),
Integrator(0.5)]
+ mesh = None
# Set time step
dt = 0.5 / 1.2
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
# Increase stable time step, but time step should not change (skipped)
integrators[1].dt = 0.8
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
# Reduce time step even if though should have skipped
integrators[1].dt = 0.2
dt = 0.2 / 1.2
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
# Skip adjusting time step
integrators[1].dt = 0.8
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
# Skip adjusting time step
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
# Adjust time step and stability factor
tstep.stabilityFactor = 2.0
dt = 0.8 / 2.0
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
# Skip adjusting time step
integrators[1].dt = 2.0
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
# Skip adjusting time step
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
# Adjust time step with value bigger than max
dt = 0.5
- self.assertEqual(dt, tstep.timeStep(integrators))
+ self.assertEqual(dt, tstep.timeStep(mesh, integrators))
return
@@ -138,8 +138,9 @@
integrators = [Integrator(3.0),
Integrator(2.4)]
+ mesh = None
dt = 2.4 / 1.2
- tstep.timeStep(integrators)
+ tstep.timeStep(mesh, integrators)
self.assertEqual(dt, tstep.currentStep())
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepUniform.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepUniform.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepUniform.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -48,10 +48,13 @@
tstep = TimeStepUniform()
tstep._configure()
- self.assertEqual(1.0*second, tstep.timeStep(0.5*second))
+ integrators = None
+ mesh = None
+ self.assertEqual(1.0*second, tstep.timeStep(mesh, integrators))
+
tstep.dt = 1.0e-4*second
- self.assertEqual(1.0e-4*second, tstep.timeStep(0.5*second))
+ self.assertEqual(1.0e-4*second, tstep.timeStep(mesh, integrators))
return
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepUser.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepUser.py 2009-05-02 20:36:11 UTC (rev 14849)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/problems/TestTimeStepUser.py 2009-05-03 22:07:00 UTC (rev 14850)
@@ -90,19 +90,22 @@
step2 = (2.0*year).value / 2.0 # nondimensionalize
step3 = (3.0*year).value / 2.0 # nondimensionalize
- self.assertEqual(step1, tstep.timeStep(0.5))
- self.assertEqual(step2, tstep.timeStep(0.5))
- self.assertEqual(step3, tstep.timeStep(0.5))
- self.assertEqual(step3, tstep.timeStep(0.5))
- self.assertEqual(step3, tstep.timeStep(0.5))
+ integrators = None
+ mesh = None
+ self.assertEqual(step1, tstep.timeStep(mesh, integrators))
+ self.assertEqual(step2, tstep.timeStep(mesh, integrators))
+ self.assertEqual(step3, tstep.timeStep(mesh, integrators))
+ self.assertEqual(step3, tstep.timeStep(mesh, integrators))
+ self.assertEqual(step3, tstep.timeStep(mesh, integrators))
+
tstep.index = 0
tstep.loopSteps = True
- self.assertEqual(step1, tstep.timeStep(0.5))
- self.assertEqual(step2, tstep.timeStep(0.5))
- self.assertEqual(step3, tstep.timeStep(0.5))
- self.assertEqual(step1, tstep.timeStep(0.5))
- self.assertEqual(step2, tstep.timeStep(0.5))
+ self.assertEqual(step1, tstep.timeStep(mesh, integrators))
+ self.assertEqual(step2, tstep.timeStep(mesh, integrators))
+ self.assertEqual(step3, tstep.timeStep(mesh, integrators))
+ self.assertEqual(step1, tstep.timeStep(mesh, integrators))
+ self.assertEqual(step2, tstep.timeStep(mesh, integrators))
return
@@ -112,7 +115,10 @@
"""
tstep = self.tstep
- tstep.timeStep(0.0)
+ integrators = None
+ mesh = None
+
+ tstep.timeStep(mesh, integrators)
stepE = 1.0*year
valueE = stepE.value / 2.0 # nondimensionalize
self.assertEqual(valueE, tstep.currentStep())
More information about the CIG-COMMITS
mailing list