I want to solve a nonlinear magnetic problem.
I have defined a BH function using scipy.
I can not generate H from B with the error
ValueError: object arrays are not supported
from numpy import *
from scipy import interpolate
mu0 = 4*pi*1e-7
H = linspace(0, 100e3, 1000)
B = 2 * tanh(H / 10e3) + mu0 * H
BH= interpolate.interp1d(B, H)
import ngsolve
print(ngsolve.__version__)
from ngsolve import *
from ngsolve.webgui import Draw
mesh = Mesh(unit_square.GenerateMesh(maxh=0.1))
fes = H1(mesh, order=2, dirichlet="left|right|bottom|top")
B = GridFunction(fes)
B.Set(x)
H = BH(B)