[cig-commits] r6495 - in short/3D/PyLith/trunk: . libsrc/feassemble pylith/feassemble pylith/problems

brad at geodynamics.org brad at geodynamics.org
Sat Mar 31 16:48:15 PDT 2007


Author: brad
Date: 2007-03-31 16:48:14 -0700 (Sat, 31 Mar 2007)
New Revision: 6495

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/feassemble/ExplicitElasticity.cc
   short/3D/PyLith/trunk/libsrc/feassemble/IntegratorExplicit.cc
   short/3D/PyLith/trunk/pylith/feassemble/IntegratorExplicit.py
   short/3D/PyLith/trunk/pylith/problems/Explicit.py
   short/3D/PyLith/trunk/pylith/problems/Formulation.py
   short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
Log:
Fixed time step initialization.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2007-03-31 23:21:29 UTC (rev 6494)
+++ short/3D/PyLith/trunk/TODO	2007-03-31 23:48:14 UTC (rev 6495)
@@ -3,10 +3,7 @@
 ======================================================================
 
 Error checking
-  Add debug Pyre property to MeshIO
 
-  Add debug attribute to Mesh and extension module
-
   add isNull() assertions before using ALE::Obj.
 
   add check to material::initialize material dimension must match cell dimension

Modified: short/3D/PyLith/trunk/libsrc/feassemble/ExplicitElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ExplicitElasticity.cc	2007-03-31 23:21:29 UTC (rev 6494)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ExplicitElasticity.cc	2007-03-31 23:48:14 UTC (rev 6495)
@@ -303,6 +303,7 @@
   // Get parameters used in integration.
   const double dt = _dt;
   const double dt2 = dt*dt;
+  assert(dt > 0);
 
   // Get cell geometry information that doesn't depend on cell
   const int numQuadPts = _quadrature->numQuadPts();

Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorExplicit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorExplicit.cc	2007-03-31 23:21:29 UTC (rev 6494)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorExplicit.cc	2007-03-31 23:48:14 UTC (rev 6495)
@@ -20,8 +20,8 @@
 // Constructor
 pylith::feassemble::IntegratorExplicit::IntegratorExplicit(void) :
   Integrator(),
-  _dt(0.0),
-  _dtm1(0.0)
+  _dt(-1.0),
+  _dtm1(-1.0)
 { // constructor
 } // constructor
 
@@ -45,7 +45,10 @@
 void
 pylith::feassemble::IntegratorExplicit::timeStep(const double dt)
 { // timeStep
-  _dtm1 = _dt;
+  if (_dt != -1.0)
+    _dtm1 = _dt;
+  else
+    _dtm1 = dt;
   _dt = dt;
   assert(_dt == _dtm1); // For now, don't allow variable time step
 } // timeStep

Modified: short/3D/PyLith/trunk/pylith/feassemble/IntegratorExplicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/IntegratorExplicit.py	2007-03-31 23:21:29 UTC (rev 6494)
+++ short/3D/PyLith/trunk/pylith/feassemble/IntegratorExplicit.py	2007-03-31 23:48:14 UTC (rev 6495)
@@ -42,7 +42,7 @@
     """
     Set time step for advancing from time t to time t+dt.
     """
-    self.cppHandle.timeStep(t.value)
+    self.cppHandle.timeStep = t.value
     return
 
 

Modified: short/3D/PyLith/trunk/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Explicit.py	2007-03-31 23:21:29 UTC (rev 6494)
+++ short/3D/PyLith/trunk/pylith/problems/Explicit.py	2007-03-31 23:48:14 UTC (rev 6495)
@@ -66,7 +66,7 @@
     return
 
 
-  def initialize(self, mesh, materialsBin, spaceDim):
+  def initialize(self, mesh, materialsBin, spaceDim, dt):
     """
     Create explicit integrators for each element family.
     """
@@ -84,6 +84,7 @@
       integrator.setMesh(mesh)
       integrator.initQuadrature(material.quadrature)
       integrator.initMaterial(mesh, material)
+      integrator.timeStep(dt)
       self.integrators.append(integrator)
 
     self._info.log("Creating fields and matrices.")
@@ -127,6 +128,7 @@
     import pylith.topology.topology as bindings
     bindings.zeroRealSection(self.constant)
     for integrator in self.integrators:
+      integrator.timeStep(dt)
       integrator.integrateConstant(self.constant, self.dispT, self.dispTmdt)
 
     self._info.log("Solving equations.")

Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-03-31 23:21:29 UTC (rev 6494)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-03-31 23:48:14 UTC (rev 6495)
@@ -63,7 +63,7 @@
     return
 
 
-  def initialize(self, mesh, materials):
+  def initialize(self, mesh, materials, dimension, dt):
     """
     Create integrators for each element family.
     """

Modified: short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/TimeDependent.py	2007-03-31 23:21:29 UTC (rev 6494)
+++ short/3D/PyLith/trunk/pylith/problems/TimeDependent.py	2007-03-31 23:48:14 UTC (rev 6495)
@@ -91,7 +91,7 @@
     """
     self._info.log("Initializing problem.")
     self.mesh = mesh
-    self.formulation.initialize(mesh, self.materials, self.dimension)
+    self.formulation.initialize(mesh, self.materials, self.dimension, self.dt)
     return
 
 



More information about the cig-commits mailing list