xref: /petsc/src/dm/tests/ex49.c (revision df4cd43f92eaa320656440c40edb1046daee8f75)
1 static char help[] = "Test basic DMProduct operations.\n\n";
2 
3 #include <petscdm.h>
4 #include <petscdmproduct.h>
5 
6 int main(int argc, char **argv)
7 {
8   DM       dm;
9   PetscInt dim;
10 
11   PetscFunctionBeginUser;
12   PetscCall(PetscInitialize(&argc, &argv, (char *)0, help));
13   dim = 1;
14   PetscCall(PetscOptionsGetInt(NULL, NULL, "-dim", &dim, NULL));
15   PetscCall(DMCreate(PETSC_COMM_WORLD, &dm));
16   PetscCall(DMSetType(dm, DMPRODUCT));
17   PetscCall(DMSetDimension(dm, dim));
18   PetscCall(DMSetFromOptions(dm));
19   PetscCall(DMSetUp(dm));
20   PetscCall(DMDestroy(&dm));
21   PetscCall(PetscFinalize());
22   return 0;
23 }
24 
25 /*TEST
26 
27    test:
28       suffix: basic_1
29 
30 TEST*/
31