On Dec 21, 2011, at 7:11 PM, Jed Brown wrote:

> On Wed, Dec 21, 2011 at 19:06, Barry Smith <bsmith at mcs.anl.gov> wrote:
>  I don't get it. Won't  that dynamic function have the ugly hardwired list in 
> it?   For example SNESSolverISVI(SNES,PetscBool*); which will know which are 
> vi solvers.
> 
> No, each VI solver would
> 
> PetscObjectComposeFunctionDynamic((PetscObject)snes,"SNESVISetVariableBounds_C","SNESVISetVariableBounds_All",SNESVISetVariableBounds_All);
> 
> then SNESVISetVariableBounds would attempt to call this dynamically. If it 
> failed, it would SNESSetType(snes,SNESVIRS) and PetscUseMethod().

  You could do this. Sounds reasonable.

   Barry

  When are we going to make our lives easier by switching to C++ :-)



Reply via email to