1 static const char help[] = "Tests for mesh transformation using only options";
2
3 #include <petscdmplex.h>
4
CreateMesh(MPI_Comm comm,DM * dm)5 static PetscErrorCode CreateMesh(MPI_Comm comm, DM *dm)
6 {
7 PetscFunctionBegin;
8 PetscCall(DMCreate(comm, dm));
9 PetscCall(DMSetType(*dm, DMPLEX));
10 PetscCall(DMSetFromOptions(*dm));
11
12 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)*dm, "phase_1_"));
13 PetscCall(DMSetFromOptions(*dm));
14 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)*dm, NULL));
15
16 PetscCall(DMViewFromOptions(*dm, NULL, "-dm_view"));
17 PetscFunctionReturn(PETSC_SUCCESS);
18 }
19
main(int argc,char ** argv)20 int main(int argc, char **argv)
21 {
22 DM dm;
23
24 PetscFunctionBeginUser;
25 PetscCall(PetscInitialize(&argc, &argv, NULL, help));
26 PetscCall(CreateMesh(PETSC_COMM_WORLD, &dm));
27 PetscCall(DMDestroy(&dm));
28 PetscCall(PetscFinalize());
29 return 0;
30 }
31
32 /*TEST
33
34 # This verifies the correctness of an extruded coordinate space
35 test:
36 suffix: ext_coord_space
37 args: -dm_plex_dim 1 -dm_plex_box_faces 1 -phase_1_dm_extrude 1 -phase_1_dm_plex_transform_extrude_use_tensor 0 -cdm_dm_petscds_view
38
39 TEST*/
40