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 can I use Q2-P1dc element pair in a quadrilateral mesh to solve Stokes?

More
3 years 2 weeks ago #3680 by Guosheng Fu
First, you shall figure out the basis functions for Qk by yourself. They are classical tensor products of 1D Legendre basis. VectorL2 is simply two copies of Qk on quads.

You can do so by visualize the shape functions of the basis on a unit square without going into details of the c++ code, e.g.,
Code:
mesh = MakeStructured2DMesh(nx=1,ny=1) gfu = GridFunction(VectorL2(mesh, order=2)) Draw(gfu) for i in range(gfu.vec.size): gfu.vec[i] = 1 if i > 1: gfu.vec[i-1] = 0 Redraw() input("next?")
The following user(s) said Thank You: Younghigh
More
3 years 2 weeks ago #3681 by Younghigh
If I just simply run the following code:
Code:
import netgen.gui from ngsolve import * import ngsolve.meshes as ngm mesh = ngm.MakeStructured2DMesh(nx=1,ny=1) gfu = GridFunction(VectorL2(mesh, order=2)) Draw(gfu) gfu.vec[0] = 1 Redraw()
there is nothing shown for me in GUI, which confuses me. Can you tell me some reason?
More
3 years 2 weeks ago #3683 by Younghigh
Thank u again. Using the VtkOutput and viewing in ParaView can realize your idea. Nice suggestion.
More
3 years 2 weeks ago #3684 by Guosheng Fu
If you run
Code:
python3 test.py
and want to see the pop up gui, put the following line after Redraw().
Code:
input("next?")

I think i-tutorials is the good place for you to get familiar with ngsolve.
The following user(s) said Thank You: Younghigh
Time to create page: 0.123 seconds