[petsc-users] odd SNES behavior

Barry Smith bsmith at mcs.anl.gov
Wed Mar 6 17:32:39 CST 2013


On Mar 6, 2013, at 4:31 PM, "Mark F. Adams" <mark.adams at columbia.edu> wrote:

>> 
>> It looks like SNES is not getting set it's "master" Jacobian.  If you run the same code with hypre does it also hit this create?
> 
> 
> MatCreate_MFFD is called just once with gamg and hypre.  It looks like Cheby is using the outside operator instead of the pre_op.  This could be desirable but I don't want it here.  I'll keep digging.

  PCSetUp_MG() has the following chunk of code

  /* If user did not provide fine grid operators OR operator was not updated since last global KSPSetOperators() */
  /* so use those from global PC */
  /* Is this what we always want? What if user wants to keep old one? */
  ierr = KSPGetOperatorsSet(mglevels[n-1]->smoothd,NULL,&opsset);CHKERRQ(ierr);
  if (opsset) {
    Mat mmat;
    ierr = KSPGetOperators(mglevels[n-1]->smoothd,NULL,&mmat,NULL);CHKERRQ(ierr);
    if (mmat == pc->pmat) opsset = PETSC_FALSE;
  }
  if (!opsset) {
    ierr = PetscInfo(pc,"Using outer operators to define finest grid operator \n  because PCMGGetSmoother(pc,nlevels-1,&ksp);KSPSetOperators(ksp,...); was not called.\n");CHKERRQ(ierr);
    ierr = KSPSetOperators(mglevels[n-1]->smoothd,pc->mat,pc->pmat,pc->flag);CHKERRQ(ierr);
  }

  Presumbly when you call PCReset() it zeros out all the pointers. If you do not set the operators on the finest level again then it will use the "outer" operator on the smoothest level. Is this the problem?

   Barry







More information about the petsc-users mailing list