[cig-commits] r20725 - in short/3D/PyLith/branches/v1.7-stable: libsrc/pylith/problems modulesrc/problems

brad at geodynamics.org brad at geodynamics.org
Tue Sep 18 10:16:14 PDT 2012


Author: brad
Date: 2012-09-18 10:16:13 -0700 (Tue, 18 Sep 2012)
New Revision: 20725

Modified:
   short/3D/PyLith/branches/v1.7-stable/libsrc/pylith/problems/SolverLinear.cc
   short/3D/PyLith/branches/v1.7-stable/libsrc/pylith/problems/SolverNonlinear.cc
   short/3D/PyLith/branches/v1.7-stable/modulesrc/problems/Formulation.i
Log:
Code cleanup.

Modified: short/3D/PyLith/branches/v1.7-stable/libsrc/pylith/problems/SolverLinear.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-stable/libsrc/pylith/problems/SolverLinear.cc	2012-09-18 15:11:23 UTC (rev 20724)
+++ short/3D/PyLith/branches/v1.7-stable/libsrc/pylith/problems/SolverLinear.cc	2012-09-18 17:16:13 UTC (rev 20725)
@@ -108,6 +108,7 @@
   _logger->eventEnd(scatterEvent);
   _logger->eventBegin(setupEvent);
 
+
   PetscErrorCode err = 0;
   const PetscMat jacobianMat = jacobian->matrix();
   if (!jacobian->valuesChanged()) {
@@ -125,32 +126,6 @@
   const ALE::Obj<SieveMesh>& sieveMesh = solution->mesh().sieveMesh();
   assert(!sieveMesh.isNull());
 
-#if 0 // OBSOLETE? Replaced by stuff in Solver?
-  if (solutionSection->getNumSpaces() > sieveMesh->getDimension() &&
-      _jacobianPCFault) {
-    
-    PetscPC pc = 0;
-    PCCompositeType ctype;
-    
-    err = KSPSetUp(_ksp); CHECK_PETSC_ERROR(err);
-    err = KSPGetPC(_ksp, &pc); CHECK_PETSC_ERROR(err);
-    err = PCFieldSplitGetType(pc, &ctype); CHECK_PETSC_ERROR(err);
-    if (ctype != PC_COMPOSITE_SCHUR) {
-      PetscKSP    *ksps = 0;
-      PylithInt    num  = 0;
-      PetscMat     A    = 0;
-      MatStructure flag;
-
-      err = PCFieldSplitGetSubKSP(pc, &num, &ksps); CHECK_PETSC_ERROR(err);
-      err = KSPGetOperators(ksps[num-1], &A, PETSC_NULL, &flag);CHECK_PETSC_ERROR(err);
-      err = PetscObjectReference((PetscObject) A);CHECK_PETSC_ERROR(err);
-      err = KSPSetOperators(ksps[num-1], A, _jacobianPCFault, flag);CHECK_PETSC_ERROR(err);
-      err = PetscFree(ksps);CHECK_PETSC_ERROR(err);
-    }
-  } // if
-#endif
-
-
   const PetscVec residualVec = residual.vector();
   const PetscVec solutionVec = solution->vector();
 

Modified: short/3D/PyLith/branches/v1.7-stable/libsrc/pylith/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-stable/libsrc/pylith/problems/SolverNonlinear.cc	2012-09-18 15:11:23 UTC (rev 20724)
+++ short/3D/PyLith/branches/v1.7-stable/libsrc/pylith/problems/SolverNonlinear.cc	2012-09-18 17:16:13 UTC (rev 20725)
@@ -170,7 +170,7 @@
   Formulation* formulation = (Formulation*) context;
   assert(0 != formulation);
 
-  // Make sure we have an admissible Lagrange force (\lambda)
+  // Make sure we have an admissible Lagrange multiplier (\lambda)
   formulation->constrainSolnSpace(&tmpSolutionVec);
 
   // Reform residual

Modified: short/3D/PyLith/branches/v1.7-stable/modulesrc/problems/Formulation.i
===================================================================
--- short/3D/PyLith/branches/v1.7-stable/modulesrc/problems/Formulation.i	2012-09-18 15:11:23 UTC (rev 20724)
+++ short/3D/PyLith/branches/v1.7-stable/modulesrc/problems/Formulation.i	2012-09-18 17:16:13 UTC (rev 20725)
@@ -159,6 +159,12 @@
        */
       void reformJacobianLumped(void);
 
+      /** Constrain solution space.
+       *
+       * @param tmpSolutionVec Temporary PETSc vector for solution.
+       */
+      void constrainSolnSpace(const PetscVec* tmpSolutionVec);
+
       /// Compute rate fields (velocity and/or acceleration) at time t.
       virtual
       void calcRateFields(void) = 0;



More information about the CIG-COMMITS mailing list