[petsc-users] PCFactorSetMatSolverPackage / PCFactorGetMatSolverPackage

Barry Smith bsmith at mcs.anl.gov
Tue Aug 2 10:22:05 CDT 2011


On Aug 2, 2011, at 7:10 AM, Jed Brown wrote:

> On Tue, Aug 2, 2011 at 06:53, Clemens Domanig <clemens.domanig at uibk.ac.at> wrote:
> The problem with PCFactorGetMatSolverPackage is I didn't manage to use it.
> 
> const MatSolverPackage pack;
> 
> Insert here:
> 
> PCSetType(prec,PCCHOLESKY);
>  
> PCFactorGetMatSolverPackage( prec, &pack);
> 
> The type has to be set first, otherwise the PC doesn't have any concept of a solver package. I have updated this function to return NULL instead of an undefined value in this case, thanks.
> 
> Barry, speak up if you would prefer an error.

    Hmm, I think both approaches: generating an error or returning null have some validity.  When going with the non-error approach each function must document what it returns when not valid.

  Barry


 
> I think PetscUseMethod() is somewhat overused in query functions at present because there is a reasonable non-error condition that can be returned.



More information about the petsc-users mailing list