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.

How to use BDM element in a quadrilateral mesh?

More
3 years 2 weeks ago #3688 by Younghigh
Hi,

When running the following code:
Code:
from ngsolve import * import ngsolve.meshes as ngm mesh = ngm.MakeStructured2DMesh(nx=1,ny=1) V = HDiv(mesh, order=2, RT=False) gfu = GridFunction(V) vtk = VTKOutput(ma=mesh, coefs=[gfu], names=["bdm-basis"], filename="bdm2basis", subdivision=3) for i in range(gfu.vec.size): gfu.vec[:] = 0 gfu.vec[i] = 1 vtk.Do()
I find there are 24 vtk documents shown, which should be RT2 basis in a rectangle. But I have used
Code:
RT=False
, my question is: how to use BDM element in a quadrilateral mesh?


Best,
Di Yang
More
3 years 2 weeks ago #3689 by mneunteufel
Hi Di Yang,

to check the number of degrees of freedom on a single quad for different polynomial orders you can use the following code
Code:
from ngsolve import * from ngsolve.meshes import MakeStructured2DMesh mesh = MakeStructured2DMesh(quads=True,nx=1,ny=1) Draw(mesh) print("RT") for p in range(6): fes = HDiv(mesh, order=p, RT=True) print(p,":",fes.ndof) print("BDM") for p in range(6): fes = HDiv(mesh, order=p+1) print(p,":",fes.ndof)
which gives the output
RT: 0 : 4, 1 : 12, 2 : 24, 3 : 40, 4 : 60, 5 : 84
BDM: 0 : 12, 1 : 24, 2 : 40, 3 : 60, 4 : 84, 5 : 112

As you can see they coincide (RT is "shifted"). The reason for this is that RT elements are available for triangles and tetrahedra, but not for quadrilaterals, hexahedra, or prisms. So there are only BDM elements for quads.

Best
Michael
More
3 years 2 weeks ago - 3 years 2 weeks ago #3690 by Younghigh
Thank u first for your specific replies. However, the dofs of BDMk on any rectangle K are devised as follows.

[tex]
(\mathbf{w}\cdot\mathbf{n}, p_k)_{e_i},\quad \forall\,p_k\in P_k(e_i),\ i=1,2,3,4;
[/tex]
[tex]
(\mathbf{w}, \mathbf{p}_{k-2})_K,\quad \forall\,\mathbf{p}_{k-2}\in (P_{k-2}(K))^2.
[/tex]

So, it should be

[tex]
\mathrm{dim}(BDMk)=k^2+3k+4,
[/tex]

i.e., BDMk
k=1: 8;
k=2: 14;
k=3: 22;
k=4: 32;
...

But if running
Code:
V = HDiv(mesh, order=2, RT=False)
the number of dofs of V is 24. I think it is not a BDM2.

Best,
Di Yang
Last edit: 3 years 2 weeks ago by Younghigh.
More
3 years 2 weeks ago #3691 by mneunteufel
Could be that it is exactly the other way round, sorry.

The Quad-HDiv basis in NGSolve is implemented as described in this thesis .
The basis span Q_{k+1,k} x Q_{k,k+1} if I remember correctly and thus has dimension 2*(k+2)*(k+1)=2k**2+6k+4.

Best
Michael
More
3 years 2 weeks ago #3692 by Younghigh
Ok, that means RTk elements indeed. Thank u very much.
Time to create page: 0.138 seconds