Re: [petsc-users] Shell Matrix Operations required for KSP solvers?

2018-10-23 Thread Dave May
On Tue, 23 Oct 2018 at 02:24, Matthew Knepley  wrote:

> On Mon, Oct 22, 2018 at 7:44 PM Andrew Ho  wrote:
>
>> I have a specialized matrix structure I'm trying to take advantage of for
>> solving large scale (non)linear systems. I think for this purpose using a
>> Shell matrix is sufficient for interfacing with PETSc's KSP linear solvers.
>>
>> Looking at the examples which use shell matrices, it seems most only
>> require implementing MatMult, and sometimes MatMultTranspose. Is there a
>> list of what operations are required (or optional but good to have) for the
>> different KSP solver types? This is specifically for the KSP solve itself,
>> not constructing the actual matrix. I'd also be interested if any of the
>> required/optional operations changes if preconditioners (left and/or right)
>> are used.
>>
>
> There is no list, but its hard to think of another operation KSP would ask
> for. Preconditioners are another story unfortunately. They often want
> explicit access to matrix entries. its really unusual for KSPs to work
> without a good preconditioner (the notable exception being well-conditioned
> systems like some boundary integral operators).
>

The most basic PC is Jacobi - for that to work you need to implement
MatGetDiagonal.

Thanks,
  Dave



>   Thanks,
>
> Matt
>
> --
> 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/
> 
>


Re: [petsc-users] Shell Matrix Operations required for KSP solvers?

2018-10-22 Thread Matthew Knepley
On Mon, Oct 22, 2018 at 7:44 PM Andrew Ho  wrote:

> I have a specialized matrix structure I'm trying to take advantage of for
> solving large scale (non)linear systems. I think for this purpose using a
> Shell matrix is sufficient for interfacing with PETSc's KSP linear solvers.
>
> Looking at the examples which use shell matrices, it seems most only
> require implementing MatMult, and sometimes MatMultTranspose. Is there a
> list of what operations are required (or optional but good to have) for the
> different KSP solver types? This is specifically for the KSP solve itself,
> not constructing the actual matrix. I'd also be interested if any of the
> required/optional operations changes if preconditioners (left and/or right)
> are used.
>

There is no list, but its hard to think of another operation KSP would ask
for. Preconditioners are another story unfortunately. They often want
explicit access to matrix entries. its really unusual for KSPs to work
without a good preconditioner (the notable exception being well-conditioned
systems like some boundary integral operators).

  Thanks,

Matt

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


[petsc-users] Shell Matrix Operations required for KSP solvers?

2018-10-22 Thread Andrew Ho
I have a specialized matrix structure I'm trying to take advantage of for
solving large scale (non)linear systems. I think for this purpose using a
Shell matrix is sufficient for interfacing with PETSc's KSP linear solvers.

Looking at the examples which use shell matrices, it seems most only
require implementing MatMult, and sometimes MatMultTranspose. Is there a
list of what operations are required (or optional but good to have) for the
different KSP solver types? This is specifically for the KSP solve itself,
not constructing the actual matrix. I'd also be interested if any of the
required/optional operations changes if preconditioners (left and/or right)
are used.