[petsc-dev] KSPAddOptionsChecker() needed?

2010-07-02 Thread Barry Smith
I have added PetscObjectAddOptionsHandler() for all objects and removed KSPAddOptionsChecker() Barry On Jun 24, 2010, at 9:18 PM, Matthew Knepley wrote: > On Fri, Jun 25, 2010 at 10:16 AM, Barry Smith wrote: > > PetscObjectAddOptionsHandler(PetscObject, PetscErrorCode > (*)(PetscOb

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-25 Thread Matthew Knepley
On Fri, Jun 25, 2010 at 6:52 PM, Jed Brown wrote: > On Thu, 24 Jun 2010 21:35:06 -0500, Barry Smith > wrote: > > > >This brings up a "why the heck are we writing PETSc in C anyways" > question > > > >We have > > > > KSPSetOptionsPrefix(), PC, SNES etc. AND > PetscObjectSetOptionsPre

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-25 Thread Jed Brown
On Fri, 25 Jun 2010 18:53:48 +0800, Matthew Knepley wrote: > No cast needed in straight C :) Assuming you like warnings. Of course you can make a macro that does the cast and forwards to a real function, but that's not how the PetscObject* API currently works. Jed

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-25 Thread Jed Brown
On Thu, 24 Jun 2010 21:35:06 -0500, Barry Smith 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, Ma

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-25 Thread Matthew Knepley
I am for removing all the specific and using the PetscObject versions. This is how I have them on my tutorial slides (without the PetscObject header). Matt On Fri, Jun 25, 2010 at 10:35 AM, Barry Smith wrote: > >This brings up a "why the heck are we writing PETSc in C anyways" > question

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-25 Thread Matthew Knepley
On Fri, Jun 25, 2010 at 10:16 AM, Barry Smith wrote: > > PetscObjectAddOptionsHandler(PetscObject, PetscErrorCode > (*)(PetscObject,void*),void *ctx) ? > Better. Matt Barry > > On Jun 24, 2010, at 9:07 PM, Matthew Knepley wrote: > > I am for the uniform PetscObjectAddOptionsChecker()

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-25 Thread Matthew Knepley
I am for the uniform PetscObjectAddOptionsChecker(). Should it really be called Checker? Sounds like validation. I think there is some value in treating SetFromOptions as a generic facility that can be extended. This is "aspect oriented programming" :) Matt On Fri, Jun 25, 2010 at 10:00 AM, B

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-24 Thread Barry Smith
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() bu

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-24 Thread Barry Smith
PetscObjectAddOptionsHandler(PetscObject, PetscErrorCode (*)(PetscObject,void*),void *ctx) ? Barry On Jun 24, 2010, at 9:07 PM, Matthew Knepley wrote: > I am for the uniform PetscObjectAddOptionsChecker(). Should it really be > called > Checker? Sounds like validation. I think there

[petsc-dev] KSPAddOptionsChecker() needed?

2010-06-24 Thread Barry Smith
KSPAddOptionsChecker() is never used in PETSc. Is it needed? Can it be removed? Or should we have a PetscObjectAddOptionsChecker() instead, thus expanding this (unneeded capability) to all PETSc objects/solvers? Barry