xref: /petsc/src/dm/impls/plex/tests/ex30.c (revision f97672e55eacc8688507b9471cd7ec2664d7f203)
1 const char help[] = "Test memory allocation in DMPlex refinement.\n\n";
2 
3 #include <petsc.h>
4 
5 int main(int argc, char **argv)
6 {
7   DM             dm;
8 
9   PetscCall(PetscInitialize(&argc, &argv, NULL, help));
10   PetscCall(DMCreate(PETSC_COMM_WORLD, &dm));
11   PetscCall(PetscObjectSetName((PetscObject) dm, "BaryDM"));
12   PetscCall(DMSetType(dm, DMPLEX));
13   PetscCall(DMSetFromOptions(dm));
14   PetscCall(DMViewFromOptions(dm, NULL, "-dm_view"));
15   //PetscCall(DMPlexSetRefinementUniform(dm, PETSC_TRUE));
16   //PetscCall(DMRefine(dm, comm, &rdm));
17   //PetscCall(DMPlexConvertOldOrientations_Internal(dm));
18   PetscCall(PetscObjectSetName((PetscObject) dm, "RefinedDM"));
19   PetscCall(PetscObjectSetOptionsPrefix((PetscObject) dm, "ref_"));
20   PetscCall(DMSetFromOptions(dm));
21   PetscCall(DMViewFromOptions(dm, NULL, "-dm_view"));
22   PetscCall(DMDestroy(&dm));
23   PetscCall(PetscFinalize());
24   return 0;
25 }
26 
27 /*TEST
28 
29   test:
30     requires: hdf5 double !complex !defined(PETSC_USE_64BIT_INDICES)
31     args: -dm_plex_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/barycentricallyrefinedcube.h5 -dm_view ascii::ASCII_INFO_DETAIL -ref_dm_refine 1 -ref_dm_view ascii::ASCII_INFO_DETAIL
32 
33 TEST*/
34