[cig-commits] r16266 - in short/3D/PyLith/trunk: libsrc libsrc/problems modulesrc/problems pylith/problems

brad at geodynamics.org brad at geodynamics.org
Tue Feb 16 08:56:24 PST 2010


Author: brad
Date: 2010-02-16 08:56:23 -0800 (Tue, 16 Feb 2010)
New Revision: 16266

Added:
   short/3D/PyLith/trunk/libsrc/problems/Explicit.cc
   short/3D/PyLith/trunk/libsrc/problems/Explicit.hh
   short/3D/PyLith/trunk/libsrc/problems/Implicit.cc
   short/3D/PyLith/trunk/libsrc/problems/Implicit.hh
   short/3D/PyLith/trunk/modulesrc/problems/Explicit.i
   short/3D/PyLith/trunk/modulesrc/problems/Implicit.i
Modified:
   short/3D/PyLith/trunk/libsrc/Makefile.am
   short/3D/PyLith/trunk/libsrc/problems/Formulation.cc
   short/3D/PyLith/trunk/libsrc/problems/Formulation.hh
   short/3D/PyLith/trunk/libsrc/problems/Makefile.am
   short/3D/PyLith/trunk/libsrc/problems/problemsfwd.hh
   short/3D/PyLith/trunk/modulesrc/problems/Formulation.i
   short/3D/PyLith/trunk/modulesrc/problems/Makefile.am
   short/3D/PyLith/trunk/modulesrc/problems/problems.i
   short/3D/PyLith/trunk/pylith/problems/Explicit.py
   short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py
   short/3D/PyLith/trunk/pylith/problems/Formulation.py
   short/3D/PyLith/trunk/pylith/problems/Implicit.py
Log:
Setup computation of velocity field when needed.

Modified: short/3D/PyLith/trunk/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/Makefile.am	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/libsrc/Makefile.am	2010-02-16 16:56:23 UTC (rev 16266)
@@ -110,6 +110,8 @@
 	meshio/OutputSolnSubset.cc \
 	meshio/UCDFaultFile.cc \
 	problems/Formulation.cc \
+	problems/Explicit.cc \
+	problems/Implicit.cc \
 	problems/Solver.cc \
 	problems/SolverLinear.cc \
 	problems/SolverNonlinear.cc \

Added: short/3D/PyLith/trunk/libsrc/problems/Explicit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Explicit.cc	                        (rev 0)
+++ short/3D/PyLith/trunk/libsrc/problems/Explicit.cc	2010-02-16 16:56:23 UTC (rev 16266)
@@ -0,0 +1,105 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include <portinfo>
+
+#include "Explicit.hh" // implementation of class methods
+
+#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
+
+// ----------------------------------------------------------------------
+typedef pylith::topology::Mesh::SieveMesh SieveMesh;
+typedef pylith::topology::Mesh::RealSection RealSection;
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::problems::Explicit::Explicit(void)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::problems::Explicit::~Explicit(void)
+{ // destructor
+  deallocate();
+} // destructor
+
+// ----------------------------------------------------------------------
+// Compute velocity at time t.
+void
+pylith::problems::Explicit::_calcVelocity(void)
+{ // _calcVelocity
+  assert(0 != _fields);
+
+  // vel(t) = (disp(t+dt) - disp(t-dt)) / (2*dt)
+  //        = (dispIncr(t+dt) + disp(t) - disp(t-dt)) / (2*dt)
+  const double dt = _dt;
+
+  topology::Field<topology::Mesh>& dispIncr = _fields->get("dispIncr(t->t+dt)");
+  const spatialdata::geocoords::CoordSys* cs = dispIncr.mesh().coordsys();
+  assert(0 != cs);
+  const int spaceDim = cs->spaceDim();
+  
+  if (!_fields->hasField("velocity(t)")) {
+    _fields->add("velocity(t)", "velocity(t)");
+    topology::Field<topology::Mesh>& velocity = _fields->get("velocity(t)");
+    velocity.cloneSection(dispIncr);
+  } // if
+
+  // Get sections.
+  double_array dispIncrVertex(spaceDim);
+  const ALE::Obj<RealSection>& dispIncrSection = dispIncr.section();
+  assert(!dispIncrSection.isNull());
+	 
+  double_array dispTVertex(spaceDim);
+  const ALE::Obj<RealSection>& dispTSection = _fields->get("disp(t)").section();
+  assert(!dispTSection.isNull());
+
+  double_array dispTmdtVertex(spaceDim);
+  const ALE::Obj<RealSection>& dispTmdtSection =
+    _fields->get("disp(t-dt)").section();
+  assert(!dispTmdtSection.isNull());
+
+  double_array velocityVertex(spaceDim);
+  topology::Field<topology::Mesh>& velocity = _fields->get("velocity(t)");
+  const ALE::Obj<RealSection>& velocitySection = velocity.section();
+  assert(!velocitySection.isNull());
+
+  // Get mesh vertices.
+  const ALE::Obj<SieveMesh>& sieveMesh = dispIncr.mesh().sieveMesh();
+  assert(!sieveMesh.isNull());
+  const ALE::Obj<SieveMesh::label_sequence>& vertices = 
+    sieveMesh->depthStratum(0);
+  assert(!vertices.isNull());
+  const SieveMesh::label_sequence::iterator verticesBegin = vertices->begin();
+  const SieveMesh::label_sequence::iterator verticesEnd = vertices->end();
+  
+  for (SieveMesh::label_sequence::iterator v_iter=verticesBegin; 
+       v_iter != verticesEnd;
+       ++v_iter) {
+    dispIncrSection->restrictPoint(*v_iter, &dispIncrVertex[0],
+				   dispIncrVertex.size());
+    dispTSection->restrictPoint(*v_iter, &dispTVertex[0],
+				dispTVertex.size());
+    dispTmdtSection->restrictPoint(*v_iter, &dispTmdtVertex[0],
+				   dispTmdtVertex.size());
+    velocityVertex = (dispIncrVertex + dispTVertex - dispTmdtVertex) / (2.0 * dt);
+    
+    assert(velocitySection->getFiberDimension(*v_iter) == spaceDim);
+    velocitySection->updatePoint(*v_iter, &velocityVertex[0]);
+  } // for
+  PetscLogFlops(vertices->size() * spaceDim);
+
+} // _calcVelocity
+
+
+// End of file

