Hello,
Can I generate custom quadrilateral mesh of second order in dolfinx (using nodes and connectivity) ?
import numpy as np
import meshio
# Define nodal coordinates (8-node second-order quad elements)
points = np.array([
[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [2.0, 0.0, 0.0], # Bottom row (Corner nodes)
[0.5, 0.0, 0.0], [1.5, 0.0, 0.0], # Mid-side nodes on bottom row
[0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [2.0, 1.0, 0.0], # Middle row (Corner nodes)
[0.5, 1.0, 0.0], [1.5, 1.0, 0.0] # Mid-side nodes in the middle row
])
# Define second-order quadrilateral connectivity (8 nodes per quad)
cells = [np.array([
[0, 1, 6, 5, 3, 8, 7, 4], # First quadrilateral element
[1, 2, 7, 6, 4, 9, 8, 5] # Second quadrilateral element
])]
el= basix.ufl.element("CG", "quadrilateral", 2, shape=(3, ))
domain = ufl.Mesh(el)
# Create second-order quadrilateral mesh
quad_mesh = create_mesh(MPI.COMM_WORLD, points, cells, domain)
The above code restarts the kernel. How can I generate the 2nd order quad mesh. I need the 2nd order to use curved elements.
mesh, subdomains, boundaries = gmshio.read_from_msh("2ndorder_quad.msh", MPI.COMM_WORLD,0, gdim=3)
does not take quadratic elements as input.
Thanks