[cig-commits] r14726 - in short/3D/PyLith/branches/pylith-swig: . libsrc/problems libsrc/topology modulesrc/problems modulesrc/topology pylith/problems tests/1d/line2

brad at geodynamics.org brad at geodynamics.org
Wed Apr 15 17:26:32 PDT 2009


Author: brad
Date: 2009-04-15 17:26:31 -0700 (Wed, 15 Apr 2009)
New Revision: 14726

Modified:
   short/3D/PyLith/branches/pylith-swig/TODO
   short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.hh
   short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverNonlinear.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverNonlinear.hh
   short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.hh
   short/3D/PyLith/branches/pylith-swig/libsrc/topology/SolutionFields.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/topology/SolutionFields.hh
   short/3D/PyLith/branches/pylith-swig/modulesrc/problems/Formulation.i
   short/3D/PyLith/branches/pylith-swig/modulesrc/topology/SolutionFields.i
   short/3D/PyLith/branches/pylith-swig/pylith/problems/Explicit.py
   short/3D/PyLith/branches/pylith-swig/pylith/problems/Implicit.py
   short/3D/PyLith/branches/pylith-swig/tests/1d/line2/axialextension.cfg
Log:
Worked on interface with SNES. Need to fix formulations so that we have consistent incremental and regular displacement fields. Residual and Jacobian should be formed using the incremental field and the normal field for compatibility with SNES.

Modified: short/3D/PyLith/branches/pylith-swig/TODO
===================================================================
--- short/3D/PyLith/branches/pylith-swig/TODO	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/TODO	2009-04-16 00:26:31 UTC (rev 14726)
@@ -14,6 +14,11 @@
 
     Analytical solutions, time stepping, multiple faults
 
+  (3) SNES
+    Reformulate implicit time stepping to use displacement increment.
+    Solution fields should be disp(t) and dispIncr(t).
+    If solnIncr is true, Dirichlet BC set increment values in dispIncr(t).
+
   (4) Faults
     Use visitors in FaultCohesiveKin
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.cc	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.cc	2009-04-16 00:26:31 UTC (rev 14726)
@@ -90,13 +90,16 @@
 // ----------------------------------------------------------------------
 // Reform system residual.
 void
-pylith::problems::Formulation::reformResidual(void)
+pylith::problems::Formulation::reformResidual(const PetscVec tmpResidualVec,
+					      const PetscVec tmpSolveSolnVec)
 { // reformResidual
   assert(0 != _fields);
 
   // Update section view of field.
-  topology::Field<topology::Mesh>& solution = _fields->solution();
-  solution.scatterVectorToSection();
+  if (0 != tmpSolveSolnVec) {
+    topology::Field<topology::Mesh>& solveSoln = _fields->solveSoln();
+    solveSoln.scatterVectorToSection(tmpSolveSolnVec);
+  } // if
 
   // Set residual to zero.
   topology::Field<topology::Mesh>& residual = _fields->get("residual");
@@ -124,26 +127,33 @@
     _meshIntegrators[i]->integrateResidualAssembled(residual, _t, _fields);
   numIntegrators = _submeshIntegrators.size();
   for (int i=0; i < numIntegrators; ++i)
-    _submeshIntegrators[i]->integrateResidual(residual, _t, _fields);
+    _submeshIntegrators[i]->integrateResidualAssembled(residual, _t, _fields);
 
   // Update PETSc view of residual
-  residual.scatterSectionToVector();
+  if (0 != tmpResidualVec)
+    residual.scatterSectionToVector(tmpResidualVec);
+  else
+    residual.scatterSectionToVector();
 
-  // TODO: Move this to SolverLinear
-  VecScale(residual.vector(), -1.0);
+  // TODO: Move this to SolverLinear 
+  //residual *= -1.0;
+  if (0 != tmpResidualVec)
+    VecScale(tmpResidualVec, -1.0);
 } // reformResidual
 
 // ----------------------------------------------------------------------
 // Reform system Jacobian.
 void
-pylith::problems::Formulation::reformJacobian(void)
+pylith::problems::Formulation::reformJacobian(const PetscVec tmpSolveSolnVec)
 { // reformJacobian
   assert(0 != _jacobian);
   assert(0 != _fields);
 
   // Update section view of field.
-  topology::Field<topology::Mesh>& solution = _fields->solution();
-  solution.scatterVectorToSection();
+  if (0 != tmpSolveSolnVec) {
+    topology::Field<topology::Mesh>& solveSoln = _fields->solveSoln();
+    solveSoln.scatterVectorToSection(tmpSolveSolnVec);
+  } // if
 
   // Set residual to zero.
   _jacobian->zero();

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.hh	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.hh	2009-04-16 00:26:31 UTC (rev 14726)
@@ -80,11 +80,19 @@
 		      const double t,
 		      const double dt);
 