Added: short/3D/PyLith/trunk/libsrc/problems/Explicit.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Explicit.hh	                        (rev 0)
+++ short/3D/PyLith/trunk/libsrc/problems/Explicit.hh	2010-02-16 16:56:23 UTC (rev 16266)
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file libsrc/problems/Explicit.hh
+ *
+ * @brief Object for explicit time integration.
+ */
+
+#if !defined(pylith_problems_explicit_hh)
+#define pylith_problems_explicit_hh
+
+// Include directives ---------------------------------------------------
+#include "Formulation.hh" // ISA Formulation
+
+// Explicit ---------------------------------------------------------
+/** @brief Object for explicit time integration.
+ *
+ * Explicit time stepping associated with dynamic problems.
+ */
+
+class pylith::problems::Explicit : public Formulation
+{ // Explicit
+  friend class TestExplicit; // unit testing
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public :
+
+  /// Constructor
+  Explicit(void);
+
+  /// Destructor
+  ~Explicit(void);
+
+// PROTECTED METHODS ////////////////////////////////////////////////////
+protected :
+
+  /// Compute velocity at time t.
+  void _calcVelocity(void);
+
+// NOT IMPLEMENTED //////////////////////////////////////////////////////
+private :
+
+  Explicit(const Explicit&); ///< Not implemented
+  const Explicit& operator=(const Explicit&); ///< Not implemented
+
+}; // Explicit
+
+#endif // pylith_problems_explicit_hh
+
+
+// End of file 

Modified: short/3D/PyLith/trunk/libsrc/problems/Formulation.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Formulation.cc	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/libsrc/problems/Formulation.cc	2010-02-16 16:56:23 UTC (rev 16266)
@@ -63,6 +63,14 @@
 } // fields
 
 // ----------------------------------------------------------------------
