Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-30 Thread Colton Bryant
Ah thanks for that! Sorry I had incorrectly assumed the preconditioner on S would be as it was previously. I'll take a look. Thanks again for all the help. Best, Colton On Thu, May 30, 2024 at 3:25 PM Barry Smith wrote: > >Preconditioner for the Schur complement formed from A11 > >But

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-30 Thread Barry Smith
Preconditioner for the Schur complement formed from A11 But PC Object: (fieldsplit_pressure_) 1 MPI process > > type: ilu > out-of-place factorization > 0 levels of fill > tolerance for zero pivot 2.22045e-14 > matrix ordering: natural >

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-30 Thread Colton Bryant
Hi Barry, Yes, each index set has the correct entries when I checked manually on a small example. For the nullspace I was trying to manually build the constant basis on a compatible DMStag containing just the pressure nodes and creating the nullspace from that but that does not seem to work. Usin

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-30 Thread Barry Smith
> On May 30, 2024, at 3:15 PM, Colton Bryant > wrote: > > Hi Barry, > > Do you know of an example that demonstrates this approach? I have tried > implementing this using DMStagCreateISFromStencils and then calling > PCFieldSplitSetIS with fields named "velocity" and "pressure" respectively,

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-30 Thread Colton Bryant
Hi Barry, Do you know of an example that demonstrates this approach? I have tried implementing this using DMStagCreateISFromStencils and then calling PCFieldSplitSetIS with fields named "velocity" and "pressure" respectively, but when I look at -ksp_view the fields are being set to "fieldsplit_fac

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Stefano Zampini
It is true if A is nonsingular. if it is singular I never did the algebra; you need to use generalized Schur complements with pseudo-inverses Il giorno ven 24 mag 2024 alle ore 00:04 Barry Smith ha scritto: > > > On May 23, 2024, at 3:48 PM, Stefano Zampini > wrote: > > the null space of the Sc

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Matthew Knepley
I put in stuff to propagate the nullspace if you use DM. Matt On Thu, May 23, 2024 at 11:04 PM Barry Smith wrote: > On May 23, 2024, at 3: 48 PM, Stefano Zampini com> wrote: the null space of the Schur complement is the restriction of > the original null space. I guess if fieldsplit is Schu

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Barry Smith
> On May 23, 2024, at 3:48 PM, Stefano Zampini > wrote: > > the null space of the Schur complement is the restriction of the original > null space. I guess if fieldsplit is Schur type then we could in principle > extract the sub vectors and renormalize them Is this true if A is singular?

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Stefano Zampini
the null space of the Schur complement is the restriction of the original null space. I guess if fieldsplit is Schur type then we could in principle extract the sub vectors and renormalize them On Thu, May 23, 2024, 22:13 Jed Brown wrote: > Barry Smith writes: > Unfortunately it cannot > autom

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Jed Brown
Barry Smith writes: > Unfortunately it cannot automatically because -pc_fieldsplit_detect_saddle_point just grabs part of the matrix (having no concept of "what part" so doesn't know to grab the null space information.  ZjQcmQRYFpfptBannerStart This Message Is From an

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Colton Bryant
Hi Barry, Thanks so much for the information. I will get working on that! Thanks again for all your help. -Colton On Thu, May 23, 2024 at 12:55 PM Barry Smith wrote: > >Unfortunately it cannot automatically because > -pc_fieldsplit_detect_saddle_point just grabs part of the matrix (having

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Barry Smith
Unfortunately it cannot automatically because -pc_fieldsplit_detect_saddle_point just grabs part of the matrix (having no concept of "what part" so doesn't know to grab the null space information. It would be possible for PCFIELDSPLIT to access the null space of the larger matrix direct

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Colton Bryant
Yes, the original operator definitely has a constant null space corresponding to the constant pressure mode. I am currently handling this by using the MatSetNullSpace function when the matrix is being created. Does this information get passed to the submatrices of the fieldsplit? -Colton On Thu,

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Barry Smith
Ok, So what is happening is that GMRES with a restart of 30 is running on the Schur complement system with no preconditioning and LU (as a direct solver) is being used in the application of S (the Schur complement). The convergence of GMRES is stagnating after getting about 8 digits of

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Colton Bryant
Hi Barry, I saw that was reporting as an unused option and the error message I sent was run with -fieldsplit_0_ksp_type preonly. -Colton On Thu, May 23, 2024 at 12:13 PM Barry Smith wrote: > > >Sorry I gave the wrong option. Use -fieldsplit_0_ksp_type preonly > > Barry > > On May 23, 2024

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Barry Smith
Sorry I gave the wrong option. Use -fieldsplit_0_ksp_type preonly Barry > On May 23, 2024, at 12:51 PM, Colton Bryant > wrote: > > That produces the error: > > [0]PETSC ERROR: Residual norm computed by GMRES recursion formula 2.68054e-07 > is far from the computed residual norm 6.8630

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Colton Bryant
That produces the error: [0]PETSC ERROR: Residual norm computed by GMRES recursion formula 2.68054e-07 is far from the computed residual norm 6.86309e-06 at restart, residual norm at start of cycle 2.68804e-07 The rest of the error is identical. On Thu, May 23, 2024 at 10:46 AM Barry Smith wrot

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Barry Smith
Use -pc_fieldsplit_0_ksp_type preonly > On May 23, 2024, at 12:43 PM, Colton Bryant > wrote: > > That produces the following error: > > [0]PETSC ERROR: Residual norm computed by GMRES recursion formula 2.79175e-07 > is far from the computed residual norm 0.000113154 at restart, residual

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Barry Smith
Run the failing case with also -ksp_error_if_not_converged so we see exactly where the problem is first detected. > On May 23, 2024, at 11:51 AM, Colton Bryant > wrote: > > Hi Barry, > > Thanks for letting me know about the need to use fgmres in this case. I ran a > smaller problem (12

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-23 Thread Colton Bryant
Hi Barry, Thanks for letting me know about the need to use fgmres in this case. I ran a smaller problem (1230 in the first block) and saw similar behavior in the true residual. I also ran the same problem with the options -fieldsplit_0_pc_type svd -fieldsplit_0_pc_svd_monitor and get the followin

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-22 Thread Barry Smith
Thanks for the info. I see you are using GMRES inside the Schur complement solver, this is ok but when you do you need to use fgmres as the outer solver. But this is unlikely to be the cause of the exact problem you are seeing. I'm not sure why the Schur complement KSP is suddenly seeing a

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-22 Thread Colton Bryant
Hi Barry, I have not used any other solver parameters in the code and the full set of solver related command line options are those I mentioned in the previous email. Below is the output from -ksp_view: KSP Object: (back_) 1 MPI process type: gmres restart=30, using Classical (unmodified)

Re: [petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-22 Thread Barry Smith
Are you using any other command line options or did you hardwire any solver parameters in the code with, like, KSPSetXXX() or PCSetXXX() Please send all of them. Something funky definitely happened when the true residual norms jumped up. Could you run the same thing with -ksp_view and do

[petsc-users] Diagnosing Convergence Issue in Fieldsplit Problem

2024-05-22 Thread Colton Bryant
Hello, I am solving the Stokes equations on a MAC grid discretized by finite differences using a DMSTAG object. I have tested the solver quite extensively on manufactured problems and it seems to work well. As I am still just trying to get things working and not yet worried about speed I am using