Hello !
I’m currectly using FreeFEM++ to compute electronic structures.
I wrote a FreeFREM++ code supposed to compute the lowest eigenvalues and eigenfunctions of the Schrödinger equation in 2D, that is to solve the elliptic eigenvalue problem
\frac 12 \Delta u(x) + V(x) u(x) = E u(x) on a square with periodic boundary, where V is a given function.
The eigenvalues (E_n) are ranked in nondecreasing order : E_1 \le E_2 \le E_3 …
Following the example of acoustics I found in Acoustics , I used the following code lines to solve the resulting generalized eigenvalue problem:
int nev=5;
real[int] ev(nev);
Vh[int] eV1 (nev);
real sigma= 0.0;
real scale=10;
int k=EigenValue(K,M,sym=true, sigma=sigma, value=ev,vector=eV1,tol=1e-10,maxit=0,ncv=0);
I tried to use your example but couldn’t make it work because of an unsuccessful installation of PETSc & SLEPc on my virtual machine.
So I tried to make it work on the cluster of my workplace, where FreeFEM++ is compiled without SLEPc/PETSc in /3rdparty folder. (I need to sudo make install some files, but don’t have rights to sudo.
I tried to load my own installation of SLEPc/PETSc : the library seems to be loaded but I can’t call a single function of it.
Example given :
load " “/home/…/SLEPc.so” "
load " “/home/…/PETSc.so” "
If I try to call for example the function EPSSolve, I’m told that the identifier EPSSolve doesn’t exist.
Maybe isn’t it possible to load a library this way ?
You don’t need to use sudo if you build FreeFEM with a prefix. You must do that when on a cluster. Please configure and install FreeFEM correctly, see, e.g., README.md, and then try again.