xref: /petsc/src/dm/impls/plex/tests/ex50.c (revision d71ae5a4db6382e7f06317b8d368875286fe9008)
1 static char help[] = "Test global numbering\n\n";
2 
3 #include <petscdmplex.h>
4 #include <petscsf.h>
5 
6 int main(int argc, char **argv)
7 {
8   DM      dm;
9   IS      point_numbering;
10   PetscSF point_sf;
11 
12   PetscFunctionBeginUser;
13   PetscCall(PetscInitialize(&argc, &argv, NULL, help));
14   PetscCall(DMCreate(PETSC_COMM_WORLD, &dm));
15   PetscCall(DMSetType(dm, DMPLEX));
16   PetscCall(DMSetFromOptions(dm));
17   PetscCall(DMViewFromOptions(dm, NULL, "-dm_view"));
18 
19   PetscCall(DMPlexCreatePointNumbering(dm, &point_numbering));
20   PetscCall(ISViewFromOptions(point_numbering, NULL, "-point_numbering_view"));
21   PetscCall(ISDestroy(&point_numbering));
22 
23   PetscCall(DMGetPointSF(dm, &point_sf));
24   PetscCall(PetscSFViewFromOptions(point_sf, NULL, "-point_sf_view"));
25 
26   PetscCall(DMDestroy(&dm));
27   PetscCall(PetscFinalize());
28   return 0;
29 }
30 
31 /*TEST
32 
33   test:
34     nsize: 2
35     args: -dm_plex_simplex 0 -dm_plex_box_faces 2,2 -dm_view -point_numbering_view -petscpartitioner_type simple
36 TEST*/
37