Re: [petsc-users] Nullspaces

2022-01-19 Thread Mark Adams
On Wed, Jan 19, 2022 at 12:54 PM Marco Cisternino < marco.cistern...@optimad.it> wrote: > Thank you, Matthew. > > I’m going to pay attention to our non-dimensionalization, avoiding > division by cell volume helps a lot. > > > > Sorry, Mark, I cannot get your point: which 1D problem are you referri

Re: [petsc-users] Nullspaces

2022-01-19 Thread Marco Cisternino
. Bests, Marco Cisternino From: Mark Adams Sent: mercoledì 19 gennaio 2022 15:16 To: Matthew Knepley Cc: Marco Cisternino ; petsc-users Subject: Re: [petsc-users] Nullspaces ILU is LU for this 1D problem and its singular. ILU might have some logic to deal with a singular system. Not sure. LU should

Re: [petsc-users] Nullspaces

2022-01-19 Thread Mark Adams
is best to choose > length (and other) units that make the matrix entries about 1. It seems > like you are far from this, and it is causing a loss of accuracy (your > null vector has a residual of about 1e-7). > > Thanks, > > Matt > > >> Thank you very much for

Re: [petsc-users] Nullspaces

2022-01-19 Thread Matthew Knepley
o choose length (and other) units that make the matrix entries about 1. It seems like you are far from this, and it is causing a loss of accuracy (your null vector has a residual of about 1e-7). Thanks, Matt > Thank you very much for your support! > > > > > > Marco

Re: [petsc-users] Nullspaces

2022-01-19 Thread Marco Cisternino
isternino mailto:marco.cistern...@optimad.it>> Sent: martedì 7 dicembre 2021 19:36 To: Matthew Knepley mailto:knep...@gmail.com>> Cc: petsc-users mailto:petsc-users@mcs.anl.gov>> Subject: Re: [petsc-users] Nullspaces I will, as soon as possible... Scarica Outlook per Andro

Re: [petsc-users] Nullspaces

2022-01-18 Thread Matthew Knepley
RRQ(ierr); > > With this fix, your two cases give the same answer, namely that the > constant vector is not a null vector of your > operator, but it is close, as your can see using -mat_null_space_test_view. > > Thanks, > > Matt > > >> Thanks for any help. >>

Re: [petsc-users] Nullspaces

2022-01-18 Thread Matthew Knepley
; Marco Cisternino, PhD > marco.cistern...@optimad.it > > __ > > Optimad Engineering Srl > > Via Bligny 5, Torino, Italia. > +3901119719782 > www.optimad.it > > > > *From:* Marco Cisternino > *Sent:* martedì 7 dicembre 2021 19:36 >

Re: [petsc-users] Nullspaces

2022-01-12 Thread Marco Cisternino
Barry Smith Sent: mercoledì 5 gennaio 2022 23:17 To: Marco Cisternino Cc: Jose E. Roman ; petsc-users Subject: Re: [petsc-users] Nullspaces What do you get for the two eigenvectors ? > On Jan 5, 2022, at 11:21 AM, Marco Cisternino > wrote: > > Hello Jose and Stefano. > Thank

Re: [petsc-users] Nullspaces

