Hi,
I am trying to solve a basic 2D time-independent Schrodinger equation using FEniCS
http://imgur.com/KHTaTie
where A is a constant. I have found the following example, which has been very helpful:
http://en.wikiversity.org/wiki/User:Tclamb/FEniCS#Quantum_Harmonic_Oscillator
My problem is a bit more general, however (U(x,y) is defined numerically, it would be a Function on some space V). Does anyone have any experience solving a problem of this form. Specifically, I am unsure of how to write the weak variational form. I suspect it should look something like
http://imgur.com/phcBbKL
where v(x,y) is a trial function. In otherwords, I am wondering how to define the 2D general Schrodinger equation in FEniCs language, where the the Schrodinger Equation for a 1D harmonic oscillater has been previously defined as
#define problem
a = (inner(grad(u), grad(v)) \
+ x2*u*v)*dx
m = u*v*dx
#assemble stiffness matrix
A = PETScMatrix()
assemble(a, tensor=A)
M = PETScMatrix()
assemble(m, tensor=M)
#create eigensolver
eigensolver = SLEPcEigenSolver(A,M)
Thanks