-  /// Reform system residual.
-  void reformResidual(void);
+  /** Reform system residual.
+   *
+   * @param tmpResidualVec Temporary PETSc vector for residual.
+   * @param tmpSolveSolnVec Temporary PETSc vector for solution.
+   */
+  void reformResidual(const PetscVec tmpResidualVec =0,
+		      const PetscVec tmpSolveSolnVec =0);
   
-  /// Reform system Jacobian.
-  void reformJacobian(void);
+  /* Reform system Jacobian.
+   *
+   * @param tmpSolveSolnVec Temporary PETSc vector for solution.
+   */
+  void reformJacobian(const PetscVec tmpSolveSolnVec =0);
 
 // PRIVATE MEMBERS //////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverNonlinear.cc	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverNonlinear.cc	2009-04-16 00:26:31 UTC (rev 14726)
@@ -83,22 +83,19 @@
 // Solve the system.
 void
 pylith::problems::SolverNonlinear::solve(
-			      topology::Field<topology::Mesh>* solution,
+			      topology::Field<topology::Mesh>* solveSoln,
 			      const topology::Jacobian& jacobian,
 			      const topology::Field<topology::Mesh>& residual)
 { // solve
-  assert(0 != solution);
+  assert(0 != solveSoln);
 
   PetscErrorCode err = 0;
 
-  const PetscVec residualVec = residual.vector();
-  const PetscVec solutionVec = solution->vector();
-  MatView(jacobian.matrix(), PETSC_VIEWER_STDOUT_WORLD);
-  err = SNESSolve(_snes, PETSC_NULL, solutionVec); CHECK_PETSC_ERROR(err);
-  VecView(solutionVec, PETSC_VIEWER_STDOUT_WORLD);
-
+  const PetscVec solveSolnVec = solveSoln->vector();
+  err = SNESSolve(_snes, PETSC_NULL, solveSolnVec); CHECK_PETSC_ERROR(err);
+  
   // Update section view of field.
-  solution->scatterVectorToSection();
+  solveSoln->scatterVectorToSection();
 } // solve
 
 // ----------------------------------------------------------------------
@@ -106,8 +103,8 @@
 // PETSc SNES solvers.
 PetscErrorCode
 pylith::problems::SolverNonlinear::reformResidual(PetscSNES snes,
-						  PetscVec solutionVec,
-						  PetscVec residualVec,
+						  PetscVec tmpSolutionVec,
+						  PetscVec tmpResidualVec,
 						  void* context)
 { // reformResidual
   assert(0 != context);
@@ -115,8 +112,7 @@
   assert(0 != formulation);
 
   // Reform residual
-  formulation->reformResidual();
-  VecView(residualVec, PETSC_VIEWER_STDOUT_WORLD);
+  formulation->reformResidual(tmpResidualVec, tmpSolutionVec);
 
   return 0;
 } // reformResidual
@@ -126,7 +122,7 @@
 // PETSc SNES solvers.
 PetscErrorCode
 pylith::problems::SolverNonlinear::reformJacobian(PetscSNES snes,
-						  PetscVec solutionVec,
+						  PetscVec tmpSolutionVec,
 						  PetscMat* jacobianMat,
 						  PetscMat* preconditionerMat,
 						  MatStructure* preconditionerLayout,
@@ -136,7 +132,7 @@
   Formulation* formulation = (Formulation*) context;
   assert(0 != formulation);
 
-  formulation->reformJacobian();
+  formulation->reformJacobian(tmpSolutionVec);
 
   return 0;
 } // reformJacobian

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverNonlinear.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverNonlinear.hh	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverNonlinear.hh	2009-04-16 00:26:31 UTC (rev 14726)
@@ -59,11 +59,11 @@
 
   /** Solve the system.
    *
-   * @param solution Solution field.
+   * @param solveSoln Field to solve for.
    * @param jacobian Jacobian of the system.
    * @param residual Residual field.
    */
