[petsc-users] Problem setting Fieldsplit fields

Matthew Knepley knepley at gmail.com
Fri Feb 3 13:55:02 CST 2023


On Fri, Feb 3, 2023 at 2:52 PM Nicolas Barnafi <nbarnafi at cmm.uchile.cl>
wrote:

> Thanks Matt,
>
> Sorry, I copied the output from the error, but in the options file I do
> it as expected:
>
>   -pc_fieldsplit_0_fields 0,1
>   -pc_fieldsplit_1_fields 2,3
>

There are a number of common errors:

  1) Your PC has a prefix

  2) You have not called KSPSetFromOptions() here

Can you send the -ksp_view output?

  Thanks,

     Matt


> Best
>
> On 03-02-23 16:50, Matthew Knepley wrote:
> > On Fri, Feb 3, 2023 at 2:46 PM Nicolas Barnafi via petsc-users
> > <petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>> wrote:
> >
> >     Dear community,
> >
> >     I am using a fieldsplit preconditioner, but for some reason I cannot
> >     group fields as in other libraries (i.e. I do this in Firedrake and
> it
> >     works). Some context:
> >
> >     I have set four fields to the preconditioner, which I want to
> >     regroup with
> >     -pc_fieldsplit_0_fields value: 0,1
> >     -pc_fieldsplit_1_fields value: 2,3
> >
> >
> > You should not have a colon, ":"
> >
> >    Thanks,
> >
> >       Matt
> >
> >     But apparently this doesn't get read for some reason. In fact, from
> >     -ksp_view I still see all 4 fields, and it fails as one of the blocks
> >     has a null diagonal (coming from a saddle point problem), so it gives
> >     the following error. Interestingly, it shows that the groupings where
> >     not considered:
> >
> >     [0]PETSC ERROR: Object is in wrong state
> >     [0]PETSC ERROR: Matrix is missing diagonal entry 0
> >     [0]PETSC ERROR: WARNING! There are option(s) set that were not used!
> >     Could be the program crashed before they were used or a spelling
> >     mistake, etc!
> >     [0]PETSC ERROR: Option left: name:-pc_fieldsplit_0_fields value: 0,1
> >     [0]PETSC ERROR: Option left: name:-pc_fieldsplit_1_fields value: 2,3
> >
> >     Any clues to why this can happen? Best regards,
> >     Nicolás Barnafi
> >
> >
> >
> > --
> > 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
> >
> > https://www.cse.buffalo.edu/~knepley/ <
> http://www.cse.buffalo.edu/~knepley/>
>
>

-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230203/ea385bb4/attachment-0001.html>


More information about the petsc-users mailing list