How can I use Q2-P1dc element pair in a quadrilateral mesh to solve Stokes?

1 week 3 days 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.,
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

Please Log in or Create an account to join the conversation.

1 week 3 days ago #3681 by Younghigh
If I just simply run the following 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?

Please Log in or Create an account to join the conversation.

1 week 2 days ago #3683 by Younghigh
Thank u again. Using the VtkOutput and viewing in ParaView can realize your idea. Nice suggestion.

Please Log in or Create an account to join the conversation.

1 week 2 days ago #3684 by Guosheng Fu
If you run
python3 test.py
and want to see the pop up gui, put the following line after Redraw().
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

Please Log in or Create an account to join the conversation.

© 2019 Netgen/NGSolve