On Fri 2008-04-11 16:47, [EMAIL PROTECTED] wrote:
> I ran ex3 using the runtime flags and I got the following error message:

You'll have to add something like

KSPSetInitialGuessNonzero(ksp, PETSC_FALSE);

before the solve if you want to use preonly.  I was unaware that libmesh sets
this by default.  A prettier way to unset this parameter might be a nice thing
for libmesh to do.  I'd be surprised if you actually take a performance hit when
leaving the solver as gmres (default) and just specifying '-pc_type lu'.  It
will converge after one iteration.

Jed


> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR:   !
> [0]PETSC ERROR: Running KSP of preonly doesn't make sense with nonzero
> initial guess
>                you probably want a KSP type of Richardson!
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: Petsc Release Version 2.3.2, Patch 10, Wed Mar 28 19:13:22
> CDT 2007 HG revision: d7298c71db7f5e767f359ae35d33cab3bed44428
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> [0]PETSC ERROR: See docs/index.html for manual pages.
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: ./ex3-opt on a linux named alinex-2PUb8L by paulo Fri Apr
> 11 15:39:31 2008
> [0]PETSC ERROR: Libraries linked from
> /home/paulo/libmesh/contrib/petsc-2.3.2-p10/lib/linux
> [0]PETSC ERROR: Configure run at Fri Apr 11 11:58:22 2008
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
> --with-fc=g77 --with-shared=1 --download-f-blas-lapack=1
> --download-superlu=1 --with-mpi-dir=/usr/lib/mpich
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: KSPSolve_PREONLY() line 26 in
> src/ksp/ksp/impls/preonly/preonly.c
> [0]PETSC ERROR: KSPSolve() line 372 in src/ksp/ksp/interface/itfunc.c
> [0]PETSC ERROR: User provided function() line 396 in
> unknowndirectory/src/numerics/petsc_linear_solver.C
> [0] MPI Abort by user Aborting program !
> [0] Aborting program!
> p0_20759:  p4_error: : 83
> 
> 
> Paulo
> 
> 
> 
> 
> > On Thu 2008-04-10 14:09, [EMAIL PROTECTED] wrote:
> >> Hi,
> >> How can I use a direct solver to solve a linear system of equations?
> >> Thanks in advance,
> >> Paulo
> >
> > You can do this entirely with PETSc command line arguments.  For instance
> >
> > -ksp_type preonly -pc_type lu
> >
> > will solve the system using LU decomposition.  If your matrix is
> > symmetric, you
> > can try -pc_type cholesky.  You can select different direct solvers by
> > changing
> > the matrix type with -mat_type.  Run the program with -help and you will
> > see the
> > supported types (such as umfpack, superlu, aijspooles, sbaijmumps).
> > Depending
> > on the problem, you may want to try preconditioning with algebraic
> > multigrid.
> > You can build PETSc with libraries like Hypre, ML, and Prometheus, then
> > use
> > -pc_type hypre.  For 3D problems, I find this starts beating a direct
> > method
> > for quite small sizes.
> >
> > Jed

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to