[cig-commits] r14370 - short/3D/PyLith/branches/pylith-swig/libsrc/problems
brad at geodynamics.org
brad at geodynamics.org
Tue Mar 17 14:36:35 PDT 2009
Author: brad
Date: 2009-03-17 14:36:35 -0700 (Tue, 17 Mar 2009)
New Revision: 14370
Modified:
short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.cc
short/3D/PyLith/branches/pylith-swig/libsrc/problems/Solver.cc
short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverLinear.hh
Log:
A little work on the formulation.
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.cc 2009-03-17 20:33:23 UTC (rev 14369)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/problems/Formulation.cc 2009-03-17 21:36:35 UTC (rev 14370)
@@ -54,11 +54,7 @@
PetscVec localVec;
PetscErrorCode err = 0;
-#if 0
- PetscVecScatter scatter = fields->scatter();
-#else
- VecScatter scatter = 0;
-#endif
+ PetscVecScatter scatter = args->fields->scatter();
// Copy solution information from PETSc vector into field
const ALE::Obj<topology::Mesh::RealSection>& solutionSection =
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/problems/Solver.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/problems/Solver.cc 2009-03-17 20:33:23 UTC (rev 14369)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/problems/Solver.cc 2009-03-17 21:36:35 UTC (rev 14370)
@@ -16,12 +16,9 @@
#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
-#include <petscksp.h> // USES PetscKSP
-
// ----------------------------------------------------------------------
// Constructor
-pylith::problems::Solver::Solver(void) :
- _ksp(0)
+pylith::problems::Solver::Solver(void)
{ // constructor
} // constructor
@@ -29,10 +26,6 @@
// Destructor
pylith::problems::Solver::~Solver(void)
{ // destructor
- if (0 != _ksp) {
- PetscErrorCode err = KSPDestroy(_ksp); _ksp = 0;
- CHECK_PETSC_ERROR(err);
- } // if
} // destructor
// ----------------------------------------------------------------------
@@ -49,16 +42,6 @@
topology::Field<topology::Mesh>& residual = fields->get("residual");
residual.createVector();
-
- PetscErrorCode err = 0;
-
- if (0 != _ksp) {
- err = KSPDestroy(_ksp); _ksp = 0;
- CHECK_PETSC_ERROR(err);
- } // if
- err = KSPCreate(fields->mesh().comm(), &_ksp); CHECK_PETSC_ERROR(err);
-
- err = KSPSetFromOptions(_ksp); CHECK_PETSC_ERROR(err);
} // initialize
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverLinear.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverLinear.hh 2009-03-17 20:33:23 UTC (rev 14369)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/problems/SolverLinear.hh 2009-03-17 21:36:35 UTC (rev 14370)
@@ -49,6 +49,13 @@
*/
void initialGuessNonzero(bool flag);
+ /** Initialize solver.
+ *
+ * @param fields Solution fields.
+ */
+ void
+ initialize(topology::SolutionFields* fields);
+
/** Solve the system.
*
* @param solution Solution field.
More information about the CIG-COMMITS
mailing list