[petsc-dev] LSC question

Barry Smith bsmith at mcs.anl.gov
Fri Mar 9 09:29:51 CST 2012


On Mar 8, 2012, at 4:49 PM, Jed Brown wrote:

> On Thu, Mar 8, 2012 at 15:40, Barry Smith <bsmith at mcs.anl.gov> wrote:
> But the LSC_L reflects properties of the true operator while LSC_Lp reflects properties of the matrix from which you build the preconditioner.
> 
> Only if you used -pc_fieldsplit_real_diagonal. My concern is that pc->mat is a MatSchurComplement that is not likely to be made by the user (the user never has access to it in PCFieldSplit so there is no way it can be anything else). If we actually used the MatGetSchurComplement() interface, the user would have an opportunity to see it, but it's not practical to do that currently because it would duplicate the submatrices.
>  
> Hence LSC_L should be attached to pc->mat
> 
>  So why not check in pc->mat first and if not there check in pc->pmat
> 

   Jed,

      As you know, currently when using PCFIELDSPLIT  we have the presentation:

      ilink = jac->head;
      ierr  = ISComplement(ilink->is,rstart,rend,&ccis);CHKERRQ(ierr);
      ierr  = MatGetSubMatrix(pc->mat,ilink->is,ccis,MAT_INITIAL_MATRIX,&jac->B);CHKERRQ(ierr);
      ierr  = ISDestroy(&ccis);CHKERRQ(ierr);
      ilink = ilink->next;
      ierr  = ISComplement(ilink->is,rstart,rend,&ccis);CHKERRQ(ierr);
      ierr  = MatGetSubMatrix(pc->mat,ilink->is,ccis,MAT_INITIAL_MATRIX,&jac->C);CHKERRQ(ierr);
      ierr  = ISDestroy(&ccis);CHKERRQ(ierr);
      /* Use mat[0] (diagonal block of the real matrix) preconditioned by pmat[0] */
      ierr  = MatCreateSchurComplement(jac->mat[0],jac->pmat[0],jac->B,jac->C,jac->mat[1],&jac->schur);CHKERRQ(ierr);

      I think it makes sense for the L to be attached by the user to the user provided pc->mat and pc->pmat , (for example the ComputeFunction() the user provides could attach the L directly to the Jacobian they produce)   with our current design this means PCFIELDSPLIT here needs to pull the L out of the pc->mat and put it into the jac->schur. Kind of ugly but workable.

      An alternative is to refactor MatCreateSchurComplement() to take the original matrix and the IS as arguments and basically suck in all the code above into the MatCreateSchurComplement() this routine would automatically pull the L out of the input matrix and stick it into the created Schur matrix,

     How would you like to proceed.

   Barry




More information about the petsc-dev mailing list