SNESSetUp() and matrix-free options

Lisandro Dalcin dalcinl at gmail.com
Wed Jul 22 09:39:17 CDT 2009


On Wed, Jul 22, 2009 at 12:26 AM, Barry Smith<bsmith at mcs.anl.gov> wrote:
>>
>> Can we at least agree on the simple rules below:
>>
>> 1) KSPSetFromOptions() requires a previous call to KSPSetOperators()
>>
>> 2) SNESSetFromOptions() requires a previous call to:
>>  a) SNESSetFunction(), and also SNESSetJacobian() unless matrix-free is
>> used.
>>  b) just SNESSetJacobian() if the problem is actually linear (a case
>> that SNESComputeFunction() seems to handle)
>>
>> 3) TSSetFromOptions() should have similar requirements in order to
>> being able to satisfy (1) or (2) depending on the problem type.
>>
>> Barry, does all this make sense?
>
>  Sometimes, so what went wrong with the broken TS example and can it fit in
> this paradgm?
>

Well, now the example is not broken because I changed SNES to create a
the missing snes->vec_func from the Jacobian matrix if that is
available... All this works because TSSetFromOptions() calls
SNESSetOperators() before issuing SNESSetFromOptions(). However,
nonlinear TS has an asymmetry with SNES and with TS itself:
TSSetRHSFunction() should take a Vec from the user, like
SNESSetFunction. This way, the TS will have a Vec to feed SNES.


>   This is tough when there are nested sub KSP inside PCs and picking these
> is done at
> the command line.

OK.. You are right...  this is a nightmare...

Asking users to call SNESSetJacobian() should not be required for
matrix-free, but calling KSPSetFromOptions() without having the
operators set in KSP is broken...

Did you realize that -ksp_fischer_guess is broken if the operators are
not set in KSP? I know, using Fischer's method is a nonsense for
SNES... But perhaps they do make sense for a sub-KSP inside a PC...



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