Actual source code: ex45.c

  1: static char help[] = "Tests mesh reordering\n\n";

  3: #include <petscdmplex.h>

  5: int main(int argc, char **argv)
  6: {
  7:   DM dm;

  9:   PetscFunctionBeginUser;
 10:   PetscCall(PetscInitialize(&argc, &argv, NULL, help));
 11:   PetscCall(DMCreate(PETSC_COMM_WORLD, &dm));
 12:   PetscCall(DMSetType(dm, DMPLEX));
 13:   PetscCall(DMSetFromOptions(dm));
 14:   PetscCall(DMViewFromOptions(dm, NULL, "-dm_view"));
 15:   PetscCall(DMDestroy(&dm));
 16:   PetscCall(PetscFinalize());
 17:   return 0;
 18: }

 20: /*TEST

 22:   testset:
 23:     requires: triangle
 24:     args: -dm_plex_box_faces 3,3 -dm_plex_reorder rcm -dm_view ::ascii_info_detail

 26:     test:
 27:       suffix: 0

 29:     test:
 30:       suffix: 1
 31:       nsize: 2
 32:       args: -petscpartitioner_type simple

 34:   testset:
 35:     args: -dm_plex_simplex 0 -dm_plex_box_faces 4,4 -dm_plex_reorder rcm -dm_view ::ascii_info_detail

 37:     test:
 38:       suffix: 2

 40:     test:
 41:       suffix: 3
 42:       nsize: 2
 43:       args: -petscpartitioner_type simple

 45:   # The space-filling curve orders the cells from their coordinates, so it needs neither an
 46:   # adjacency graph nor an interpolated mesh. The reorder runs before the distribution, so on two
 47:   # processes the second one orders an empty set of cells.
 48:   testset:
 49:     args: -dm_plex_simplex 0 -dm_plex_box_faces 4,4 -dm_plex_reorder morton -dm_view ::ascii_info_detail

 51:     test:
 52:       suffix: 4

 54:     test:
 55:       suffix: 5
 56:       nsize: 2
 57:       args: -petscpartitioner_type simple

 59:     test:
 60:       suffix: 6
 61:       args: -dm_plex_interpolate 0

 63: TEST*/