i am still quite new to FEniCS and am working on the biharmonic equation by reducing the system, so i can use H1 elements. However i want to calculate the eigenvalues of a clamped plate, my code right now produces eigenvalues for a simply supported plate, i am certain that the boundary conditions are the problem.
The boundary conditions are the dirichlet boundary 0 and the second needed boundary is that the normal derivative on the boundary is also 0. My initial thought was that the neumann boundary wasn’t neccesary to add, because it is either way 0.
Thanks in advance for every suggestion!
The code is the following:
mesh = UnitSquareMesh(10,10)
X = FiniteElement('CG', mesh.ufl_cell(), 2)
Y = FiniteElement('CG', mesh.ufl_cell(), 2)
Z = X * Y
S = FunctionSpace(mesh, Z)
u = TrialFunctions(S)
phi = TestFunctions(S)
a = inner(grad(u[1]), grad(phi[0]))*dx + inner(grad(u[0]), grad(phi[1]))*dx
def boundary(x, on_boundary):
return on_boundary
bc = DirichletBC(S, Constant((0.0,0.0)), boundary)
g = Constant(0.0)
L_dummy = Constant(0)*phi[0]*dx
m = u[0]*phi[0]*dx + u[1]*phi[1]*dx
A, _ = assemble_system(a,L_dummy,bc)
B = assemble(m)
eigensolver = SLEPcEigenSolver(as_backend_type(A), as_backend_type(B))
eigensolver.parameters['spectrum'] = 'target real'
eigensolver.parameters['tolerance'] = 1e-6
eigensolver.solve()
r, c, rx, cx = eigensolver.get_eigenpair(0)
print("Eigenvalue: ", r)
ef = Function(S)
ef.vector()[:] = rx
plot(ef[0])
plt.show()
Hi, thanks for the hint! I immediately treid it, however i get an error indicating that the SLEPcEigensolver is now unable to extract the eigenpair. The message being:
*** Error: Unable to extract eigenpair from SLEPc eigenvalue solver.
*** Reason: Requested eigenpair (0) has not been computed.
*** Where: This error was encountered inside SLEPcEigenSolver.cpp.
*** Process: 0
Minor update: i tried your solution for two subdomains and now don’t get any error message, however the same result, as to begin with. But still thanks for your hint and your time.
The element i use is the regular lagrange element “CG”. But i’ll keep in mind for future projects, that there is a possibility to examine the output more closely
Now the value is the problem on a unit square plate the first eigenvalue is 35.9861 in the reference i want to validate my work with. The value i get is 19.74058961530659 which is the same value i found in a thesis about supported unit square plates.
Hi Nate, me and my supervisor reviewed what you linked in your last replay and we found it very usefull. I just wanted to give you an update and thank you for your help!