On Sat, Jul 30, 2016 at 12:19 PM, Andrew Ho <andre...@uw.edu> wrote: > 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. > > 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. > > 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. > > However, when I try to load the generated mesh into PETSc using the > *DMPlexCreateFromFile* 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. > > Here's the relevant code (should be a complete working example) which > re-creates what I'm doing: > > #include <petsc.h> > > >> int main(int argc, char** argv) >> { >> PetscInitialize(&argc, &argv, NULL, "multi physics testing"); >> DM dm; >> CHKERRQ(DMPlexCreateFromFile(PETSC_COMM_WORLD, "periodic_square.msh", >> PETSC_TRUE, &dm)); >> PetscFinalize(); >> } > > > What is the correct procedure for creating a multi-physics mesh using > PETSc DM objects for mesh management? >
1) I don't use Physical Groups from GMsh since its unclear how this would be reflected in the discretization 2) You should make a PetscSection representing your data layout, which is discussed in the manual and in the tutorials. The number of dofs on different cells/edges/vertices will be different across the mesh (it sounds like from your description). 3) Obviously this means the closures of different cells will be different sizes. I am not sure how your assembly is setup to handle this. Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener