> On Dec 11, 2014, at 9:54 PM, Fande Kong <[email protected]> wrote:
> 
> Hi Barry,
> 
> Thanks. 
> 
> I know how to solve a dense linear system in the petsc, but I was wondering 
> how to call a Lapack routine in the petsc.

   You asked how to call a lapack routine to solve a dense linear system. That 
is exactly what I told you. For seqdense matrices PETSc lu solvers directly 
call the LAPACK routines to do the factorization and the solves. 

   Sure it is possible to call LAPACK routines directly to solve a sequential 
dense linear system but there is no reason to do that since PETSc does it for 
you. For dense matrices of dimension 10 or larger the overhead of calling 
through PETSc is negligible so there is no good reason to call lapack directly.

  Barry

> 
> 
> 
> On Thu, Dec 11, 2014 at 8:47 PM, Barry Smith <[email protected]> wrote:
> 
> > On Dec 11, 2014, at 9:33 PM, Fande Kong <[email protected]> wrote:
> >
> > Hi all,
> >
> > How to call a Lapack routine to solve a dense linear system? Any simple 
> > example?
> 
>    Create the Mat with MatCreateSeqDense() then create the usual KSP and use 
> for the solver options -pc_type lu -ksp_type preonly
> 
>     See src/ksp/ksp/examples/tutorials/ex30.c
> 
> 
>    Barry
> 
> >
> > Thanks,
> >
> 

Reply via email to