Hello, I am trying to switch my code to parallel, but the new solver I use gives out wrong data. I know its wrong because it doesnt line up with analytical results. Here is the correct implementation:
// Problem
// OP = A - sigma B ; // the shifted matrix
varf op (u1, u2)
= int2d(Th)(
dx(u1)*dx(u2)
+ dy(u1)*dy(u2)
- sigma* u1*u2
)
+ on(a0,a1,a2,a3,a4,a5, u1=0)
;
varf b ([u1], [u2]) = int2d(Th)(u1*u2); //no boundary condition
matrix OP = op(Vh, Vh, solver=Crout, factorize=1); //crout solver because the matrix in not positive
matrix B = b(Vh, Vh, solver=CG, eps=1e-20);
int k = EigenValue(OP, B, sym=true, sigma=sigma, value=ev, vector=eV,
tol=1e-10, maxit=0, ncv=0);
Here is the code I cant get to work:
// Problem
// OP = A - sigma B ; // the shifted matrix
varf op (u1, u2)
= int2d(Th)(
dx(u1)*dx(u2)
+ dy(u1)*dy(u2)
- sigma* u1*u2
)
+ on(a0,a1,a2,a3,a4,a5, u1=0)
;
varf b ([u1], [u2]) = int2d(Th)(u1*u2); //no boundary condition
load "SLEPc"
Mat OP;
include "macro_ddm.idp"
createMat(Th, OP, Pk)
OP = op(Vh, Vh, tgv = -2,sym=1); //crout solver because the matrix in not positive
matrix loc = b(Vh, Vh, tgv = -20, sym =1);
Mat B(OP, loc);
int k = EPSSolve(OP, B, values=ev, vectors=eV,sparams = "-st_type sinvert -eps_nev " + nev + " -eps_target " + sigma);
Any direction will be greatly appreciated.