[cig-commits] r18130 - short/3D/PyLith/branches/v1.5-stable/libsrc/problems

brad at geodynamics.org brad at geodynamics.org
Wed Mar 23 17:57:40 PDT 2011


Author: brad
Date: 2011-03-23 17:57:39 -0700 (Wed, 23 Mar 2011)
New Revision: 18130

Modified:
   short/3D/PyLith/branches/v1.5-stable/libsrc/problems/SolverNonlinear.cc
Log:
Switched from use of include from src to private snes include for line search stuff.

Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/problems/SolverNonlinear.cc	2011-03-23 20:09:28 UTC (rev 18129)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/problems/SolverNonlinear.cc	2011-03-24 00:57:39 UTC (rev 18130)
@@ -34,8 +34,29 @@
 #define isnan std::isnan // TEMPORARY
 #define isinf std::isinf // TEMPORARY
 
-#include "../src/snes/impls/ls/lsimpl.h"
+#include <private/snesimpl.h>
 
+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) :
@@ -191,6 +212,8 @@
   // 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;



More information about the CIG-COMMITS mailing list