+// Get flag indicating whether we need to compute velocity at time t.
+bool
+pylith::problems::Formulation::needVelocity(void) const
+{ // needVelocity
+  return _needVelocity;
+} // needVelocity
+  
+// ----------------------------------------------------------------------
 // Set integrators over the mesh.
 void
 pylith::problems::Formulation::meshIntegrators(IntegratorMesh** integrators,

Modified: short/3D/PyLith/trunk/libsrc/problems/Formulation.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Formulation.hh	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/libsrc/problems/Formulation.hh	2010-02-16 16:56:23 UTC (rev 16266)
@@ -61,6 +61,12 @@
    */
   const topology::SolutionFields& fields(void) const;
 
+  /** Get flag indicating whether we need to compute velocity at time t.
+   *
+   * @returns True if velocity is needed, otherwise false.
+   */
+  bool needVelocity(void) const;
+  
   /** Set handles to integrators over the mesh.
    *
    * @param integrators Integrators over the mesh.
@@ -144,9 +150,16 @@
    */
   void adjustSolnLumped(void);
 
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
+// PROTECTED METHODS ////////////////////////////////////////////////////
+protected :
 
+  /// Compute velocity at time t.
+  virtual
+  void _calcVelocity(void) = 0;
+
+// PROTECTED MEMBERS ////////////////////////////////////////////////////
+protected :
+
   double _t; ///< Current time (nondimensional).
   double _dt; ///< Current time step (nondimensional).
   topology::Jacobian* _jacobian; ///< Handle to Jacobian of system.

Added: short/3D/PyLith/trunk/libsrc/problems/Implicit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Implicit.cc	                        (rev 0)
+++ short/3D/PyLith/trunk/libsrc/problems/Implicit.cc	2010-02-16 16:56:23 UTC (rev 16266)
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include <portinfo>
+
+#include "Implicit.hh" // implementation of class methods
+
+#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
+
+// ----------------------------------------------------------------------
+typedef pylith::topology::Mesh::SieveMesh SieveMesh;
+typedef pylith::topology::Mesh::RealSection RealSection;
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::problems::Implicit::Implicit(void)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::problems::Implicit::~Implicit(void)
+{ // destructor
+  deallocate();
+} // destructor
+
+// ----------------------------------------------------------------------
+// Compute velocity at time t.
+void
+pylith::problems::Implicit::_calcVelocity(void)
+{ // _calcVelocity
+  assert(0 != _fields);
+
+  // vel(t) = (disp(t+dt) - disp(t)) / dt
+  //        = dispIncr(t+dt) / dt
+  const double dt = _dt;
+
+  topology::Field<topology::Mesh>& dispIncr = _fields->get("dispIncr(t->t+dt)");
+  const spatialdata::geocoords::CoordSys* cs = dispIncr.mesh().coordsys();
+  assert(0 != cs);
+  const int spaceDim = cs->spaceDim();
+  
+  if (!_fields->hasField("velocity(t)")) {
+    _fields->add("velocity(t)", "velocity(t)");
+    topology::Field<topology::Mesh>& velocity = _fields->get("velocity(t)");
+    velocity.cloneSection(dispIncr);
+  } // if
+
+  // Get sections.
+  double_array dispIncrVertex(spaceDim);
+  const ALE::Obj<RealSection>& dispIncrSection = dispIncr.section();
+  assert(!dispIncrSection.isNull());
+	 
+  double_array velocityVertex(spaceDim);
+  topology::Field<topology::Mesh>& velocity = _fields->get("velocity(t)");
+  const ALE::Obj<RealSection>& velocitySection = velocity.section();
+  assert(!velocitySection.isNull());
+
+  // Get mesh vertices.
+  const ALE::Obj<SieveMesh>& sieveMesh = dispIncr.mesh().sieveMesh();
+  assert(!sieveMesh.isNull());
+  const ALE::Obj<SieveMesh::label_sequence>& vertices = 
+    sieveMesh->depthStratum(0);
+  assert(!vertices.isNull());
+  const SieveMesh::label_sequence::iterator verticesBegin = vertices->begin();
+  const SieveMesh::label_sequence::iterator verticesEnd = vertices->end();
+  
+  for (SieveMesh::label_sequence::iterator v_iter=verticesBegin; 
+       v_iter != verticesEnd;
+       ++v_iter) {
+    dispIncrSection->restrictPoint(*v_iter, &dispIncrVertex[0],
+				   dispIncrVertex.size());
+    velocityVertex = dispIncrVertex / dt;
+    
+    assert(velocitySection->getFiberDimension(*v_iter) == spaceDim);
+    velocitySection->updatePoint(*v_iter, &velocityVertex[0]);
+  } // for
+  PetscLogFlops(vertices->size() * spaceDim);
+
+} // _calcVelocity
+
+
+// End of file

Added: short/3D/PyLith/trunk/libsrc/problems/Implicit.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Implicit.hh	                        (rev 0)
+++ short/3D/PyLith/trunk/libsrc/problems/Implicit.hh	2010-02-16 16:56:23 UTC (rev 16266)
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file libsrc/problems/Implicit.hh
+ *
+ * @brief Object for implicit time integration.
+ */
+
+#if !defined(pylith_problems_implicit_hh)
+#define pylith_problems_implicit_hh
+
+// Include directives ---------------------------------------------------
+#include "Formulation.hh" // ISA Formulation
+
+// Implicit ---------------------------------------------------------
+/** @brief Object for implicit time integration.
+ *
+ * Implicit time stepping associated with quasi-static problems.
+ */
+
+class pylith::problems::Implicit : public Formulation
+{ // Implicit
+  friend class TestImplicit; // unit testing
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public :
+
+  /// Constructor
+  Implicit(void);
+
+  /// Destructor
+  ~Implicit(void);
+
+// PROTECTED METHODS ////////////////////////////////////////////////////
+protected :
+
+  /// Compute velocity at time t.
+  void _calcVelocity(void);
+
+// NOT IMPLEMENTED //////////////////////////////////////////////////////
+private :
+
+  Implicit(const Implicit&); ///< Not implemented
+  const Implicit& operator=(const Implicit&); ///< Not implemented
+
+}; // Implicit
+
+#endif // pylith_problems_implicit_hh
+
+
+// End of file 

Modified: short/3D/PyLith/trunk/libsrc/problems/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Makefile.am	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/libsrc/problems/Makefile.am	2010-02-16 16:56:23 UTC (rev 16266)
@@ -15,6 +15,8 @@
 
 subpkginclude_HEADERS = \
 	Formulation.hh \
+	Explicit.hh \
+	Implicit.hh \
 	Solver.hh \
 	SolverLinear.hh \
 	SolverNonlinear.hh \

Modified: short/3D/PyLith/trunk/libsrc/problems/problemsfwd.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/problemsfwd.hh	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/libsrc/problems/problemsfwd.hh	2010-02-16 16:56:23 UTC (rev 16266)
@@ -25,6 +25,8 @@
   namespace problems {
 
     class Formulation;
+    class Implicit;
+    class Explicit;
 
     class Solver;
     class SolverLinear;

Added: short/3D/PyLith/trunk/modulesrc/problems/Explicit.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/problems/Explicit.i	                        (rev 0)
+++ short/3D/PyLith/trunk/modulesrc/problems/Explicit.i	2010-02-16 16:56:23 UTC (rev 16266)
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file modulesrc/problems/Explicit.i
+ *
+ * @brief Python interface to C++ Explicit.
+ */
+
+namespace pylith {
+  namespace problems {
+
+    class Explicit : public Formulation
+    { // Explicit
+
+    // PUBLIC MEMBERS ///////////////////////////////////////////////////
+    public :
+
+      /// Constructor
+      Explicit(void);
+      
+      /// Destructor
+      ~Explicit(void);
+
+    // PROTECTED METHODS ////////////////////////////////////////////////
+    protected :
+
+      /// Compute velocity at time t.
+      void _calcVelocity(void);
+
+    }; // Explicit
+
+  } // problems
+} // pylith
+
+
+// End of file 

Modified: short/3D/PyLith/trunk/modulesrc/problems/Formulation.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/problems/Formulation.i	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/modulesrc/problems/Formulation.i	2010-02-16 16:56:23 UTC (rev 16266)
@@ -34,6 +34,18 @@
       /// Deallocate PETSc and local data structures.
       void deallocate(void);
   
+      /** Get solution fields.
+       *
+       * @returns solution fields.
+       */
+      const pylith::topology::SolutionFields& fields(void) const;
+
+      /** Get flag indicating whether we need to compute velocity at time t.
+       *
+       * @returns True if velocity is needed, otherwise false.
+       */
+      bool needVelocity(void) const;
+  
       /** Set handles to integrators over the mesh.
        *
        * @param integrators Integrators over the mesh.
@@ -107,6 +119,13 @@
        */
       void reformJacobianLumped(void);
 
+    // PROTECTED METHODS ////////////////////////////////////////////////
+    protected :
+      
+      /// Compute velocity at time t.
+      virtual
+      void _calcVelocity(void) = 0;
+
     }; // Formulation
 
   } // problems

