Hello.
I tried to solve the Laplace Beltrami eigenvalue problem on the sphere. The usual syntax for storing the eigenfunction does not seem to work. The eigenvalues are captured correctly, but when using vector=eV I get some error.
The code is below. Removing “vector=eV” gives a code which runs and returns the eigenvalues. I am interested to see the eigenvectors also.
Best regards,
Beni
load “msh3”
load “medit”
load “tetgen”
verbosity = 0;
int K = 10;
real hh = 0.05;
// Mesh 2D
mesh Th = square(10, 20, [xpi-pi/2, 2y*pi]); // ]-pi/2, pi/2[X]0, 2pi[
// A parametrization of a sphere
func f1 = cos(x)*cos(y);
func f2 = cos(x)*sin(y);
func f3 = sin(x);
// Partial derivative of the parametrization DF
func f1x = sin(x)*cos(y);
func f1y = -cos(x)sin(y);
func f2x = -sin(x)sin(y);
func f2y = cos(x)cos(y);
func f3x = cos(x);
func f3y = 0;
//M = DF^t DF
func m11 = f1x^2 + f2x^2 + f3x^2;
func m21 = f1xf1y + f2xf2y + f3xf3y;
func m22 = f1y^2 + f2y^2 + f3y^2;
// Periodic condition
func perio = [[4, y], [2, y], [1, x], [3, x]];
// Mesh adaptation
real vv = 1/square(hh);
Th = adaptmesh(Th, m11vv, m21vv, m22vv, IsMetric=1, inquire=1, periodic=perio);
Th = adaptmesh(Th, m11vv, m21vv, m22vv, IsMetric=1, periodic=perio);
Th = adaptmesh(Th, m11vv, m21vv, m22vv, IsMetric=1, periodic=perio);
Th = adaptmesh(Th, m11vv, m21vv, m22vv, IsMetric=1, periodic=perio);
// Sphere
meshS ThS = movemesh23(Th, transfo=[f1, f2, f3]);
plot(ThS);
fespace VhS(ThS,P1);
VhS u,v;
varf a(u,v) =
int2d(ThS)(dx(u)*dx(v) + dy(u)*dy(v)+dz(u)dz(v));
varf b(u,v) = int2d(ThS)( uv );
matrix A= a(VhS,VhS);
matrix B= b(VhS,VhS);
real[int] ev(K+1);
VhS[int] eV(K+1);
real[int,int] eVect(VhS.ndof,K+1);
cout << VhS.ndof << endl;
cout << ThS.nv << endl;
int k = EigenValue(A,B,value=ev,vector=eV,tol=1e-10);
cout << k << endl;
cout << ev << endl;