Hi,
I am trying to solve torsion Laplace equation with Neuman boundary
dw/dn = ynx-xny
Following code works well for a ellipse geometry, but it doesn’t work for a circle one. Not sure what’s the difference in between.
#Construct ngsolve FE space with direchlet boundary at out of section
fes = H1(mesh, order=3)#,dirichlet = "bcOuter")
#Declare test function, trial function, and grid function
u = fes.TrialFunction() # symbolic object
v = fes.TestFunction() # symbolic object
gfu = GridFunction(fes) # solution
#gfu.Set(555,definedon=mesh.BBoundaries("FixedPoint"))
a = BilinearForm(fes)
f = LinearForm(fes)
R=0
#Set Neumann boundary expression
n = specialcf.normal(mesh.dim)
G=InnerProduct(CF((y,-x)),n)
a += grad(u)*grad(v)*dx
f += R*v*dx + G*v*ds(definedon="bcOuter")
a.Assemble()
f.Assemble()
aInverse = a.mat.Inverse(freedofs=fes.FreeDofs())
gfu.vec.data = aInverse * f.vec
The ellipse gives right solution:
However, for circular section, the result is not right