I am trying to generate quad mesh, but only the triangular mesh is generated.
BIng does not hellp me to solve this problem.
Does anyone know how?
from netgen.csg import Pnt
from netgen.meshing import Element2D, MeshPoint, FaceDescriptor, Mesh
from netgen.webgui import Draw
mesh = Mesh()
#mesh.SetGeometry()
mesh.dim = 2
fd1 = mesh.Add(FaceDescriptor(bc=1,domin=1,surfnr=1))
mesh.SetMaterial(fd1, "Air")
Nx = 3
Ny = 2
v = []
for ny in range(Ny+1):
for nx in range(Nx+1):
v.append(mesh.Add(MeshPoint(Pnt(nx,ny, 0))))
for ny in range(Ny):
for nx in range(Nx):
mesh.Add(Element2D(fd1, [v[(Nx+1)*(ny+0)+(nx+0)], v[(Nx+1)*(ny+0)+(nx+1)], v[(Nx+1)*(ny+1)+(nx+1)], v[(Nx+1)*(ny+1)+(nx+0)]]))
Draw(mesh)