[cig-commits] r19010 - in short/3D/PyLith/branches/v1.6-revisedfault: libsrc/pylith/faults libsrc/pylith/problems libsrc/pylith/topology pylith/bc pylith/faults pylith/feassemble pylith/friction pylith/materials pylith/meshio tests/2d/frictionslide

brad at geodynamics.org brad at geodynamics.org
Tue Oct 4 11:28:29 PDT 2011


Author: brad
Date: 2011-10-04 11:28:29 -0700 (Tue, 04 Oct 2011)
New Revision: 19010

Modified:
   short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc
   short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/problems/SolverNonlinear.cc
   short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/topology/SubMesh.cc
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/bc/BoundaryCondition.py
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/bc/DirichletBC.py
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/faults/Fault.py
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/feassemble/FIATLagrange.py
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/feassemble/FIATSimplex.py
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/friction/FrictionModel.py
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/materials/Material.py
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTK.py
   short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/OutputSolnSubset.py
   short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/pylithapp.cfg
   short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/ratestate.cfg
   short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/ratestate_stable.cfg
Log:
Merge from stable.

Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc	2011-10-04 18:28:29 UTC (rev 19010)
@@ -1604,7 +1604,7 @@
     residual.createScatter(solution.mesh());
   } // if
 
-  if (!_fields->hasField("sensitivity dispRel")) {
+  if (!_fields->hasField("sensitivity relative disp")) {
     _fields->add("sensitivity relative disp", "sensitivity_relative_disp");
     topology::Field<topology::SubMesh>& dispRel =
         _fields->get("sensitivity relative disp");

Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/problems/SolverNonlinear.cc	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/problems/SolverNonlinear.cc	2011-10-04 18:28:29 UTC (rev 19010)
@@ -40,31 +40,6 @@
 typedef pylith::topology::Mesh::SieveMesh SieveMesh;
 typedef pylith::topology::Mesh::RealSection RealSection;
 
-namespace pylith {
-  namespace problems {
-    namespace _SolverNonlinear {
-
-      // From PETSc header file src/snes/impls/ls/lsimpl.h
-      // This file is buried in the source directory so we don't have
-      // access to it using pre-processor flags (i.e., -I$DIR).
-      typedef struct {
-	PetscErrorCode           (*LineSearch)(PetscSNES,void*,PetscVec,PetscVec,PetscVec,PetscReal,PetscReal,PetscVec,PetscVec,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) */
-	PetscViewer  monitor;
-	PetscReal damping;
-      } SNES_LS;
-    } // _SolverNonlinear
-  } // problems
-} // pylith
-
 // ----------------------------------------------------------------------
 // Constructor
 pylith::problems::SolverNonlinear::SolverNonlinear(void) :
@@ -265,8 +240,7 @@
   // 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)
@@ -274,30 +248,38 @@
 #endif
   PetscErrorCode ierr;
   PetscInt       count;
-  SNES_LS        *neP = (SNES_LS*)snes->data;
-  PetscBool     changed_w = PETSC_FALSE,changed_y = PETSC_FALSE;
+  PetscBool      changed_w = PETSC_FALSE,changed_y = PETSC_FALSE;
+  MPI_Comm       comm;
 
   PetscFunctionBegin;
+  ierr = PetscObjectGetComm((PetscObject)snes,&comm);CHKERRQ(ierr);
   ierr = PetscLogEventBegin(SNES_LineSearch,snes,x,f,g);CHKERRQ(ierr);
   *flag   = PETSC_TRUE;
 
   ierr = VecNorm(y,NORM_2,ynorm);CHKERRQ(ierr);
-  if (!*ynorm) {
-    ierr = PetscInfo(snes,"Search direction and size is 0\n");CHKERRQ(ierr);
+  if (*ynorm == 0.0) {
+    if (snes->ls_monitor) {
+      ierr = PetscViewerASCIIAddTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(snes->ls_monitor,"    Line search: Initial direction and size is 0\n");CHKERRQ(ierr);
+      ierr = PetscViewerASCIISubtractTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+    }
     *gnorm = fnorm;
     ierr   = VecCopy(x,w);CHKERRQ(ierr);
     ierr   = VecCopy(f,g);CHKERRQ(ierr);
     *flag  = PETSC_FALSE;
     goto theend1;
   }
-  if (*ynorm > neP->maxstep) {	/* Step too big, so scale back */
-    ierr = PetscInfo2(snes,"Scaling step by %G old ynorm %G\n",
-		      neP->maxstep/(*ynorm),*ynorm);CHKERRQ(ierr);
-    ierr = VecScale(y,neP->maxstep/(*ynorm));CHKERRQ(ierr);
-    *ynorm = neP->maxstep;
+  if (*ynorm > snes->maxstep) {	/* Step too big, so scale back */
+    if (snes->ls_monitor) {
+      ierr = PetscViewerASCIIAddTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(snes->ls_monitor,"    Line search: Scaling step by %14.12e old ynorm %14.12e\n",(double)(snes->maxstep/(*ynorm)),(double)(*ynorm));CHKERRQ(ierr);
+      ierr = PetscViewerASCIISubtractTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+    }
+    ierr = VecScale(y,snes->maxstep/(*ynorm));CHKERRQ(ierr);
+    *ynorm = snes->maxstep;
   }
   ierr      = VecMaxPointwiseDivide(y,x,&rellength);CHKERRQ(ierr);
-  minlambda = neP->minlambda/rellength;
+  minlambda = snes->steptol/rellength;
   ierr      = MatMult(snes->jacobian,y,w);CHKERRQ(ierr);
 #if defined(PETSC_USE_COMPLEX)
   ierr      = VecDot(f,w,&cinitslope);CHKERRQ(ierr);
@@ -310,43 +292,36 @@
 
   ierr = VecWAXPY(w,-1.0,y,x);CHKERRQ(ierr);
   if (snes->nfuncs >= snes->max_funcs) {
-    ierr  = PetscInfo(snes,"Exceeded maximum function evaluations, "
-		      "while checking full step length!\n");CHKERRQ(ierr);
+    ierr  = PetscInfo(snes,"Exceeded maximum function evaluations, while checking full step length!\n");CHKERRQ(ierr);
     *flag = PETSC_FALSE;
     snes->reason = SNES_DIVERGED_FUNCTION_COUNT;
     goto theend1;
-  } // if
-  // TEMPORARY: update w?
-
+  }
   ierr = SNESComputeFunction(snes,w,g);CHKERRQ(ierr);
   if (snes->domainerror) {
     ierr = PetscLogEventEnd(SNES_LineSearch,snes,x,f,g);CHKERRQ(ierr);
     PetscFunctionReturn(0);
   }
   ierr = VecNorm(g,NORM_2,gnorm);CHKERRQ(ierr);
-  if (PetscIsInfOrNanReal(*gnorm))
-    SETERRQ(PETSC_COMM_SELF,
-	    PETSC_ERR_FP, "User provided compute function generated a "
-	    "Not-a-Number");
-  ierr = PetscInfo2(snes,"Initial fnorm %G gnorm %G\n",fnorm,*gnorm);CHKERRQ(ierr);
-  if (.5*(*gnorm)*(*gnorm) <= .5*fnorm*fnorm + neP->alpha*initslope) {
-    // Sufficient reduction
-    ierr = PetscInfo2(snes,"Using full step: fnorm %G gnorm %G\n",
-		      fnorm,*gnorm);CHKERRQ(ierr);
+  if (PetscIsInfOrNanReal(*gnorm)) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_FP,"User provided compute function generated a Not-a-Number");
+  ierr = PetscInfo2(snes,"Initial fnorm %14.12e gnorm %14.12e\n",(double)fnorm,(double)*gnorm);CHKERRQ(ierr);
+  if (.5*(*gnorm)*(*gnorm) <= .5*fnorm*fnorm + snes->ls_alpha*initslope) { /* Sufficient reduction */
+    if (snes->ls_monitor) {
+      ierr = PetscViewerASCIIAddTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(snes->ls_monitor,"    Line search: Using full step: fnorm %14.12e gnorm %14.12e\n",(double)fnorm,(double)*gnorm);CHKERRQ(ierr);
+      ierr = PetscViewerASCIISubtractTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+    }
     goto theend1;
-  } // if
+  }
 
-  // Fit points with quadratic
+  /* Fit points with quadratic */
   lambda     = 1.0;
   lambdatemp = -initslope/((*gnorm)*(*gnorm) - fnorm*fnorm - 2.0*initslope);
   lambdaprev = lambda;
   gnormprev  = *gnorm;
-  if (lambdatemp > .5*lambda)
-    lambdatemp = .5*lambda;
-  if (lambdatemp <= .1*lambda)
-    lambda = .1*lambda; 
-  else
-    lambda = lambdatemp;
+  if (lambdatemp > .5*lambda)  lambdatemp = .5*lambda;
+  if (lambdatemp <= .1*lambda) lambda = .1*lambda; 
+  else                         lambda = lambdatemp;
 
   ierr  = VecWAXPY(w,-lambda,y,x);CHKERRQ(ierr);
   if (snes->nfuncs >= snes->max_funcs) {
@@ -354,41 +329,45 @@
     *flag = PETSC_FALSE;
     snes->reason = SNES_DIVERGED_FUNCTION_COUNT;
     goto theend1;
-  } // if
-  // TEMPORARY: update w?
-
+  }
   ierr = SNESComputeFunction(snes,w,g);CHKERRQ(ierr);
   if (snes->domainerror) {
     ierr = PetscLogEventEnd(SNES_LineSearch,snes,x,f,g);CHKERRQ(ierr);
     PetscFunctionReturn(0);
-  } // if
+  }
   ierr = VecNorm(g,NORM_2,gnorm);CHKERRQ(ierr);
-  if (PetscIsInfOrNanReal(*gnorm)) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_FP,"User provided compute function generated a Not-a-Number");
-  ierr = PetscInfo1(snes,"gnorm after quadratic fit %G\n",*gnorm);CHKERRQ(ierr);
-  if (.5*(*gnorm)*(*gnorm) < .5*fnorm*fnorm + lambda*neP->alpha*initslope) { /* sufficient reduction */
-    ierr = PetscInfo1(snes,"Quadratically determined step, lambda=%18.16e\n",lambda);CHKERRQ(ierr);
+  if (PetscIsInfOrNanReal(*gnorm)) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_FP,"User provided compute function generated a Not-a-Number");
+  if (snes->ls_monitor) {
+    ierr = PetscViewerASCIIAddTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(snes->ls_monitor,"    Line search: gnorm after quadratic fit %14.12e\n",(double)*gnorm);CHKERRQ(ierr);
+    ierr = PetscViewerASCIISubtractTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+  }
+  if (.5*(*gnorm)*(*gnorm) < .5*fnorm*fnorm + lambda*snes->ls_alpha*initslope) { /* sufficient reduction */
+    if (snes->ls_monitor) {
+      ierr = PetscViewerASCIIAddTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(snes->ls_monitor,"    Line search: Quadratically determined step, lambda=%18.16e\n",lambda);CHKERRQ(ierr);
+      ierr = PetscViewerASCIISubtractTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+    }
     goto theend1;
-  } // if
+  }
 
