[petsc-dev] petsc/petsc added -pc_use_amat option to PCSetFromOptions() (commit b9ee023)

Jed Brown jedbrown at mcs.anl.gov
Thu Mar 21 23:09:14 CDT 2013


On Thu, Mar 21, 2013 at 9:21 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>   Is it really worth manually putting it into a bunch of places rather
> than just leaving it at the top level?  I reckon about 10 of the current
> preconditioners could utilize this function. If we change this we need to
> change PCSetModifySubMatrices() and PCSetInitialGuessNonzero() also since
> they work for far fewer PCs. I'm fine with either leaving it or changing it.
>
>    It would be nice if we could more automate handling these kinds of
> things for each PC rather than cut and pasting code all over.
>

Well, we could make some protocol like storing pc->reuse as an integer,
creating (likely private) PETSC_NOT_AVAILABLE=-3, and have PCCreate() set
pc->reuse = PETSC_NOT_AVAILABLE. Then PCCreate_X() would set pc->reuse =
PETSC_DECIDE and PCSetFromOptions() would choose a default if PETSC_DECIDE
and then consult the options database only if pc->reuse !=
PETSC_NOT_AVAILABLE.

I don't want to use behavior like above unless we standardize and use it
everywhere that it makes sense.

More in line with existing conventions would be:

PetscObjectComposeFunction(...,PCSetUseAmatDefault);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130321/1c49ada0/attachment.html>


More information about the petsc-dev mailing list