-  void solve(topology::Field<topology::Mesh>* solution,
+  void solve(topology::Field<topology::Mesh>* solveSoln,
 	     const topology::Jacobian& jacobian,
 	     const topology::Field<topology::Mesh>& residual);
 
@@ -71,22 +71,22 @@
    * PETSc SNES solvers.
    *
    * @param snes PETSc scalable nonlinear equation solver.
-   * @param solutionVec PETSc vector for solution.
-   * @param residualVec PETSc vector for residual.
+   * @param tmpSolveSolnVec Temporary PETSc vector for solution.
+   * @param tmpResidualVec Temporary PETSc vector for residual.
    * @param context ArgsResidual structure with arguments.
    * @returns PETSc error code.
    */
   static
   PetscErrorCode reformResidual(PetscSNES snes,
-				PetscVec solutionVec,
-				PetscVec residualVec,
+				PetscVec tmpSolveSolnVec,
+				PetscVec tmpResidualVec,
 				void* context);
 
   /** Generic C interface for reformJacobian for integration with
    * PETSc SNES solvers.
    *
    * @param snes PETSc scalable nonlinear equation solver.
-   * @param solutionVec PETSc vector for solution.
+   * @param tmpSolveSolnVec Temporary PETSc vector for solution.
    * @param jacobianMat PETSc sparse matrix for system Jacobian.
    * @param preconditionerMat PETSc sparse matrix for preconditioner.
    * @param Flag indicating layout of preconditioner matrix.
@@ -95,7 +95,7 @@
    */
   static
   PetscErrorCode reformJacobian(PetscSNES snes,
-				PetscVec solutionVec,
+				PetscVec tmpSolveSolnVec,
 				PetscMat* jacobianMat,
 				PetscMat* preconditionerMat,
 				MatStructure* preconditionerLayout,

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.cc	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.cc	2009-04-16 00:26:31 UTC (rev 14726)
@@ -476,18 +476,30 @@
 void
 pylith::topology::Field<mesh_type>::scatterSectionToVector(void) const
 { // scatterSectionToVector
+  assert(0 != _vector);
+
+  scatterSectionToVector(_vector);
+} // scatterSectionToVector
+
+// ----------------------------------------------------------------------
+// Scatter section information across processors to update the
+//  PETSc vector view of the field.
+template<typename mesh_type>
+void
+pylith::topology::Field<mesh_type>::scatterSectionToVector(const PetscVec vector) const
+{ // scatterSectionToVector
   assert(!_section.isNull());
   assert(0 != _scatter);
-  assert(0 != _vector);
+  assert(0 != vector);
 
   PetscErrorCode err = 0;
   PetscVec localVec = 0;
   err = VecCreateSeqWithArray(PETSC_COMM_SELF,
 			      _section->sizeWithBC(), _section->restrictSpace(),
 			      &localVec); CHECK_PETSC_ERROR(err);
-  err = VecScatterBegin(_scatter, localVec, _vector,
+  err = VecScatterBegin(_scatter, localVec, vector,
 			INSERT_VALUES, SCATTER_FORWARD); CHECK_PETSC_ERROR(err);
-  err = VecScatterEnd(_scatter, localVec, _vector,
+  err = VecScatterEnd(_scatter, localVec, vector,
 		      INSERT_VALUES, SCATTER_FORWARD); CHECK_PETSC_ERROR(err);
   err = VecDestroy(localVec); CHECK_PETSC_ERROR(err);
 } // scatterSectionToVector
@@ -499,18 +511,30 @@
 void
 pylith::topology::Field<mesh_type>::scatterVectorToSection(void) const
 { // scatterVectorToSection
+  assert(0 != _vector);
+
+  scatterVectorToSection(_vector);
+} // scatterVectorToSection
+
+// ----------------------------------------------------------------------
+// Scatter PETSc vector information across processors to update the
+// section view of the field.
+template<typename mesh_type>
+void
+pylith::topology::Field<mesh_type>::scatterVectorToSection(const PetscVec vector) const
+{ // scatterVectorToSection
   assert(!_section.isNull());
   assert(0 != _scatter);
-  assert(0 != _vector);
+  assert(0 != vector);
 
   PetscErrorCode err = 0;
   PetscVec localVec = 0;
   err = VecCreateSeqWithArray(PETSC_COMM_SELF,
 			      _section->sizeWithBC(), _section->restrictSpace(),
 			      &localVec); CHECK_PETSC_ERROR(err);
-  err = VecScatterBegin(_scatter, _vector, localVec,
+  err = VecScatterBegin(_scatter, vector, localVec,
 			INSERT_VALUES, SCATTER_REVERSE); CHECK_PETSC_ERROR(err);
-  err = VecScatterEnd(_scatter, _vector, localVec,
+  err = VecScatterEnd(_scatter, vector, localVec,
 		      INSERT_VALUES, SCATTER_REVERSE); CHECK_PETSC_ERROR(err);
   err = VecDestroy(localVec); CHECK_PETSC_ERROR(err);
 } // scatterVectorToSection

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.hh	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.hh	2009-04-16 00:26:31 UTC (rev 14726)
@@ -230,10 +230,24 @@
   /// PETSc vector view of the field.
   void scatterSectionToVector(void) const;
 
+  /** Scatter section information across processors to update the
+   * PETSc vector view of the field.
+   *
+   * @param vector PETSc vector to update.
+   */
+  void scatterSectionToVector(const PetscVec vector) const;
+
   /// Scatter PETSc vector information across processors to update the
   /// Sieve section view of the field.
   void scatterVectorToSection(void) const;
 
+  /** Scatter section information across processors to update the
+   * PETSc vector view of the field.
+   *
+   * @param vector PETSc vector used in update.
+   */
+  void scatterVectorToSection(const PetscVec vector) const;
+
 // PRIVATE MEMBERS //////////////////////////////////////////////////////
 private :
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/SolutionFields.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/SolutionFields.cc	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/SolutionFields.cc	2009-04-16 00:26:31 UTC (rev 14726)
@@ -20,7 +20,8 @@
 // Default constructor.
 pylith::topology::SolutionFields::SolutionFields(const Mesh& mesh) :
   Fields<Field<Mesh> >(mesh),
-  _solutionName("")
+  _solutionName(""),
+  _solveSolnName("")
 { // constructor
 } // constructor
 
@@ -68,6 +69,43 @@
 } // solution
 
 // ----------------------------------------------------------------------
+// Set field used in the solve.
+void
+pylith::topology::SolutionFields::solveSolnName(const char* name)
+{ // solveSolnName
+  map_type::const_iterator iter = _fields.find(name);
+  if (iter == _fields.end()) {
+    std::ostringstream msg;
+    msg << "Cannot use unknown field '" << name 
+	<< "' when setting name of field used in solve.";
+    throw std::runtime_error(msg.str());
+  } // if
+  _solveSolnName = name;
+} // solveSolnName
+
+// ----------------------------------------------------------------------
+// Get solveSoln field.
+const pylith::topology::Field<pylith::topology::Mesh>&
+pylith::topology::SolutionFields::solveSoln(void) const
+{ // solveSoln
+  if (_solveSolnName == "")
+    throw std::runtime_error("Cannot retrieve solve field. Name of solve "
+			     "field has not been specified.");
+  return get(_solveSolnName.c_str());
+} // solveSoln
+
+// ----------------------------------------------------------------------
+// Get solveSoln field.
+pylith::topology::Field<pylith::topology::Mesh>&
+pylith::topology::SolutionFields::solveSoln(void)
+{ // solveSoln
+  if (_solveSolnName == "")
+    throw std::runtime_error("Cannot retrieve solve field. Name of solve "
+			     "field has not been specified.");
+  return get(_solveSolnName.c_str());
+} // solveSoln
+
+// ----------------------------------------------------------------------
 // Create history manager for a subset of the managed fields.
 void
 pylith::topology::SolutionFields::createHistory(const char* const* fields,

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/SolutionFields.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/SolutionFields.hh	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/SolutionFields.hh	2009-04-16 00:26:31 UTC (rev 14726)
@@ -46,24 +46,42 @@
   /// Destructor.
   ~SolutionFields(void);
 
-  /** Set name of solution field.
+  /** Set name of field for the current solution.
    *
-   * @param name Name of field that is the solution.
+   * @param name Name of field that holds the solution.
    */
   void solutionName(const char* name);
 
-  /** Get solution field.
+  /** Get current solution field.
    *
    * @returns Solution field.
    */
   const Field<Mesh>& solution(void) const;
 
-  /** Get solution field.
+  /** Get current solution field.
    *
    * @returns Solution field.
    */
   Field<Mesh>& solution(void);
 
+  /** Set name of field that will be used in the solve.
+   *
+   * @param name Name of field used in the solve.
+   */
+  void solveSolnName(const char* name);
+
+  /** Get field used in the solve.
+   *
+   * @returns Field used in the solve.
+   */
+  const Field<Mesh>& solveSoln(void) const;
+
+  /** Get field used in the solve.
+   *
+   * @returns Field used in the solve.
+   */
+  Field<Mesh>& solveSoln(void);
+
   /** Create history manager for a subset of the managed fields.
    *
    * @param fields Fields in history (first is most recent).
@@ -83,9 +101,15 @@
 
   PetscVecScatter _scatter; /// Petsc vector scatter.
 
-  /// Name of field that corresponds to the solution.
+  /// Name of field that corresponds to the "working" solution to the
+  /// problem.
   std::string _solutionName;
 
+  /// Name of field used in the solve (solution of the solve).  This
+  /// may be an increment that is applied to the "working" solutio to
+  /// form the complete solution.
+  std::string _solveSolnName;
+
   /// History manager for a subset of the fields
   std::vector<std::string> _history;
 

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/problems/Formulation.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/problems/Formulation.i	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/problems/Formulation.i	2009-04-16 00:26:31 UTC (rev 14726)
@@ -60,12 +60,20 @@
 			  const double t,
 			  const double dt);
       
-      /// Reform system residual.
-      void reformResidual(void);
+      /** Reform system residual.
+       *
+       * @param tmpResidualVec Temporary PETSc vector for residual.
+       * @param tmpSolveSolnVec Temporary PETSc vector for solution.
+       */
+      void reformResidual(const PetscVec tmpResidualVec =0,
+			  const PetscVec tmpSolveSolnVec =0);
       
-      /// Reform system Jacobian.
-      void reformJacobian(void);
-
+      /* Reform system Jacobian.
+       *
+       * @param tmpSolveSolnVec Temporary PETSc vector for solution.
+       */
+      void reformJacobian(const PetscVec tmpSolveSolnVec =0);
+      
     }; // Formulation
 
   } // problems

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/topology/SolutionFields.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/topology/SolutionFields.i	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/topology/SolutionFields.i	2009-04-16 00:26:31 UTC (rev 14726)
@@ -54,6 +54,24 @@
        */
       Field<Mesh>& solution(void);
       
+      /** Set name of field that will be used in the solve.
+       *
+       * @param name Name of field used in the solve.
+       */
+      void solveSolnName(const char* name);
+      
+      /** Get field used in the solve.
+       *
+       * @returns Field used in the solve.
+       */
+      const Field<Mesh>& solveSoln(void) const;
+      
+      /** Get field used in the solve.
+       *
+       * @returns Field used in the solve.
+       */
+      Field<Mesh>& solveSoln(void);
+
       /** Create history manager for a subset of the managed fields.
        *
        * @param fields Fields in history (first is most recent).

Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/Explicit.py	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/Explicit.py	2009-04-16 00:26:31 UTC (rev 14726)
@@ -74,6 +74,7 @@
     self.fields.add("residual")
     self.fields.createHistory(["disp(t+dt), disp(t), disp(t-dt)"])    
     self.fields.copyLayout("disp(t)")
+    self.fields.solveSolnName("disp(t+dt)")
     self._debug.log(resourceUsageString())
 
     # Create Petsc vectors for fields involved in solve
@@ -136,7 +137,7 @@
     
     self._info.log("Solving equations.")
     residual = self.fields.get("residual")
-    dispTpdt = self.fields.get("disp(t+dt)")
+    dispTpdt = self.fields.solveSoln()
     self.solver.solve(dispTpdt, self.jacobian, residual)
 
     self._logger.eventEnd(logEvent)

Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/Implicit.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/Implicit.py	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/Implicit.py	2009-04-16 00:26:31 UTC (rev 14726)
@@ -97,6 +97,7 @@
     self.fields.add("dispIncr(t)", "displacement increment")
     self.fields.add("residual", "residual")
     self.fields.copyLayout("disp(t), bc(t+dt)")
+    self.fields.solveSolnName("dispIncr(t)")
     self._debug.log(resourceUsageString())
 
     self._info.log("Creating Jacobian matrix.")
@@ -179,7 +180,7 @@
     logEvent = "%sstep" % self._loggingPrefix
     self._logger.eventBegin(logEvent)
 
-    dispIncr = self.fields.get("dispIncr(t)")
+    dispIncr = self.fields.solveSoln()
     dispIncr.zero()
 
     ### NONLINEAR: This moves under SNES control as IntegrateResidual()

Modified: short/3D/PyLith/branches/pylith-swig/tests/1d/line2/axialextension.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-swig/tests/1d/line2/axialextension.cfg	2009-04-15 23:14:06 UTC (rev 14725)
+++ short/3D/PyLith/branches/pylith-swig/tests/1d/line2/axialextension.cfg	2009-04-16 00:26:31 UTC (rev 14726)
@@ -34,7 +34,7 @@
 dimension = 1
 bc = [bc]
 
-formulation.solver = pylith.problems.SolverNonlinear
+#formulation.solver = pylith.problems.SolverNonlinear
 
 [axialextension.timedependent.formulation.time_step]
 total_time = 0.0*s



More information about the CIG-COMMITS mailing list