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

brad at geodynamics.org brad at geodynamics.org
Tue Mar 1 19:21:06 PST 2011


Author: brad
Date: 2011-03-01 19:21:06 -0800 (Tue, 01 Mar 2011)
New Revision: 18004

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/problems/SolverNonlinear.cc
Log:
Eliminated use of PETSc source level header files.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2011-03-02 02:27:31 UTC (rev 18003)
+++ short/3D/PyLith/trunk/TODO	2011-03-02 03:21:06 UTC (rev 18004)
@@ -2,6 +2,10 @@
 CURRENT ISSUES/PRIORITIES (1.6.0)
 ======================================================================
 
+* Memory model
+
+  Memory is not being tracked for distribution.
+
 * GenMaxwellQpQs
 
   How to define viscosity and combinations?????
@@ -11,7 +15,7 @@
   FaultCohesiveLagrange::calcPreconditioner() [need unit test]
 
   propagate use of field split from SolverLinear to SolverNonlinear [MATT]
-    make sure we reform the preconditioner when we reform the Jacobian
+    custom fault preconditioner is not being computed
 
 * Unform global refinement
 

Modified: short/3D/PyLith/trunk/libsrc/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/SolverNonlinear.cc	2011-03-02 02:27:31 UTC (rev 18003)
+++ short/3D/PyLith/trunk/libsrc/problems/SolverNonlinear.cc	2011-03-02 03:21:06 UTC (rev 18004)
@@ -34,12 +34,33 @@
 #define isnan std::isnan // TEMPORARY
 #define isinf std::isinf // TEMPORARY
 
-#include "../src/snes/impls/ls/lsimpl.h"
+#include <private/snesimpl.h>
 
 // ----------------------------------------------------------------------
 typedef pylith::topology::Mesh::SieveMesh SieveMesh;
 typedef pylith::topology::Mesh::RealSection RealSection;
 
+namespace pylith {
+  namespace problems {
+    namespace _SolverNonlinear {
+
+      typedef struct {
+	PetscErrorCode           (*LineSearch)(PetscSNES,void*,PetscVec,PetscVec,PetscVec,PetscVec,PetscVec,PetscReal,PetscReal,PetscReal*,PetscReal*,PetscBool *);
+	void                     *lsP;                              /* user-defined line-search context (optional) */
+	/* --------------- Parameters used by line search method ----------------- */
+	PetscReal                alpha;                                                                  /* used to determine sufficient reduction */
+	PetscReal                maxstep;                                                          /* maximum step size */
+	PetscReal                minlambda;                                                        /* determines smallest line search lambda used */
+	PetscErrorCode           (*precheckstep)(PetscSNES,PetscVec,PetscVec,void*,PetscBool *);                  /* step-checking routine (optional) */
+	void                     *precheck;                                                        /* user-defined step-checking context (optional) */
+	PetscErrorCode           (*postcheckstep)(PetscSNES,PetscVec,PetscVec,PetscVec,void*,PetscBool *,PetscBool *); /* step-checking routine (optional) */
+	void                     *postcheck;                                                       /* user-defined step-checking context (optional) */
+	PetscViewerASCIIMonitor  monitor;
+      } SNES_LS;
+    } // _SolverNonlinear
+  } // problems
+} // pylith
+
 // ----------------------------------------------------------------------
 // Constructor
 pylith::problems::SolverNonlinear::SolverNonlinear(void) :
@@ -237,7 +258,9 @@
   // minimization problem:
   // min  z(x):  R^n -> R,
   // where z(x) = .5 * fnorm*fnorm, and fnorm = || f ||_2.
-        
+ 
+  typedef pylith::problems::_SolverNonlinear::SNES_LS SNES_LS;
+       
   PetscReal      initslope,lambdaprev,gnormprev,a,b,d,t1,t2,rellength;
   PetscReal      minlambda,lambda,lambdatemp;
 #if defined(PETSC_USE_COMPLEX)



More information about the CIG-COMMITS mailing list