Proposal: add DMPlexCreateFromOptions()
It seems like every example and bit of user code repeats a lot of code for reading from a file or box mesh or sphere mesh, etc., whether to distribute, interpolate, and/or refine. I think we should make one function that will do all the options processing. Strawman proposal:
PetscErrorCode DMPlexCreateFromOptions(MPI_Comm, const char *prefix, PetscBool interpolate, PetscBool distribute, DM *dm);
interpolate
and distribute
here would just be defaults that would be controllable via -dm_plex_interpolate
. I'd prefer to remove distribute
(make it default true) if you don't really need it (makes for more scalable code in which the original mesh could be distributed from conception).
Then we'd have options like
-dm_plex_create <file,box,sphere,tps>
-dm_plex_file fancymesh.gmsh
-dm_plex_box_faces 3,4,5
-dm_plex_tps_type gyroid
and similar for others.