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 DM dm; 8 IS point_numbering; 9 PetscSF point_sf; 10 11 PetscFunctionBeginUser; 12 PetscCall(PetscInitialize(&argc, &argv, NULL, help)); 13 PetscCall(DMCreate(PETSC_COMM_WORLD, &dm)); 14 PetscCall(DMSetType(dm, DMPLEX)); 15 PetscCall(DMSetFromOptions(dm)); 16 PetscCall(DMViewFromOptions(dm, NULL, "-dm_view")); 17 18 PetscCall(DMPlexCreatePointNumbering(dm, &point_numbering)); 19 PetscCall(ISViewFromOptions(point_numbering, NULL, "-point_numbering_view")); 20 PetscCall(ISDestroy(&point_numbering)); 21 22 PetscCall(DMGetPointSF(dm, &point_sf)); 23 PetscCall(PetscSFViewFromOptions(point_sf, NULL, "-point_sf_view")); 24 25 PetscCall(DMDestroy(&dm)); 26 PetscCall(PetscFinalize()); 27 return 0; 28 } 29 30 /*TEST 31 32 test: 33 nsize: 2 34 args: -dm_plex_simplex 0 -dm_plex_box_faces 2,2 -dm_view -point_numbering_view -petscpartitioner_type simple 35 TEST*/ 36