In .geo, .pde days, I would evaluate voltage from magnetic fields as:
define linearform f2 -fespace=v
curlboundaryedge coil2 -imag
numproc evaluate np2a -linearform=f2 -gridfunction=u
but now with python vesion, I get errors while translating it as:
fes2 = ngs.HCurl(mesh, order=2, complex=True)
f1 = ngs.LinearForm(fes2)
coeffA = ngs.CoefficientFunction([ 1 if bnd == cname else 0 for bnd in
mesh.GetBoundaries()])# cname is coil2 of above case
f1 = ngs.LFI(‘curlboundaryedge’, coef=(coeffA))
tval = ngs.Integrate((1j * omega) * gfu * f1, mesh)
Here is the error:
TypeError: mul(): incompatible function arguments. The following argument types are supported:
1. (self: ngsolve.fem.CoefficientFunction, cf: ngsolve.fem.CoefficientFunction) → ngsolve.fem.CoefficientFunction
2. (self: ngsolve.fem.CoefficientFunction, value: float) → ngsolve.fem.CoefficientFunction
3. (self: ngsolve.fem.CoefficientFunction, value: complex) → ngsolve.fem.CoefficientFunction
4. (self: ngsolve.fem.CoefficientFunction, arg0: ngfem::DifferentialSymbol) → ngfem::SumOfIntegrals