- Posts: 162
- Karma: 1
- Thank you received: 3
u.n=0
phat = p
uhat.n = 0
returns p, not zero on the boundary edge, as it is sometimes confusing what the magic Other() operator is doing on domain boundary. See this discussion https://ngsolve.org/forum/ngspy-forum/28-inconsistency-between-apply-and-assemble-when-using-other-in-bnd-integral#146 )p.Other()
# A HACK
gf = GridFunction(FacetFESpace(mesh, dirichlet=".*"))
gf.Set(1, BND)
Btr = BilinearForm(trialspace=fes_tr, testspace=fes_u)
Btr += 0.5 * (1+gf)*phat * (v*n) * dx(element_boundary=True)
Please Log in or Create an account to join the conversation.
# test/trial functions
u,v = V.TnT()
uhat, vhat = VF.TnT()
### mass matrix for uhat (diagonal)
Mtr = BilinearForm(VF)
Mtr += uhat*vhat*dx(element_boundary=True)
Mtr.Assemble()
invuhat = Mtr.mat.CreateSmoother(VF.FreeDofs())
### u-->uhat (uhat=average of u)
Bhat = BilinearForm(trialspace=V, testspace=VF)
Bhat += u*vhat*dx(element_boundary=True)
Bhat.Assemble()
traceop = invuhat @ Bhat.mat
Btr = BilinearForm(trialspace=VF, testspace=W, geom_free=True)
Btr += uhat * (r*n) * dx(element_boundary=True)
Btr.Assemble()
Please Log in or Create an account to join the conversation.