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