Is there a simple way to apply boundary condition on a generalized eigenvalue solver?
Here is what I did to apply a zero dirichlet boundary condition on a generalized eigenvalue solver:
u0 = Constant(0.0)
bc = DirichletBC(V, u0, boundary)
u = TrialFunction(V)
v = TestFunction(V)
c1s=0.5*inner(nabla_grad(u),nabla_grad(v))*dx+u*v2s*v*dx-u*v_ext_corr*v*dx
m=u*v*dx
b=v*dx
C1s, _ = assemble_system(c1s, b, bc)
M, _ = assemble_system(m, b, bc)
bc.zero(M)
C1s = down_cast(C1s)
M = down_cast(M)
eigensolver = SLEPcEigenSolver(C1s, M)