I recently started to work with NGSolve.
I would like to work with the tensor product space. However it always crashes when it comes to HCurl and HDiv. Or at least if I try to evaluate a function of a tensor product space with HDiv/HCurl. One small example would be:
Code:
from ngsolve.TensorProductTools import *
from ngsolve import *
from netgen.geom2d import unit_square
import netgen.gui
%gui tk
meshx = Mesh(unit_square.GenerateMesh(maxh=0.15))
mesht = Mesh(SegMesh(20,0,1,periodic=True) )
tpmesh = Mesh(MakeTensorProductMesh(mesht,meshx))
Draw(tpmesh)
n=1
m=1
fesx = HDiv(meshx,order=n)
fest = H1(mesht,order=m)
tpfes = TensorProductFESpace([fest,fesx])
u = GridFunction(tpfes)
gtest = x
g = ProlongateCoefficientFunction(gtest,0,tpfes)
u.Set(g)
It crashes with the "u.Set()". When I looked into the code it seemed to me, that the ".Set" uses the ".GetFE"-routine which isn't implemented for the two spaces HDiv and HCurl.
My problem is that I haven't found the right Set/evaluation routines for those two spaces. Could you give me some advise about the parts of the code I should look into to fix this problem?