Polygon in DOLFINx

Hello everybody,

since DOLFIN and DOLFINx can’t be used together i was wondering if it is possible to do something like

domain_vertices = [Point(2.25, 1.75),
                          Point(1.0, 3.0),
                          Point(-1.0, 1.0),
                          Point(4.0, -4.0),
                          Point(5.0, -3.0),
                          Point(2.0, 0.0),
                          Point(0.5, 0.0)]                


domain = Polygon(domain_vertices)
mesh = generate_mesh(domain,20)

from DOLFIN in DOLFINx?

Thank you!

Greetings

If you generate your mesh with dolfin and write it to XDMF, you should be able to read it into dolfin-x as shown in Defining subdomains for different materials — FEniCSx tutorial, in particular:

from mpi4py import MPI
import dolfinx.io
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, "mesh.xdmf", "r") as xdmf:
    mesh = xdmf.read_mesh()

Thank you again!
Great work by the way.