Re: [petsc-users] SNESSetFunctionDomainError

2015-02-19 Thread Dmitry Karpeyev
I wanted to revive this thread and move it to petsc-dev. This problem seems to be harder than I realized. Suppose MatMult inside KSPSolve() inside SNESSolve() cannot compute a valid output vector. For example, it's a MatMFFD and as part of its function evaluation it has to evaluate an

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-31 Thread Barry Smith
We don’t currently have the concept of “matrix-vector product failed due to funky thing like domain error” therefor end the current linear solve and also the nonlinear solve but without an error condition. I’m open to any suggestions, but not comfortable with reorganizing PETSc errors

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-31 Thread Jed Brown
Derek Gaston fried...@gmail.com writes: As a workaround I have tried returning various diverged statuses in my linear and nonlinear convergence checks... but it still has a pesky problem where there are a couple more residual evaluations at the end of the nonlinear solve. I think this is

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-31 Thread Dmitry Karpeyev
Handling this at the KSP level (I actually think the Mat level is more appropriate, since the operator, not the solver, knows its domain), we have to fix MatMFFD, I would think. Yes, that thing has the concept of a nonlinear function, but it doesn't have any clue about or access to a SNES. I did,

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-31 Thread Jed Brown
Dmitry Karpeyev karp...@mcs.anl.gov writes: Handling this at the KSP level (I actually think the Mat level is more appropriate, since the operator, not the solver, knows its domain), We are dynamically discovering the domain, but I don't think it's appropriate for Mat to refuse to evaluate

[petsc-users] SNESSetFunctionDomainError

2014-08-24 Thread Derek Gaston
There must be something I'm missing about SNESSetFunctionDomainError(). I'm using a matrix free newton solve and I was hoping that calling SNESSetFunctionDomainError() would completely stop the nonlinear solver... but that doesn't appear to be the case. Now - if I call that function during the

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-24 Thread Barry Smith
On Aug 24, 2014, at 9:06 PM, Derek Gaston fried...@gmail.com wrote: There must be something I'm missing about SNESSetFunctionDomainError(). I'm using a matrix free newton solve and I was hoping that calling SNESSetFunctionDomainError() would completely stop the nonlinear solver... but

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-24 Thread Dmitry Karpeyev
On Sun, Aug 24, 2014 at 9:40 PM, Barry Smith bsm...@mcs.anl.gov wrote: On Aug 24, 2014, at 9:06 PM, Derek Gaston fried...@gmail.com wrote: There must be something I'm missing about SNESSetFunctionDomainError(). I'm using a matrix free newton solve and I was hoping that calling

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-24 Thread Dmitry Karpeyev
On Aug 24, 2014 9:40 PM, Barry Smith bsm...@mcs.anl.gov wrote: On Aug 24, 2014, at 9:06 PM, Derek Gaston fried...@gmail.com wrote: There must be something I'm missing about SNESSetFunctionDomainError(). I'm using a matrix free newton solve and I was hoping that calling

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-24 Thread Barry Smith
On Aug 24, 2014, at 10:37 PM, Dmitry Karpeyev karp...@mcs.anl.gov wrote: On Aug 24, 2014 9:40 PM, Barry Smith bsm...@mcs.anl.gov wrote: On Aug 24, 2014, at 9:06 PM, Derek Gaston fried...@gmail.com wrote: There must be something I'm missing about SNESSetFunctionDomainError().

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-24 Thread Dmitry Karpeyev
On Aug 24, 2014 10:45 PM, Barry Smith bsm...@mcs.anl.gov wrote: On Aug 24, 2014, at 10:37 PM, Dmitry Karpeyev karp...@mcs.anl.gov wrote: On Aug 24, 2014 9:40 PM, Barry Smith bsm...@mcs.anl.gov wrote: On Aug 24, 2014, at 9:06 PM, Derek Gaston fried...@gmail.com wrote: There

Re: [petsc-users] SNESSetFunctionDomainError

2014-08-24 Thread Jed Brown
Barry Smith bsm...@mcs.anl.gov writes: I tried once to convert PETSc errors to be more “exception like” and let them be caught and handled. It worked but was kind of clunky so I gave up on it and decided that anything we wanted to be “handled” instead of just passed up as an error