SNESSetUp() and matrix-free options

Lisandro Dalcin dalcinl at
Wed May 6 15:37:50 CDT 2009

On Wed, May 6, 2009 at 5:25 PM, Barry Smith <bsmith at> wrote:
>   Lisandro,
>     The checking of the options can be moved to SNESSetFromOptions() that
> then set some flag in the snes object;
> but the actual action of MatCreateSNESMF() etc must continue to take place
> in the setup.

Could you elaborate a bit more on this requeriment on the call to

The problem I see is that SNESSetFromOptions() calls
KSPSetFromOptions(), but before that, we should be calling
KSPSetOperators() because KSPSetFromOptions() sets some defaults based
on the actual subtypes of the Mat operators... Likely we have a
chicken-and-egg problem here...

Lisandro Dalcín
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

More information about the petsc-dev mailing list