When I use the command line option
-ksp_type preonly -pc_type lu
I have to set
ierr = KSPSetInitialGuessNonzero (_ksp, PETSC_FALSE);
( line 225 in "petsc_linear_solver.C" )
elsewhere I get the error message
[0]PETSC ERROR: Running KSP of preonly doesn't make sense with nonzero
initial guess
you probably want a KSP type of Richardson!
... but still PETSC is doing the LU decomposition at every time step...
For this reason I set the option:
ierr = KSPSetOperators(_ksp, matrix->mat(),
precond->mat(),SAME_PRECONDITIONER);
( line 384 in "petsc_linear_solver.C" )
No everything is fine...
But I think it's pretty weird that PETSC gets the option "-pc_type lu"
but not "-ksp_type preonly"...
Also it would be nice to have some direct access to the "ksp"-object to
change default settings... This is possible in class "PetscLinearSolver"
but not from its base class "Linearsolver", which is the object given in
the NewmarkSystem...
For now I'm fine by doing the changes directly in the source code...
Thanks - Mathias
David Knezevic wrote:
>> Ooops, of course, this is what you are already doing. Sorry, haven't
>> had coffee yet :-)
>>
>> But I still think there may be a way to tell PETSc to avoid
>> recomputing the preconditioner at every timestep.
>>
>>
>
> From the petsc manual:
> "When solving multiple linear systems of the same size with the same
> method, several options are available.
> To solve successive linear systems having the same preconditioner matrix
> (i.e., the same data structure
> with exactly the same matrix elements) but different right-hand-side
> vectors, the user should simply call
> KSPSolve,() multiple times. The preconditioner setup operations (e.g.,
> factorization for ILU) will be done
> during the first call to KSPSolve() only; such operations will not be
> repeated for successive solves.
> To solve successive linear systems that have different
> preconditioner matrices (i.e., the matrix elements
> and/or the matrix data structure change), the user must call
> KSPSetOperators() and KSPSolve() for each
> solve. See Section 4.1 for a description of various flags for
> KSPSetOperators() that can save work for such
> cases."
>
> Also, it says that in order to use LU, you should use the option
> "-ksp_type preonly -pc_type lu"
>
>
> - Dave
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Libmesh-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>
--
DDI Mathias Nenning
Institute of Applied Mechanics Tel: +43/(0)316/873-7143
Graz University of Technology Fax: +43/(0)316/873-7641
Technikerstr. 4/II e-mail: [EMAIL PROTECTED]
8010 Graz
http://www.mech.TUGraz.at
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel