On Thu 2008-04-10 18:01, [EMAIL PROTECTED] wrote: > I appreciate your answer but in fact I want to define the solver inside > the code since I have different solvers for different systems. > So I rewrite the question: > How to call a direct solver with something like > 'linear_solver->set_solver_type'? > Thanks > Paulo
I've only dabbled with libmesh, but it looks like '-ksp_type preonly' does not have an analogue. It looks like you could set it with KSPSetType(linear_solver->ksp(), KSPPREONLY); Choosing LU as a preconditioner is more natural: linear_solver->set_preconditioner_type(LU_PRECOND); If the preconditioning matrix is the same as the system matrix, this should make any iterative method converge after one step. Using '-ksp_type preonly' just eliminates some overhead. Also note that you can set a prefix for a particular solver and then set options using the options database. For example, KSPSetOptionsPrefix(schur_linear_solver->ksp(), "schur_"); and then you can specify options like: -schur_ksp_gmres_restart 60 -schur_pc_type asm -schur_sub_pc_factor_levels 1 I hope this help. 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