-  // Fit points with cubic
+  /* Fit points with cubic */
   count = 1;
   while (PETSC_TRUE) {
     if (lambda <= minlambda) { 
-      ierr = PetscInfo1(snes,"Unable to find good step length! After %D "
-			"tries \n",count);CHKERRQ(ierr);
-      ierr = PetscInfo6(snes,"fnorm=%18.16e, gnorm=%18.16e, ynorm=%18.16e, "
-			"minlambda=%18.16e, lambda=%18.16e, "
-			"initial slope=%18.16e\n",
-			fnorm,*gnorm,*ynorm,minlambda,lambda,initslope);
-      CHKERRQ(ierr);
-      ierr = PetscInfo1(snes,"Using last lambda tried %g\n",lambda);CHKERRQ(ierr);
+      if (snes->ls_monitor) {
+        ierr = PetscViewerASCIIAddTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+	ierr = PetscViewerASCIIPrintf(snes->ls_monitor,"    Line search: unable to find good step length! After %D tries \n",count);CHKERRQ(ierr);
+	ierr = PetscViewerASCIIPrintf(snes->ls_monitor,"    Line search: fnorm=%18.16e, gnorm=%18.16e, ynorm=%18.16e, minlambda=%18.16e, lambda=%18.16e, initial slope=%18.16e\n",(double)fnorm,(double)*gnorm,(double)*ynorm,(double)minlambda,(double)lambda,(double)initslope);CHKERRQ(ierr);
+        ierr = PetscViewerASCIISubtractTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
+      }
+      *flag = PETSC_FALSE; 
       break;
     }
     t1 = .5*((*gnorm)*(*gnorm) - fnorm*fnorm) - lambda*initslope;
     t2 = .5*(gnormprev*gnormprev  - fnorm*fnorm) - lambdaprev*initslope;
     a  = (t1/(lambda*lambda) - t2/(lambdaprev*lambdaprev))/(lambda-lambdaprev);
-    b  = (-lambdaprev*t1/(lambda*lambda) + 
-	  lambda*t2/(lambdaprev*lambdaprev))/(lambda-lambdaprev);
+    b  = (-lambdaprev*t1/(lambda*lambda) + lambda*t2/(lambdaprev*lambdaprev))/(lambda-lambdaprev);
     d  = b*b - 3*a*initslope;
     if (d < 0.0) d = 0.0;
     if (a == 0.0) {
@@ -426,67 +405,51 @@
 
     ierr  = VecWAXPY(w,-lambda,y,x);CHKERRQ(ierr);
     if (snes->nfuncs >= snes->max_funcs) {
-      ierr = PetscInfo1(snes,"Exceeded maximum function evaluations, "
-			"while looking for good step length! %D \n",count);
-      CHKERRQ(ierr);
-      ierr = PetscInfo5(snes,"fnorm=%18.16e, gnorm=%18.16e, ynorm=%18.16e, "
-			"lambda=%18.16e, initial slope=%18.16e\n",
-			fnorm,*gnorm,*ynorm,lambda,initslope);CHKERRQ(ierr);
+      ierr = PetscInfo1(snes,"Exceeded maximum function evaluations, while looking for good step length! %D \n",count);CHKERRQ(ierr);
+      ierr = PetscInfo5(snes,"fnorm=%18.16e, gnorm=%18.16e, ynorm=%18.16e, lambda=%18.16e, initial slope=%18.16e\n",fnorm,*gnorm,*ynorm,lambda,initslope);CHKERRQ(ierr);
       *flag = PETSC_FALSE;
       snes->reason = SNES_DIVERGED_FUNCTION_COUNT;
       break;
-    } // if
-    // TEMPORARY: update w?
-
+    }
     ierr = SNESComputeFunction(snes,w,g);CHKERRQ(ierr);
     if (snes->domainerror) {
       ierr = PetscLogEventEnd(SNES_LineSearch,snes,x,f,g);CHKERRQ(ierr);
       PetscFunctionReturn(0);
-    } // if
+    }
     ierr = VecNorm(g,NORM_2,gnorm);CHKERRQ(ierr);
