Hello all,
I am writing here again as the community has proven to be so helpful for me.
I am trying to find the eigenvalues and -vectors of the waveequation for vectorial quantities,
but it seems like there are some details in how to properly define the problem that I do not understand.
Find code excerpts below:
N=10
mesh = UnitCubeMesh(N,N,N)
V = VectorFunctionSpace(mesh, family='CG', degree=1, dim=3)
bc = DirichletBC(V,[0, 0, 0],boundary)
materials = MeshFunction("size_t", mesh, mesh.topology().dim(), 0)
eps = Permittivity(materials, 2, 1, degree=0)
subdomain_0 = Omega_0()
subdomain_1 = Omega_1()
subdomain_0.mark(materials, 0)
subdomain_1.mark(materials, 1)
space = helmholtz_wellposed(mesh, V, bc, 1E7, eps)
The method helmholtz_wellposed is slightly adjusted from one that is on the website:
def helmholtz_wellposed(mesh, V, bc, approxEig, eps):
u, v = TrialFunction(V), TestFunction(V)
a = inner(grad(u), grad(v))*dx
L = inner(as_vector((0,0,0)),v) (1)
m = eps*u*v*dx (2)
A, _ = assemble_system(a, L, bc)
B = assemble(m)
I mainly have questions about the lines marked as (1) and (2). First of all, for some reason (1) throws an error (“ufl.log.UFLException: This integral is missing an integration domain.”) if I multiply with dx. Why?
Removing the dx then throws an error at line (2): “ufl.log.UFLException: Invalid ranks 1 and 1 in product.”. Same question: Where is this error coming from and how do I solve it?