Added: short/3D/PyLith/trunk/modulesrc/problems/Implicit.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/problems/Implicit.i	                        (rev 0)
+++ short/3D/PyLith/trunk/modulesrc/problems/Implicit.i	2010-02-16 16:56:23 UTC (rev 16266)
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file modulesrc/problems/Implicit.i
+ *
+ * @brief Python interface to C++ Implicit.
+ */
+
+namespace pylith {
+  namespace problems {
+
+    class Implicit : public Formulation
+    { // Implicit
+
+    // PUBLIC MEMBERS ///////////////////////////////////////////////////
+    public :
+
+      /// Constructor
+      Implicit(void);
+      
+      /// Destructor
+      ~Implicit(void);
+
+    // PROTECTED METHODS ////////////////////////////////////////////////
+    protected :
+
+      /// Compute velocity at time t.
+      void _calcVelocity(void);
+
+    }; // Implicit
+
+  } // problems
+} // pylith
+
+
+// End of file 

Modified: short/3D/PyLith/trunk/modulesrc/problems/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/modulesrc/problems/Makefile.am	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/modulesrc/problems/Makefile.am	2010-02-16 16:56:23 UTC (rev 16266)
@@ -20,6 +20,8 @@
 swig_sources = \
 	problems.i \
 	Formulation.i \