-    if (PetscIsInfOrNanReal(*gnorm))
-      SETERRQ(PETSC_COMM_SELF, 
-	      PETSC_ERR_FP,"User provided compute function generated a "
-	      "Not-a-Number");
-    if (.5*(*gnorm)*(*gnorm) < .5*fnorm*fnorm + lambda*neP->alpha*initslope) {
-      // is reduction enough?
-      ierr = PetscInfo2(snes,"Cubically determined step, current gnorm %G "
-			"lambda=%18.16e\n",*gnorm,lambda);CHKERRQ(ierr);
+    if (PetscIsInfOrNanReal(*gnorm)) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_FP,"User provided compute function generated a Not-a-Number");
+    if (.5*(*gnorm)*(*gnorm) < .5*fnorm*fnorm + lambda*snes->ls_alpha*initslope) { /* is reduction enough? */
+      if (snes->ls_monitor) {
+	ierr = PetscPrintf(comm,"    Line search: Cubically determined step, current gnorm %14.12e lambda=%18.16e\n",(double)*gnorm,(double)lambda);CHKERRQ(ierr);
+      }
       break;
     } else {
-      ierr = PetscInfo2(snes,"Cubic step no good, shrinking lambda, "
-			"current gnorem %G lambda=%18.16e\n",
-			*gnorm,lambda);CHKERRQ(ierr);
-    } // if/else
+      if (snes->ls_monitor) {
+        ierr = PetscPrintf(comm,"    Line search: Cubic step no good, shrinking lambda, current gnorm %12.12e lambda=%18.16e\n",(double)*gnorm,(double)lambda);CHKERRQ(ierr);
+      }
+    }
     count++;
-  } // while
-
+  }
   theend1:
   /* Optional user-defined check for line search step validity */
