Actual source code: ex65.c

  1: static const char help[] = "Tests for mesh transformation using only options";

  3: #include <petscdmplex.h>

  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));

 12:   PetscCall(PetscObjectSetOptionsPrefix((PetscObject)*dm, "phase_1_"));
 13:   PetscCall(DMSetFromOptions(*dm));
 14:   PetscCall(PetscObjectSetOptionsPrefix((PetscObject)*dm, NULL));

 16:   PetscCall(DMViewFromOptions(*dm, NULL, "-dm_view"));
 17:   PetscFunctionReturn(PETSC_SUCCESS);
 18: }

 20: int main(int argc, char **argv)
 21: {
 22:   DM dm;

 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: }

 32: /*TEST

 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

 39: TEST*/