← Back to team overview

dolfin team mailing list archive

Re: [FEniCS-users] eigenpair from python

 

On Friday 09 October 2009 09:18:30 Johan Hake wrote:
> On Friday 09 October 2009 09:06:19 azumi.hayakawa@xxxxxxxxxxxxxxxxxxx wrote:
> > 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)
> 
> 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)

While at it shouldn't the PETScVectors also be return arguments? Leaving us 
with:

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

Johan

> Johan
> 
> > 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
> > _______________________________________________
> > FEniCS-users mailing list
> > FEniCS-users@xxxxxxxxxx
> > http://fenics.org/mailman/listinfo/fenics-users
> 
> _______________________________________________
> FEniCS-users mailing list
> FEniCS-users@xxxxxxxxxx
> http://fenics.org/mailman/listinfo/fenics-users
> 


Follow ups