-  if (neP->postcheckstep && *flag) {
-    ierr = (*neP->postcheckstep)(snes,x,y,w,neP->postcheck,&changed_y,
-				 &changed_w);CHKERRQ(ierr);
-    if (changed_y)
+  if (snes->ops->postcheckstep && *flag) {
+    ierr = (*snes->ops->postcheckstep)(snes,x,y,w,snes->postcheck,&changed_y,&changed_w);CHKERRQ(ierr);
+    if (changed_y) {
       ierr = VecWAXPY(w,-1.0,y,x);CHKERRQ(ierr);
-    // TEMPORARY: update w?
-
-    if (changed_y || changed_w) {
-      // recompute the function if the step has changed 
+    }
+    if (changed_y || changed_w) { /* recompute the function if the step has changed */
       ierr = SNESComputeFunction(snes,w,g);CHKERRQ(ierr);
       if (snes->domainerror) {
         ierr = PetscLogEventEnd(SNES_LineSearch,snes,x,f,g);CHKERRQ(ierr);
         PetscFunctionReturn(0);
       }
       ierr = VecNormBegin(g,NORM_2,gnorm);CHKERRQ(ierr);
-      if (PetscIsInfOrNanReal(*gnorm))
-	SETERRQ(PETSC_COMM_SELF, 
-		PETSC_ERR_FP, "User provided compute function generated a "
-		"Not-a-Number");
+      if (PetscIsInfOrNanReal(*gnorm)) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_FP,"User provided compute function generated a Not-a-Number");
       ierr = VecNormBegin(y,NORM_2,ynorm);CHKERRQ(ierr);
       ierr = VecNormEnd(g,NORM_2,gnorm);CHKERRQ(ierr);
       ierr = VecNormEnd(y,NORM_2,ynorm);CHKERRQ(ierr);
-    } // if
-  } // if
+    }
+  }
   ierr = PetscLogEventEnd(SNES_LineSearch,snes,x,f,g);CHKERRQ(ierr);
 
   // ======================================================================

Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/topology/SubMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/topology/SubMesh.cc	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/topology/SubMesh.cc	2011-10-04 18:28:29 UTC (rev 19010)
@@ -17,7 +17,6 @@
 //
 
 #include <portinfo>
-#include <stdexcept>
 
 #include "SubMesh.hh" // implementation of class methods
 
@@ -25,6 +24,8 @@
 
 #include <Selection.hh> // USES ALE::Selection
 
+#include "pylith/utils/petscerror.h" // USES CHECK_PETSC_ERROR
+
 #include <stdexcept> // USES std::runtime_error
 #include <sstream> // USES std::ostringstream
 #include <cassert> // USES assert()
@@ -140,7 +141,12 @@
   std::string meshLabel = "subdomain_" + std::string(label);
   _mesh->setName(meshLabel);
 
