[petsc-users] Curiosity about MatSetOptionsPrefix on a_11 in PCSetUp_FieldSplit

Matthew Knepley knepley at gmail.com
Thu Sep 11 11:26:26 CDT 2014


On Thu, Sep 11, 2014 at 10:34 AM, Eric Chamberland <
Eric.Chamberland at giref.ulaval.ca> wrote:

> Hi,
>
> I was just curious to know why the prefix of the sub-matrix a_{11} in a
> matnest is forced to the ksp prefix by PCSetUp_FieldSplit?
>
> In my case it changes from "gcrSchur_fieldsplit_a_11_" to
> "gcrSchur_fieldsplit_schur_" after the PCSetUp_FieldSplit, by this (I
> think) lines of code in fieldsplit.c (petsc 3.5.2):
>
> const char *prefix;
> ierr = MatGetSubMatrix(pc->pmat,ilink->is,ilink->is_col,MAT_
> INITIAL_MATRIX,&jac->pmat[i]);CHKERRQ(ierr);
> ierr = KSPGetOptionsPrefix(ilink->ksp,&prefix);CHKERRQ(ierr);
> ierr = MatSetOptionsPrefix(jac->pmat[i],prefix);CHKERRQ(ierr);
> ierr = MatViewFromOptions(jac->pmat[i],NULL,"-mat_view");CHKERRQ(ierr);
>

I did this. My thinking was that if someone wanted to view the Schur
complement matrix, then
this was the correct prefix.


> We wanted to pass options to the a_11 matrix, but using the
> PC_COMPOSITE_SCHUR, we have to give the a_{11} matrix a unique prefix
> different from the ksp prefix used to solve the shur complement (which we
> named "schur") and have MatSetFromOptions use this unique prefixe. It all
> worked, but we saw this "curiosity" in the kspview (view attached log)
> about the PCSetUp_FieldSplit which rename our matrix (after all the
> precautions we took to name it differently)!!!!
>

I am trying to understand the problem. This matrix is created by by the
MatGetSubMatrix() call.

  1) What options are you trying to pass to it?

  2) Why would they interfere with the KSP options?

  Thanks,

     Matt


> The code is working, so maybe this is not an issue, but I can't tell from
> my knowledge if it can be harmful?
>
> thank you!
>
> Eric
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140911/a4488143/attachment.html>


More information about the petsc-users mailing list