[petsc-dev] KSPAddOptionsChecker() needed?

Matthew Knepley knepley at gmail.com
Fri Jun 25 05:53:48 CDT 2010


On Fri, Jun 25, 2010 at 6:52 PM, Jed Brown <jed at 59a2.org> wrote:

> On Thu, 24 Jun 2010 21:35:06 -0500, Barry Smith <bsmith at mcs.anl.gov>
> wrote:
> >
> >    This brings up a "why the heck are we writing PETSc in C anyways"
> question
> >
> >    We have
> >
> >      KSPSetOptionsPrefix(), PC, SNES etc. AND
> PetscObjectSetOptionsPrefix() all do the same thing
> >
> >      KSPSetFromOptions(), Vec, Mat, PC etc but NO
> PetscObjectSetFromOptions()
> >
> >      PetscObjectSetName() but NO KSPSetName() etc
> >
> >     If we have a XXXSetOptionsPrefix() for each separate class then why
> not a XXXAddOptionsHandler() for each separate class? Or should we remove
> all the XXXSetOptionsPrefix() but if we remove all of them why not remove
> all the XXXSetFromOptions() and just always call a
> PetscObjectSetFromOptions()
>
> XXXSetFromOptions is a "beginner" level function, I don't like the
> (PetscObject) cast in this context.  Also, the manual page for the
>

No cast needed in straight C :)


> specific version still has relevant information in a reasonable location
>

This is a reasonable objection.


> so I wouldn't be too eager to remove it in favor of always calling
> PetscObjectSetFromOptions.


However, I still think its nice from the code reuse perspective, and these
are
common functions to all objects.

   Matt


>
> Jed
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20100625/4fe6843d/attachment.html>


More information about the petsc-dev mailing list