Subject: [FEniCS-users] eigenpair from python

From: [email-masked]
Date: Fri, 09 Oct 2009 16:06:19 +0900(東京 (標準時))

Hello list,

I would like to use get_eigenpair function from within
python programmes.  The 1st thing I tried is modifying
demo/la/eigensolver/python/demo.py as follows:
    ---- original
    (lr, lc) = esolver.get_eigenvalue(i)

    ---- modified
    r = PETScVector(A.size(0))
    c = PETScVector(A.size(0))
    esolver.get_eigenpair(lr, lc, r, c, i)

This gave me an error below:
Traceback (most recent call last):
  File "./demo.py", line 46, in <module>
    esolver.get_eigenpair(lr, lc, r, c, i)
  TypeError: in method 'SLEPcEigenSolver_get_eigenpair', argument 2 of type 'double &'

Could some one give some advice on how to use
get_eigenpair function?  Incidentally, cpp demo
ran without an error, and seemed to work fine.

Thanks in advance,
-- Azumi Hayakawa

---

From: Johan Hake <[email-masked]>
Date: Fri, 9 Oct 2009 09:18:30 +0200

>     esolver.get_eigenpair(lr, lc, r, c, i)

There is a bug in the Python wrapper (thanks for noticing!). 

Try using 

   lr, lc = esolver.getEigenpair(r, c, i)

if you are on stable. If you pull the latest code you will soon be able to 
use:

   lr, lc = esolver.get_eigenpair(r, c, i)
 
Johan

> _______________________________________________
> FEniCS-users mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/fenics-users
>

---

From: Johan Hake <[email-masked]>
Date: Fri, 9 Oct 2009 13:06:39 +0200

>    lr, lc = esolver.get_eigenpair(r, c, i)

If you pull from the development repository you can take a look at the demo 
again. 

You can now get the eigen vectors by:

  lr, lc, r_vec, c_vec = esolver.get_eigenpair(i)

or if you want to reuse the PETScVector

  lr, lc, r_vec, c_vec = esolver.get_eigenpair(i, r_vec, c_vec)

Johan

---

From: [email-masked]
Date: Tue, 13 Oct 2009 14:19:48 +0900(東京 (標準時))

Hello Johan,

It works.
Thanks a lot.

-Azumi Hayakawa

From: Johan Hake <[email-masked]>
Subject: Re: [FEniCS-users] eigenpair from python
Date: Fri, 9 Oct 2009 13:06:39 +0200