On 12/04/2009, David Knezevic wrote:

> I've been trying to add support for ShellMatrix in SlepcEigenSolver,  
> following the approach in PetscLinearSolver, where a private  
> function _petsc_shell_matrix_mult is used to define the shell  
> matrix's vector_mult function.
>
> This works fine for standard eigenvalue problems -- a modifed  
> version of ex16 using a ShellMatrix works fine. But I haven't yet  
> got it working for generalized eigenproblems. I've attached a patch  
> (slepc-patch) for the changes I've made to EigenSolver and  
> SlepcEigenSolver, as well as a modified version of ex17 that uses  
> shell matrices (in this case, both A and B are shell matrices --  
> I've also tried it when only matrix_A is a shell matrix, but I get  
> the same error). The gdb stack trace when the modified ex17 crashes  
> is pasted below.
>
> If anyone has some insights into what is going wrong here (and why  
> the generalized eigenvalue problem behaves differently to the  
> standard eigenvalue problem), that'd be a big help!
>
> Best wishes,
> Dave

I think I found the source of the problem: you forgot to call this- 
 >init() at the beginning of  
SlepcEigenSolver<T>::solve_generalized(ShellMatrix<T>  
&shell_matrix_A, ...

Note that with shell matrices SLEPc methods are rather limited,  
particularly for generalized eigenproblems. Currently, generalized  
eigenproblems are treated internally in one of two ways basically:
1. Operating with matrix B^-1 A (the default mode).
2. Operating with matrix (A-sigma B)^-1 B (the shift-and-invert mode).

In the first case, you need to solve linear systems with B. If B is a  
shell matrix, then you would have to specify something like - 
st_ksp_type gmres -st_pc_type none (without preconditioner, which is  
likely to fail to converge) or -st_ksp_type gmres -st_pc_type jacobi  
(with Jacobi preconditioner in which case you need to define operation  
GetDiagonal on B). All these options can be set in the source code as  
well.

For the shift-and-invert case, thing may get more complicated.

See the SLEPc documentation for additional details, and let us know if  
you need further assitance with this.

Best regards,
Jose


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to