Hi. I’m using dolfin 2018.1.0 to solve an eigenvalue problem using finite elements. I want to assemble the matrix “a” given by “a = inner(u , grad(p * v) )*dx”, where u is the Trial Function, v the Test Function and p(x) an scalar function. But when I try run
a = inner(u , grad(p * v) )dx
dummy = vdx
A = PETScMatrix()
l = PETScVector()
assemble_system(a, dummy, bcs, A_tensor=A, b_tensor=l) #bcs the Boundary Conditions
I receive the error message “Cannot determine geometric dimension from expression”. What is the correct way to perform the matrix inner(u , grad(p * v) )*dx?
at a glance it looks like some of your Expression objects haven’t been provided with a reference to your mesh. This means the ufl.grad operator cannot implicitly determine their geometric dimension. E.g. p = Expression("...", ..., domain=mesh) would rectify such an issue.