Dear sir, I am not able to add two matrices, i.e., A+1jB, where A and B are matrices obtained by variational problem and I am attaching code and error also. And I am using dolfin 2019.2.0 version.
rom dolfin import*
import numpy as np
import matplotlib.pyplot as plt
mesh = UnitCubeMesh(1, 1, 1)
#plot(mesh)
#plt.show()
V=FunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
#print(mesh.num_edges())
u=TrialFunction(V)
v=TestFunction(V)
s = dot(curl(v), curl(u))*dx
m = inner(v, u)*dx
n = FacetNormal(V)
s_0 = inner(cross(n, v), cross(n, u))*ds
S=Matrix()
assemble(s, tensor=S)
M=Matrix()
assemble(m, tensor=M)
S_0=Matrix()
assemble(s_0, tensor=S_0)
A =S- M +1j*S_0
error is
Traceback (most recent call last):
File “bokada.py”, line 24, in
A =S- M +1j*S_0
TypeError: unsupported operand type(s) for *: ‘complex’ and ‘dolfin.cpp.la.Matrix’
please help me in this case