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.

Gradient of an Interpolated Trial/Test Function

More
1 year 3 months ago #4624 by Wenzheng Kuang
Dear community,

I am trying to add to the bilinear form the row-gradient of a vector-version Crouzeix-Raviart element after its interpolation onto the RT0 element. My code looks like this:
Code:
W0 = HDiv(mesh, order=0, RT=True, dirichlet=dirichBDs) V_cr1 = FESpace('nonconforming', mesh, dirichlet=dirichBDs) V_cr2 = FESpace('nonconforming', mesh, dirichlet=dirichBDs) fes_cr = V_cr1 * V_cr2 (ux_cr, uy_cr), (vx_cr, vy_cr) = fes_cr.TnT() u_cr = CF((ux_cr, uy_cr)) v_cr = CF((vx_cr, vy_cr)) a_cr = BilinearForm(fes_cr) a_cr += -Grad(Interpolate(v_cr, W0)) * wind * Interpolate(u_cr, W0) * dx

But I can not get the desired results, and after debugging we found it should be due to the "Grad(Interpolate())" is not returning the row gradient of the interpolated RT0 function. May I ask if there is any method to overcome this? Thanks in advance for any insight into this!

Best, 
Wenzheng
Time to create page: 0.110 seconds