Commits

Hong Zhang committed 1ffe713 Merge
  • Participants
  • Parent commits 124a335, f558c73

Comments (0)

Files changed (4)

File config/PETSc/packages/Prometheus.py

     args += 'RANLIB         = '+self.setCompilers.RANLIB+'\n'
     args += 'AR             = '+self.setCompilers.AR+'\n'
     args += 'ARFLAGS        = '+self.setCompilers.AR_FLAGS+'\n'
+    args += 'PROM_LIB       = libprometheus.'+ self.setCompilers.AR_LIB_SUFFIX+'\n'
+    args += 'FEI_LIB        = libpromfei.'+ self.setCompilers.AR_LIB_SUFFIX+'\n'
+
 
     self.framework.pushLanguage('C++')
     args += 'CXX            = '+self.framework.getCompiler()

File src/ksp/ksp/examples/tutorials/ex10.c

         while ( num_rhs-- ) {
 	  if (num_rhs == 1) VecSet(x,0.0);
           ierr = KSPSolve(ksp,b,x);CHKERRQ(ierr);
-	  VecView(x,PETSC_VIEWER_BINARY_WORLD);
-          ierr = VecAssemblyBegin(x);CHKERRQ(ierr);
-          ierr = VecAssemblyEnd(x);CHKERRQ(ierr);
         }
         ierr = KSPGetIterationNumber(ksp,&its);CHKERRQ(ierr);
         if (cknorm){   /* Check error for each rhs */

File src/ksp/pc/impls/redundant/redundant.c

   PetscErrorCode ierr;
   PetscMPIInt    rank;
   PetscTruth     iascii,isstring;
-  PetscViewer    sviewer,subviewer;
-  PetscInt       color = red->psubcomm->color;
+  PetscViewer    subviewer;
 
   PetscFunctionBegin;
   ierr = MPI_Comm_rank(((PetscObject)pc)->comm,&rank);CHKERRQ(ierr);
   ierr = PetscTypeCompare((PetscObject)viewer,PETSC_VIEWER_ASCII,&iascii);CHKERRQ(ierr);
   ierr = PetscTypeCompare((PetscObject)viewer,PETSC_VIEWER_STRING,&isstring);CHKERRQ(ierr);
   if (iascii) {
-    ierr = PetscViewerASCIIPrintf(viewer,"  Redundant preconditioner: First (color=0) of %D PCs follows\n",red->nsubcomm);CHKERRQ(ierr);
-    ierr = PetscViewerGetSubcomm(viewer,((PetscObject)red->pc)->comm,&subviewer);CHKERRQ(ierr);
-    if (!color) { /* only view first redundant pc */
-      ierr = PetscViewerASCIIPushTab(viewer);CHKERRQ(ierr);
-      ierr = KSPView(red->ksp,subviewer);CHKERRQ(ierr);
-      ierr = PetscViewerASCIIPopTab(viewer);CHKERRQ(ierr);
+    if (!red->psubcomm) {
+      ierr = PetscViewerASCIIPrintf(viewer,"  Redundant preconditioner: Not yet setup\n");CHKERRQ(ierr);
+    } else {
+      ierr = PetscViewerASCIIPrintf(viewer,"  Redundant preconditioner: First (color=0) of %D PCs follows\n",red->nsubcomm);CHKERRQ(ierr);
+      ierr = PetscViewerGetSubcomm(viewer,((PetscObject)red->pc)->comm,&subviewer);CHKERRQ(ierr);
+      if (red->psubcomm->color) { /* only view first redundant pc */
+	ierr = PetscViewerASCIIPushTab(viewer);CHKERRQ(ierr);
+	ierr = KSPView(red->ksp,subviewer);CHKERRQ(ierr);
+	ierr = PetscViewerASCIIPopTab(viewer);CHKERRQ(ierr);
+      }
+      ierr = PetscViewerRestoreSubcomm(viewer,((PetscObject)red->pc)->comm,&subviewer);CHKERRQ(ierr);
     }
-    ierr = PetscViewerRestoreSubcomm(viewer,((PetscObject)red->pc)->comm,&subviewer);CHKERRQ(ierr);
-  } else if (isstring) { /* not test it yet! */
+  } else if (isstring) { 
     ierr = PetscViewerStringSPrintf(viewer," Redundant solver preconditioner");CHKERRQ(ierr);
-    ierr = PetscViewerGetSingleton(viewer,&sviewer);CHKERRQ(ierr);
-    if (!rank) {
-      ierr = KSPView(red->ksp,sviewer);CHKERRQ(ierr);
-    }
-    ierr = PetscViewerRestoreSingleton(viewer,&sviewer);CHKERRQ(ierr);
   } else {
     SETERRQ1(PETSC_ERR_SUP,"Viewer type %s not supported for PC redundant",((PetscObject)viewer)->type_name);
   }

File src/ts/impls/implicit/gl/gl.c

   PetscErrorCode  ierr;
 
   PetscFunctionBegin;
+  if (ts->problem_type == TS_LINEAR) {
+    SETERRQ(PETSC_ERR_ARG_WRONG,"Only for nonlinear problems");
+  }
   gl->setupcalled = PETSC_TRUE;
   ierr = TSGLGetMaxSizes(ts,&max_r,&max_s);CHKERRQ(ierr);
   ierr = VecDuplicateVecs(ts->vec_sol,max_r,&gl->X);CHKERRQ(ierr);
   ts->ops->step           = TSStep_GL;
   ts->ops->setfromoptions = TSSetFromOptions_GL;
 
+  ts->problem_type = TS_NONLINEAR;
   ierr = SNESCreate(((PetscObject)ts)->comm,&ts->snes);CHKERRQ(ierr);
   ierr = PetscObjectIncrementTabLevel((PetscObject)ts->snes,(PetscObject)ts,1);CHKERRQ(ierr);