Re: [petsc-dev] MatNest and FieldSplit

2019-04-15 Thread Pierre Jolivet via petsc-dev
> On 15 Apr 2019, at 2:17 PM, Matthew Knepley > wrote: > > On Mon, Apr 15, 2019 at 5:03 AM Pierre Jolivet via petsc-dev > mailto:petsc-dev@mcs.anl.gov>> wrote: > OK, my solver is now working properly with a call to > PetscObjectCompose((PetscObject)isS, "pmat", (Petsc

Re: [petsc-dev] MatNest and FieldSplit

2019-04-15 Thread Pierre Jolivet via petsc-dev
OK, my solver is now working properly with a call to PetscObjectCompose((PetscObject)isS, "pmat", (PetscObject) myS); I have two follow-up questions: 1) am I supposed to call this, or is it the sign of something done wrong in my sequence of SNESSolve/KSPSetUp/KSPSetFromOptions/KSPSetOperators…? 2

Re: [petsc-dev] MatNest and FieldSplit

2019-04-14 Thread Pierre Jolivet via petsc-dev
I think I figured out what my problem is _exactly_. The Mat inside the MATNEST on which I’m using a PCFIELDSPLIT is unassembled before the first KSPSolve, except for the last field. Matt, you nailed it, when I call KSPSetFromOptions on the global PCFIELDSPLIT, then KSPSetUp explicitly on the inne

Re: [petsc-dev] MatNest and FieldSplit

2019-03-25 Thread Pierre Jolivet via petsc-dev
Thanks, this makes (slightly) more sense to me know. For some reason my application is still not acting properly but I must be screwing somewhere else the nested FieldSplit… Thank you, Pierre > On 24 Mar 2019, at 11:42 PM, Dave May via petsc-dev > wrote: > > Matt is right. > > When you defin

Re: [petsc-dev] MatNest and FieldSplit

2019-03-24 Thread Mark Adams via petsc-dev
I think he is saying that this line seems to have no effect (and the comment is hence wrong): KSPSetOperators(subksp[nsplits - 1], S, S); // J2 = [[4, 0] ; [0, 0.1]] J2 is a 2x2 but this block has been changed into two single equation fields. Does this KSPSetOperators supposed to copy this

Re: [petsc-dev] MatNest and FieldSplit

2019-03-24 Thread Pierre Jolivet via petsc-dev
It’s a 4x4 matrix. The first 2x2 diagonal matrix is a field. The second 2x2 diagonal matrix is another field. In the second field, the first diagonal coefficient is a subfield. In the second field, the second diagonal coefficient is another subfield. I’m changing the operators from the second subfi

[petsc-dev] MatNest and FieldSplit

2019-03-24 Thread Pierre Jolivet via petsc-dev
I’m trying to figure out why both solutions are not consistent in the following example. Is what I’m doing complete nonsense? Thanks in advance for your help, Pierre nest.c Description: Binary data