2022-01-05 Thread Barry Smith
> -Original Message- > From: Jose E. Roman > Sent: martedì 4 gennaio 2022 19:30 > To: Marco Cisternino > Cc: Stefano Zampini ; petsc-users > > Subject: Re: [petsc-users] Nullspaces > > To compute more than one eigenpair, call > EPSSetDimensions(eps,

Re: [petsc-users] Nullspaces

2022-01-05 Thread Marco Cisternino
nino -Original Message- From: Jose E. Roman Sent: martedì 4 gennaio 2022 19:30 To: Marco Cisternino Cc: Stefano Zampini ; petsc-users Subject: Re: [petsc-users] Nullspaces To compute more than one eigenpair, call EPSSetDimensions(eps,nev,PETSC_DEFAULT,PETSC_DEFAULT). To compute zero eig

Re: [petsc-users] Nullspaces

2022-01-04 Thread Jose E. Roman
To compute more than one eigenpair, call EPSSetDimensions(eps,nev,PETSC_DEFAULT,PETSC_DEFAULT). To compute zero eigenvalues you may want to use an absolute convergence criterion, with EPSSetConvergenceTest(eps,EPS_CONV_ABS), but then a tolerance of 1e-12 is probably too small. You can try witho

Re: [petsc-users] Nullspaces

2022-01-04 Thread Marco Cisternino
Matthew Knepley mailto:knep...@gmail.com>>; petsc-users mailto:petsc-users@mcs.anl.gov>> Subject: RE: [petsc-users] Nullspaces We usually analyze the code with valgrind, when important changes are implemented. I have to admit that this analysis is still not automatic and the case we ar

Re: [petsc-users] Nullspaces

2022-01-04 Thread Stefano Zampini
to > understand something. > Try running slepc to find the smallest eigenvalues. There should be two zero eigenvalues, then inspect the eigenvectors > > > Thank you all. > > > > Marco Cisternino > > > > *From:* Marco Cisternino > *Sent:* lunedì 3 gennaio 2

Re: [petsc-users] Nullspaces

2022-01-04 Thread Marco Cisternino
k Adams Cc: Matthew Knepley ; petsc-users Subject: RE: [petsc-users] Nullspaces We usually analyze the code with valgrind, when important changes are implemented. I have to admit that this analysis is still not automatic and the case we are talking about is not a test case for our workload. Th

Re: [petsc-users] Nullspaces

2022-01-03 Thread Marco Cisternino
both the real code and the tiny one for this case with valgrind and report the results. Thank you, Marco Cisternino From: Mark Adams Sent: lunedì 3 gennaio 2022 15:50 To: Marco Cisternino Cc: Matthew Knepley ; petsc-users Subject: Re: [petsc-users] Nullspaces I have not looked at your code

Re: [petsc-users] Nullspaces

2022-01-03 Thread Mark Adams
t; Via Bligny 5, Torino, Italia. > +3901119719782 > www.optimad.it > > > > *From:* Mark Adams > *Sent:* lunedì 3 gennaio 2022 14:42 > *To:* Marco Cisternino > *Cc:* Matthew Knepley ; petsc-users < > petsc-users@mcs.anl.gov> > *Subject:* Re: [petsc-users] Nul

Re: [petsc-users] Nullspaces

2022-01-03 Thread Marco Cisternino
Torino, Italia. +3901119719782 www.optimad.it<http://www.optimad.it/> From: Mark Adams Sent: lunedì 3 gennaio 2022 14:42 To: Marco Cisternino Cc: Matthew Knepley ; petsc-users Subject: Re: [petsc-users] Nullspaces There could be a memory bug that does not cause a noticeable problem until i

Re: [petsc-users] Nullspaces

2022-01-03 Thread Mark Adams
gt; *Sent:* sabato 25 dicembre 2021 14:59 > *To:* Marco Cisternino > *Cc:* Matthew Knepley ; petsc-users < > petsc-users@mcs.anl.gov> > *Subject:* Re: [petsc-users] Nullspaces > > > > If "triggering the issue" requires a substantial mesh, that makes me > th

Re: [petsc-users] Nullspaces

2022-01-03 Thread Marco Cisternino
My comments are between the Mark’s lines and they starts with “#” Marco Cisternino From: Mark Adams Sent: sabato 25 dicembre 2021 14:59 To: Marco Cisternino Cc: Matthew Knepley ; petsc-users Subject: Re: [petsc-users] Nullspaces If "triggering the issue" requires a substantial

Re: [petsc-users] Nullspaces

2022-01-03 Thread Marco Cisternino
My comments are between Barry’s lines Marco Cisternino From: Barry Smith Sent: venerdì 24 dicembre 2021 23:57 To: Marco Cisternino Cc: Matthew Knepley ; petsc-users Subject: Re: [petsc-users] Nullspaces I tried your code but it appears the ./gyroid_solution.txt contains a vector of all

Re: [petsc-users] Nullspaces

2021-12-25 Thread Mark Adams
petsc 3.15.2(intelOneAPI) same results. > > If the attachment is not delivered, I can share a link to it. > > > > Thanks for any help. > > > > Marco Cisternino > > > > > > Marco Cisternino, PhD > marco.cistern...@optimad.it > > ___

Re: [petsc-users] Nullspaces

2021-12-24 Thread Barry Smith
lto:marco.cistern...@optimad.it> > __ > Optimad Engineering Srl > Via Bligny 5, Torino, Italia. > +3901119719782 > www.optimad.it <http://www.optimad.it/> > > From: Marco Cisternino <mailto:marco.cistern...@optimad.it>> > Sent: martedì 7 d

Re: [petsc-users] Nullspaces

2021-12-07 Thread Marco Cisternino
I will, as soon as possible... Scarica Outlook per Android<https://aka.ms/AAb9ysg> From: Matthew Knepley Sent: Tuesday, December 7, 2021 7:25:43 PM To: Marco Cisternino Cc: petsc-users Subject: Re: [petsc-users] Nullspaces On Tue, Dec 7, 2021 at 11:19 AM

Re: [petsc-users] Nullspaces

2021-12-07 Thread Matthew Knepley
On Tue, Dec 7, 2021 at 11:19 AM Marco Cisternino < marco.cistern...@optimad.it> wrote: > Good morning, > > I’m still struggling with the Poisson equation with Neumann BCs. > > I discretize the equation by finite volume method and I divide every line > of the linear system by the volume of the cell

Re: [petsc-users] Nullspaces

2021-12-07 Thread Mark Adams
> for (PetscInt i = 0; i < nConstants; ++i) { > > VecRestoreArray(constants[i], &rawConstants[i]); > > VecAssemblyBegin(constants[i]); > > VecAssemblyEnd(constants[i]); > > VecNormalize(constants[i], nullptr); > This does not look correct.

Re: [petsc-users] Nullspaces

2021-12-07 Thread Marco Cisternino
rino, Italia. +3901119719782 www.optimad.it<http://www.optimad.it/> From: Barry Smith Sent: martedì 7 dicembre 2021 17:53 To: Marco Cisternino Cc: petsc-users Subject: Re: [petsc-users] Nullspaces A side note: The MatNullSpaceTest tells you that the null space you provided is in the n

Re: [petsc-users] Nullspaces

2021-12-07 Thread Barry Smith
A side note: The MatNullSpaceTest tells you that the null space you provided is in the null space of the operator, it does not say if you have found the entire null space. In your case with two subdomains the null space is actually two dimensional; all constant on one domain (0 on the other)

Re: [petsc-users] Nullspaces

2021-12-07 Thread Marco Cisternino
rl Via Bligny 5, Torino, Italia. +3901119719782 www.optimad.it<http://www.optimad.it/> From: Mark Adams Sent: martedì 7 dicembre 2021 17:47 To: Marco Cisternino Cc: petsc-users Subject: Re: [petsc-users] Nullspaces Can you please give more details on what 'does not work' is.

Re: [petsc-users] Nullspaces

2021-12-07 Thread Mark Adams
Can you please give more details on what 'does not work' is. More detail on how you judge what works would also be useful. Mark On Tue, Dec 7, 2021 at 11:19 AM Marco Cisternino < marco.cistern...@optimad.it> wrote: > Good morning, > > I’m still struggling with the Poisson equation with Neumann BC

[petsc-users] Nullspaces

2021-12-07 Thread Marco Cisternino
Good morning, I'm still struggling with the Poisson equation with Neumann BCs. I discretize the equation by finite volume method and I divide every line of the linear system by the volume of the cell. I could avoid this division, but I'm trying to understand. My mesh is not uniform, i.e. cells ha

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Dmitry Karpeyev
I'm actually not proposing putting extra intelligence into the DM, but into the ApplicationCtx and the associated callbacks that the user can write. The DM is used to propagate this information to the deeper levels of a nested solver hierarchy by "restricting" the relevant ctx/callbacks to the spl

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Jed Brown
Dmitry Karpeyev writes: > I think the problem-specific solver configuration can be carried out by an > additional user-specified callback (attached, e.g., using PCSetUserSetUp()) > called from PCSetUp(). > The problem of propagating it down the hierarchy can be solved by using DMs > (even DMShell

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Dmitry Karpeyev
On Wed Nov 12 2014 at 7:49:28 PM Jed Brown wrote: > Barry Smith writes: > >Perhaps we need a generic way of attaching null spaces to parts of > >matrices and to parts of matrices in different basis (which is what > >a Schur complement is). So (and this is likely overly simplistic) >

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Jed Brown
Barry Smith writes: > Indeed it could. Perhaps we could start by unifying the concept of a > sub matrix and a Schur complement of the same part of the matrix? > I'm not sure how to do that. We can certainly define an interface that works this way, but I'm not sure it's practical. signatur

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Barry Smith
> On Nov 12, 2014, at 7:49 PM, Jed Brown wrote: > > Barry Smith writes: >> Perhaps we need a generic way of attaching null spaces to parts of >> matrices and to parts of matrices in different basis (which is what >> a Schur complement is). So (and this is likely overly simplistic) >> on

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Jed Brown
Barry Smith writes: >Perhaps we need a generic way of attaching null spaces to parts of >matrices and to parts of matrices in different basis (which is what >a Schur complement is). So (and this is likely overly simplistic) >one could supply a null space, an index set, and a flag i

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Barry Smith
I agree with what Jed says. One could argue that if the matrix was represented as a MatNest, the null space of the Schur complement is a property of the MatNest object and hence could/should be something that is attached to the matrix. Now if the Mat happens not to be a MatNest, the null s

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Jed Brown
Lawrence Mitchell writes: > So is the problem that the nullspace belongs to the appropriate > operator, but at the point you tell the solver, you don't necessarily > have all the operators to hand? Moreover, depending on the PC choice, > the nullspaces of the operator blocks may or may not be rel

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-12 Thread Lawrence Mitchell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/11/14 15:18, Jed Brown wrote: ... > Matt and I have a long-running disagreement about nullspace > handling in PETSc. He added the code that hangs it on an IS > despite it not logically belonging on IS, simply because the > implementation in P

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-11 Thread Jed Brown
Lawrence Mitchell writes: > OK, so it's sounds like this is probably a deliberate choice. I note that > the code currently does this: > > fieldsplit.c:703 > > ierr = MatSetFromOptions(jac->schur);CHKERRQ(ierr); > ierr = MatGetNullSpace(jac->pmat[1], &sp);CHKERRQ(ierr); > if (sp

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-11 Thread Matthew Knepley
On Mon, Nov 10, 2014 at 10:28 PM, Jed Brown wrote: > Matthew Knepley writes: > >> at which point the nullspace is not attached, no? > >> > > > > Crap, that is right. I think we should propagate the nullspace from > pmat[1]. > > Uh, there is no reason pmat[1] can be expected to have the same null

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-11 Thread Lawrence Mitchell
On 11 Nov 2014, at 04:28, Jed Brown wrote: > Matthew Knepley writes: >>> at which point the nullspace is not attached, no? >>> >> >> Crap, that is right. I think we should propagate the nullspace from pmat[1]. > > Uh, there is no reason pmat[1] can be expected to have the same null > space.

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-10 Thread Jed Brown
Matthew Knepley writes: >> at which point the nullspace is not attached, no? >> > > Crap, that is right. I think we should propagate the nullspace from pmat[1]. Uh, there is no reason pmat[1] can be expected to have the same null space. pmat[1] is the zero matrix in some important cases, and the

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-10 Thread Matthew Knepley
On Mon, Nov 10, 2014 at 5:34 PM, Lawrence Mitchell < lawrence.mitch...@imperial.ac.uk> wrote: > > On 10 Nov 2014, at 21:48, Matthew Knepley wrote: > > > On Fri, Nov 7, 2014 at 11:04 AM, Lawrence Mitchell < > lawrence.mitch...@imperial.ac.uk>wrote: > > Hi petsc-dev, > > > > I'm solving a pure Neum

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-10 Thread Lawrence Mitchell
On 10 Nov 2014, at 21:48, Matthew Knepley wrote: > On Fri, Nov 7, 2014 at 11:04 AM, Lawrence Mitchell > wrote: > Hi petsc-dev, > > I'm solving a pure Neumann mixed Poisson-like problem, preconditioning with a > schur complement. The pressure space has a nullspace of the constant > functions

Re: [petsc-users] Nullspaces for schur complement PCs

2014-11-10 Thread Matthew Knepley
On Fri, Nov 7, 2014 at 11:04 AM, Lawrence Mitchell < lawrence.mitch...@imperial.ac.uk> wrote: > Hi petsc-dev, > > I'm solving a pure Neumann mixed Poisson-like problem, preconditioning > with a schur complement. The pressure space has a nullspace of the > constant functions and so I attach the ap

[petsc-users] Nullspaces for schur complement PCs

2014-11-07 Thread Lawrence Mitchell
Hi petsc-dev, I'm solving a pure Neumann mixed Poisson-like problem, preconditioning with a schur complement. The pressure space has a nullspace of the constant functions and so I attach the appropriate nullspace to the krylov solver, and compose the constant nullspace with the IS defining the