xref: /libCEED/examples/petsc/README.md (revision 5754ecac3b7d1ff97b39b25dc78c06350f2c900d)
1## libCEED + PETSc Examples
2
3### CEED bakeoff problems with raw mesh management - bpsraw
4
5This code solves the CEED bakeoff problems on a structured grid generated and referenced using only low-level communication primitives.
6
7To build, run `make bpsraw`
8
9To run, `./bpsraw -ceed [ceed-resource] -problem bp[1-6] -degree [degree]`
10
11In addition to the common arguments, the following arguments may be set:
12
13- `-local`             - Target number of locally owned DoFs per process
14
15### CEED bakeoff problems with DMPlex - bps
16
17This code solves the CEED bakeoff problems on a unstructured grid using DMPlex.
18This example requires a PETSc version later than 3.11.3.
19
20To build, run `make bps`
21
22To run, `./bps -ceed [ceed-resource] -problem bp[1-6] -degree [degree]`
23
24In addition to the common arguments, the following arguments may be set:
25
26- `-mesh`              - Read mesh from file
27- `-cells`             - Number of cells per dimension
28
29#### Running a suite
30
31Some run-time arguments can be passed lists, which allows a single `mpiexec` invocation to run many experiments.
32For example
33
34    mpiexec -n 64 ./bps -problem bp1,bp2,bp3,bp4 -degree 2,3,5,7                \
35        -ceed /cpu/self/opt/serial,/cpu/self/xsmm/serial,/cpu/self/xsmm/blocked \
36        -local_nodes 600,20000 | tee bps.log
37
38which will sample from the `4*4*3=48` specified combinations, each of which will run a problem-size sweep of 600, 1200, 2400, 4800, 9600, 192000 FEM nodes per MPI rank.
39The resulting log file can be read by the Python plotting scripts in `benchmarks/`.
40
41### CEED bakeoff problems with DMPlex and PCMG - multigrid
42
43This code solves the CEED bakeoff problems on a unstructured grid using DMPlex with p-multigrid implemented in PCMG.
44This example requires a PETSc version later than 3.11.3.
45
46To build, run `make multigrid`
47
48To run, `./multigrid -ceed [ceed-resource] -problem bp[1-6] -degree [degree]`
49
50In addition to the common arguments, the following arguments may be set:
51
52- `-mesh`              - Read mesh from file
53- `-cells`             - Number of cells per dimension
54
55### Command line arguments
56
57The following arguments can be specified for all of the above examples:
58
59- `-ceed`              - CEED resource specifier
60- `-problem`           - CEED benchmark problem to solve
61- `-degree`            - Polynomial degree of tensor product basis
62- `-qextra`            - Number of extra quadrature points
63- `-test`              - Testing mode (do not print unless error is large)
64- `-benchmark`         - Benchmarking mode (prints benchmark statistics)
65
66### libCEED example to compute surface area using DMPlex - area
67
68This example uses the mass matrix to compute the surface area of a cube or a discrete cubed-sphere, defined via DMPlex.
69
70To build, run `make area`
71
72To run, `./area -problem cube -ceed [ceed-resource] -petscspace_degree [degree]`
73
74or
75
76`./area -problem sphere -ceed [ceed-resource] -petscspace_degree [degree]`
77
78#### Command line arguments
79
80The following arguments can be specified for the area example:
81
82- `-ceed`              - CEED resource specifier
83- `-problem`           - Problem to solve, either 'cube' or 'sphere'
84- `-petscspace_degree` - Polynomial degree of tensor product basis
85- `-qextra`            - Number of extra quadrature points
86- `-test`              - Testing mode (do not print unless error is large)
87- `-mesh`              - Read mesh from file
88
89