Hello all. I am relatively new to FEniCS. I am trying to solve the Helmholtz wave equation in a mixed space for electromagnetic problems with complex values. I am receiving a strange error I don't know how to handle when I attempt to export the data for visualization.
Here is what I believe to be the only relevant parts of the code:
# Formulation
mesh = UnitSquareMesh(100, 100)
Vreal = FunctionSpace(mesh,"Nedelec 1st kind H(curl)", 2)
Vimag = FunctionSpace(mesh,"Nedelec 1st kind H(curl)", 2)
V = Vreal*Vimag
E0 = Constant((1,1))
E = TrialFunction(V)
Ereal, Eimag = split(E)
v = TestFunction(V)
vreal,vimag = split(v)
# Solve system
E = Function(V)
E_vector = E.vector()
solve(A, E_vector, b)
# Plot and export solution
plot(E,mode = "color", interactive = False)
file = File("Plasmonics.pvd")
file << E
Error:
*** Error: Unable to write data to VTK file.
*** Reason: Don't know how to handle vector function with dimension other than 2 or 3.
*** Where: This error was encountered inside VTKFile.cpp.
I am not certain what the issue is and why I am receiving this error. Especially because similar examples do not have this issue. I hope I have provided enough code. Any help would be greatly appreciated.