-  if (sieve->getMaxConeSize() <= 0) {
+  int maxConeSizeLocal = sieve->getMaxConeSize();
+  int maxConeSize = 0;
+  int err = MPI_Allreduce(&maxConeSizeLocal, &maxConeSize, 1, MPI_INT, MPI_MAX,
+			  sieve->comm()); CHECK_PETSC_ERROR(err);
+
+  if (maxConeSize <= 0) {
     std::ostringstream msg;
     msg << "Error while creating submesh. Submesh '" 
 	<< label << "' does not contain any cells.\n"

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/bc/BoundaryCondition.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/bc/BoundaryCondition.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/bc/BoundaryCondition.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -147,7 +147,7 @@
       ModuleBoundaryCondition.label(self, self.inventory.label)
       self.upDir = map(float, self.inventory.upDir)
       self.perfLogger = self.inventory.perfLogger
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring boundary condition "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/bc/DirichletBC.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/bc/DirichletBC.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/bc/DirichletBC.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -117,7 +117,7 @@
     try:
       BoundaryCondition._configure(self)
       TimeDependentPoints._configure(self)
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring Dirichlet boundary condition "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/faults/Fault.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/faults/Fault.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/faults/Fault.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -233,7 +233,7 @@
       ModuleFault.id(self, self.inventory.matId)
       ModuleFault.label(self, self.inventory.faultLabel)
       self.perfLogger = self.inventory.perfLogger
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring fault "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/feassemble/FIATLagrange.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/feassemble/FIATLagrange.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/feassemble/FIATLagrange.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -414,7 +414,7 @@
       
       if self.order == -1:
         self.order = self.degree+1
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring quadrature "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/feassemble/FIATSimplex.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/feassemble/FIATSimplex.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/feassemble/FIATSimplex.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -165,7 +165,7 @@
       self.order = self.inventory.order
       if self.order == -1:
         self.order = self.degree
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring quadrature "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/friction/FrictionModel.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/friction/FrictionModel.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/friction/FrictionModel.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -128,7 +128,7 @@
         self.dbInitialState(self.inventory.dbInitialState)
 
       self.perfLogger = self.inventory.perfLogger
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring friction model "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/materials/Material.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/materials/Material.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/materials/Material.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -191,7 +191,7 @@
 
       self.quadrature = self.inventory.quadrature
       self.perfLogger = self.inventory.perfLogger
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring material "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTK.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTK.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTK.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -90,7 +90,7 @@
     """
     try:
       DataWriter._configure(self)
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring VTK output "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/OutputSolnSubset.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/OutputSolnSubset.py	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/OutputSolnSubset.py	2011-10-04 18:28:29 UTC (rev 19010)
@@ -158,7 +158,7 @@
         ModuleOutputSolnSubset.vertexFilter(self, self.inventory.vertexFilter)
       if not isinstance(self.inventory.cellFilter, NullComponent):
         ModuleOutputSolnSubset.cellFilter(self, self.inventory.cellFilter)
-    except ValueError as err:
+    except ValueError, err:
       aliases = ", ".join(self.aliases)
       raise ValueError("Error while configuring output over boundary "
                        "(%s):\n%s" % (aliases, err.message))

Modified: short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/pylithapp.cfg	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/pylithapp.cfg	2011-10-04 18:28:29 UTC (rev 19010)
@@ -42,9 +42,6 @@
 normalizer.length_scale = 1.0*m
 normalizer.relaxation_time = 1.0*s
 
-interfaces = [fault]
-materials = [elastic]
-
 [pylithapp.timedependent.implicit]
 solver = pylith.problems.SolverNonlinear
 
@@ -55,6 +52,9 @@
 # ----------------------------------------------------------------------
 # materials
 # ----------------------------------------------------------------------
+[pylithapp.timedependent]
+materials = [elastic]
+
 [pylithapp.timedependent.materials]
 elastic = pylith.materials.ElasticPlaneStrain
 
@@ -73,6 +73,9 @@
 # ----------------------------------------------------------------------
 # faults
 # ----------------------------------------------------------------------
+[pylithapp.timedependent]
+interfaces = [fault]
+
 [pylithapp.timedependent.interfaces]
 fault = pylith.faults.FaultCohesiveDyn
 
@@ -126,6 +129,6 @@
 
 [pylithapp.timedependent.materials.elastic.output]
 cell_info_fields = []
-#cell_data_fields = []
+cell_data_fields = []
 #cell_filter = pylith.meshio.CellFilterAvgMesh
 writer = pylith.meshio.DataWriterHDF5Mesh

Modified: short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/ratestate.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/ratestate.cfg	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/ratestate.cfg	2011-10-04 18:28:29 UTC (rev 19010)
@@ -2,14 +2,11 @@
 [pylithapp]
 
 # ----------------------------------------------------------------------
-# problem
+# boundary conditions
 # ----------------------------------------------------------------------
 [pylithapp.timedependent]
 bc = [ypos,yneg]
 
-# ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
 [pylithapp.timedependent.bc]
 ypos = pylith.bc.DirichletBC
 yneg = pylith.bc.DirichletBC
@@ -43,6 +40,7 @@
 # ----------------------------------------------------------------------
 # faults
 # ----------------------------------------------------------------------
+[pylithapp.timedependent.interfaces.fault]
 db_initial_tractions = spatialdata.spatialdb.UniformDB
 db_initial_tractions.label = Initial fault tractions
 db_initial_tractions.values = [traction-shear,traction-normal]

Modified: short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/ratestate_stable.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/ratestate_stable.cfg	2011-10-04 18:24:59 UTC (rev 19009)
+++ short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/ratestate_stable.cfg	2011-10-04 18:28:29 UTC (rev 19010)
@@ -12,6 +12,7 @@
 # ----------------------------------------------------------------------
 [pylithapp.timedependent.interfaces.fault]
 friction = pylith.friction.RateStateAgeing
+friction.label = Rate state ageing
 
 # Set the friction model parameters.
 #  reference coefficient of friction: 0.6



More information about the CIG-COMMITS mailing list