[petsc-dev] Creation of snes->vec_func

Barry Smith bsmith at mcs.anl.gov
Wed Dec 21 19:16:04 CST 2011


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++ :-)





More information about the petsc-dev mailing list