Periodic homogenization

Hello all,

I’m trying to create a periodic homogenization on my mesh which contains two different materials like the following tutorial:

I can import my mesh, but I don’t know what to import as the subdomain and the facet in MeshFunction.
Thanks in advance for your guid.

Hi, you should tell us how you generate your mesh and how you mark the corresponding subdomains and boundary domains within your mesh.

Hi Mr. Bleyer,
Thanks a lot for your reply,
I have created it on GMSH (a 2D mesh that is periodic on the boundary) and imported the XML format in FEniCS. I see that you have used other XML formats for subdomain and facets. Can you please tell me what file should I import for subdomains (and facets if I have two materials)?

If you use the legacy dolfin-convert script it should generate the *_physical_region.xml and *_facet_region.xml file automatically if you have properly tagged the corresponding domains and boundaries in your Gmsh script.
However, this script is no longer maintained and the current practice is to rely on meshio and XDMF formats (see here Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio)

Thank you so much,
The problem was that I had not tagged the domains as you mentioned. Now, I have tagged two different surfaces, but still there is no my_facet_region.xml file! How can I create that?

You must tag the boundaries as well.

Thank you so much,

One more question:
I can run the program with my input now. But, how can I have access to deformed mesh after applying the strain?