+	Explicit.i \
+	Implicit.i \
 	Solver.i \
 	SolverLinear.i \
 	SolverNonlinear.i

Modified: short/3D/PyLith/trunk/modulesrc/problems/problems.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/problems/problems.i	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/modulesrc/problems/problems.i	2010-02-16 16:56:23 UTC (rev 16266)
@@ -21,6 +21,8 @@
 #include "pylith/feassemble/feassemblefwd.hh" // USES Integrator
 
 #include "pylith/problems/Formulation.hh"
+#include "pylith/problems/Explicit.hh"
+#include "pylith/problems/Implicit.hh"
 #include "pylith/problems/Solver.hh"
 #include "pylith/problems/SolverLinear.hh"
 #include "pylith/problems/SolverNonlinear.hh"
@@ -42,6 +44,8 @@
 
 // Interfaces
 %include "Formulation.i"
+%include "Explicit.i"
+%include "Implicit.i"
 %include "Solver.i"
 %include "SolverLinear.i"
 %include "SolverNonlinear.i"

Modified: short/3D/PyLith/trunk/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Explicit.py	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/pylith/problems/Explicit.py	2010-02-16 16:56:23 UTC (rev 16266)
@@ -18,10 +18,11 @@
 ## Factory: pde_formulation
 
 from Formulation import Formulation
+from problems import Explicit as ModuleExplicit
 from pylith.utils.profiling import resourceUsageString
 
 # Explicit class
-class Explicit(Formulation):
+class Explicit(Formulation, ModuleExplicit):
   """
   Python Explicit object for solving equations using an explicit
   formulation.
@@ -46,6 +47,7 @@
     Constructor.
     """
     Formulation.__init__(self, name)
+    ModuleExplicit.__init__(self)
     self._loggingPrefix = "TSEx "
     return
 

Modified: short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py	2010-02-16 16:56:23 UTC (rev 16266)
@@ -19,10 +19,11 @@
 ## Factory: pde_formulation
 
 from Formulation import Formulation
+from problems import Explicit as ModuleExplicit
 from pylith.utils.profiling import resourceUsageString
 
 # ExplicitLumped class
-class ExplicitLumped(Formulation):
+class ExplicitLumped(Formulation, ModuleExplicit):
   """
   Python ExplicitLumped object for solving equations using an explicit
   formulation.
@@ -72,6 +73,7 @@
     Constructor.
     """
     Formulation.__init__(self, name)
+    ModuleExplicit.__init__(self)
     self._loggingPrefix = "TSEx "
     return
 

Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py	2010-02-16 16:56:23 UTC (rev 16266)
@@ -115,7 +115,7 @@
     Constructor.
     """
     PetscComponent.__init__(self, name, facility="formulation")
-    ModuleFormulation.__init__(self)
+    # ModuleFormulation constructor called in base clase
     self.integratorsMesh = None
     self.integratorsSubMesh = None
     self.constraints = None

Modified: short/3D/PyLith/trunk/pylith/problems/Implicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Implicit.py	2010-02-16 04:56:43 UTC (rev 16265)
+++ short/3D/PyLith/trunk/pylith/problems/Implicit.py	2010-02-16 16:56:23 UTC (rev 16266)
@@ -18,10 +18,11 @@
 ## Factory: pde_formulation
 
 from Formulation import Formulation
+from problems import Implicit as ModuleImplicit
 from pylith.utils.profiling import resourceUsageString
 
 # Implicit class
-class Implicit(Formulation):
+class Implicit(Formulation, ModuleImplicit):
   """
   Python Implicit object for solving equations using an implicit
   formulation.
@@ -88,6 +89,7 @@
     Constructor.
     """
     Formulation.__init__(self, name)
+    ModuleImplicit.__init__(self)
     self._loggingPrefix = "TSIm "
     self._stepCount = None
     return



More information about the CIG-COMMITS mailing list