<div dir="ltr">I am trying to solve a multi-physics problem consisting of some physics on a rectangular domain which is split in half such that one set of physics is solved on the left, and the other set of physics is solved on the right.<div><br></div><div>Each set has their own set of variable components, and I would like to not allocate both variable sets across the entire domain because the physics in one subdomain happens to have lots of components per mesh element, which the other subdomain doesn't need except to compute boundary interactions.<br><br>For testing right now, I am using the attached gmsh file to generate a mesh with 2 physical groups to represent each subdomain (called "left" and "right"). It has periodic boundaries on all sides.</div><div><br></div><div>However, when I try to load the generated mesh into PETSc using the <b>DMPlexCreateFromFile</b> function, PETSc complains that the mesh is not a valid Gmsh file. I've attached the sample mesh, as well as the error message PETSc spits out.</div><div><br></div><div>Here's the relevant code (should be a complete working example) which re-creates what I'm doing:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">#include <petsc.h></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">int main(int argc, char** argv)<br>{<br>  PetscInitialize(&argc, &argv, NULL, "multi physics testing");<br>  DM dm;<br>  CHKERRQ(DMPlexCreateFromFile(PETSC_COMM_WORLD, "periodic_square.msh", PETSC_TRUE, &dm));<br>  PetscFinalize();<br>}</blockquote><div><br></div><div>What is the correct procedure for creating a multi-physics mesh using PETSc DM objects for mesh management?</div><div><br></div></div></div>