Hi Ellya,
it sounds to me as if there is a problem with your formulation. I'm not sure I'm able to solve your problem completely, but I have a few pointers which might help:
- You can try to solve the system more accurately by "re-iterating the system". You can do this by using the preconditioned Richards iteration and setting the direct solver as the "preconditioner"
Code:
def SolveProblem():
Rhs.Assemble()
a.Assemble()
inv = a.mat.Inverse(FEMspace.FreeDofs())
uh.vec.data = solvers.PreconditionedRichardson(a=a, rhs=Rhs.vec, pre=inv, maxit=10, tol=1e-5, printing=True)
- It looks like your trying a Nitsche formulation:
- Are you not missing the consistency (and symmetry) terms? (I've only worked with 2nd order problems personally, so don't take my word for it).
- From my experience, the penalty parameter you choose as 10, seems a but small
- As you have a fourth order problem, and the problem appears not to be solvable for small h, maybe it's worth checking out the h scaling in the derivation of your penalty term? Should it not be 1/h**2 to be consistent? (Then also k**4, I guess.)
Using the re-iteration, increasing the penalty term to 100 * k**4 /(h**2), the error estimator decreased in each step down to 10
-13.
As a sidenote: You can compute the 2-norm of the residual more easily with
Code:
res = Norm(temph.vec)
I hope this helps you to solve the problem!
Best wishes,
Henry