How to plot 2D-quadrilateral mesh?


86
views
2
5 weeks ago by
Aby  
Hello All,

I am new to FEniCS and trying to create a quadrilateral mesh as shown in the following figure:

I tried to use the following code:


N = 5
mesh = UnitSquareMesh.create(N, N, CellType.Type_quadrilateral)​
Can I please get some help on how to plot this mesh? I observed that 'matplotlib' does not support quadrilateral elements.

Thank you very much for your valuable guidance.
Community: FEniCS Project
Check out paraview
written 5 weeks ago by klunkean  
Thanks a lot for your reply can you please provide more details.

I also tried to save it in XDMF format but not very helpful.
written 5 weeks ago by Aby  
1
Save your mesh to a pvd file:
from fenics import *

N = 5
mesh = UnitSquareMesh.create(N, N, CellType.Type_quadrilateral)

File('mesh.pvd') << mesh​

install paraview and open mesh.pvd

      
written 5 weeks ago by klunkean  
Ton thanks! This worked perfectly.
written 5 weeks ago by Aby  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »