Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

boundary condition of TangentialFacetFESpace

More
3 years 1 month ago #3521 by Manuel Sanchez
Hi all,

I am trying to impose boundary Dirichlet boundary conditions on a TangentialFacetFESpace but I am not sure if I am doing it correctly.

For instance, consider a coarse mesh of the unit cube such that the top face is split in 2 and the trace space

Nh = TangentialFacetFESpace(mesh, order = 0, dirichlet='top')

if the exact solution is u = (1,0,0) then it has the same tangential component on the top face. so I simply set

gfu = GridFunction(Nh)
gfu.Set(u, definedon=mesh.Boundaries('top') )

I was expecting to see a couple of (1,0) for the components on the Dirichlet faces but I obtained instead (1/3,1/3) and (2/3,-1/3). Would you please explain how these are computed.

Best,
More
3 years 1 month ago #3522 by mneunteufel
Hi Manuel,

the vector of the GridFunction saves the coefficients of the polynomial basis used for the TangentialFacetSpace, which should be the Nedelec basis functions. As they are not e.g. (1,0,0), but u*grad(v)-v*grad(u) with u,v barycentric coordinates, the coefficient vector does not include ones.

For more information about the computation of these coefficients (local L2 projection or usage of dual shapes) see this tutorial .

If you are unsure if the interpolation is correct, you can test it with
Code:
u = CoefficientFunction((1,0,0)) gfu = GridFunction(Nh) gfu.Set(u, definedon=mesh.Boundaries('top') ) print(sqrt(Integrate((gfu-u)*(gfu-u), mesh, definedon=mesh.Boundaries('top'))))

Best,
Michael
Time to create page: 0.147 seconds