xref: /petsc/src/dm/impls/plex/tests/ex30.c (revision 2ff79c18c26c94ed8cb599682f680f231dca6444)
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   PetscFunctionBeginUser;
10   PetscCall(PetscInitialize(&argc, &argv, NULL, help));
11   PetscCall(DMCreate(PETSC_COMM_WORLD, &dm));
12   PetscCall(PetscObjectSetName((PetscObject)dm, "BaryDM"));
13   PetscCall(DMSetType(dm, DMPLEX));
14   PetscCall(DMSetFromOptions(dm));
15   PetscCall(DMViewFromOptions(dm, NULL, "-dm_view"));
16   //PetscCall(DMPlexSetRefinementUniform(dm, PETSC_TRUE));
17   //PetscCall(DMRefine(dm, comm, &rdm));
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: datafilespath hdf5 double !complex !defined(PETSC_USE_64BIT_INDICES)
31     args: -dm_plex_filename ${DATAFILESPATH}/meshes/hdf5-petsc/petsc-v3.16.0/v1.0.0/barycentricallyrefinedcube.h5 -dm_view ascii::ASCII_INFO_DETAIL -ref_dm_refine 1 -ref_dm_view ascii::ASCII_INFO_DETAIL
32 
33 TEST*/
34