xref: /libCEED/examples/README.md (revision 68e843ee0303723bf2ec95aa2ac2af8f169174e7)
1bcb2dfaeSJed Brown# libCEED: Examples
2bcb2dfaeSJed Brown
3bcb2dfaeSJed BrownThis page provides a brief description of the examples for the libCEED
4bcb2dfaeSJed Brownlibrary.
5bcb2dfaeSJed Brown
6bcb2dfaeSJed Brown## Basic libCEED Examples
7bcb2dfaeSJed Brown
8bcb2dfaeSJed BrownTwo examples that rely only upon libCEED without any external libraries are provided in the [ceed/](./ceed) folder. For more details, please see the dedicated [documentation section](https://libceed.readthedocs.io/en/latest/examples/ceed/index.html).
9bcb2dfaeSJed Brown
10bcb2dfaeSJed Brown## Bakeoff Problems
11bcb2dfaeSJed Brown
12bcb2dfaeSJed Brown% bps-inclusion-marker
13bcb2dfaeSJed Brown
14bcb2dfaeSJed BrownThe Center for Efficient Exascale Discretizations (CEED) uses Bakeoff Problems (BPs)
15bcb2dfaeSJed Brownto test and compare the performance of high-order finite element implementations. The
16bcb2dfaeSJed Browndefinitions of the problems are given on the ceed
17bcb2dfaeSJed Brown[website](https://ceed.exascaleproject.org/bps/). Each of the following bakeoff
18bcb2dfaeSJed Brownproblems that use external discretization libraries (such as MFEM, PETSc, and Nek5000)
19bcb2dfaeSJed Brownare located in the subdirectories `mfem/`, `petsc/`, and
20bcb2dfaeSJed Brown`nek5000/`, respectively.
21bcb2dfaeSJed Brown
22bcb2dfaeSJed BrownHere we provide a short summary:
23bcb2dfaeSJed Brown
24*68e843eeSJed Brown:::{list-table}
25*68e843eeSJed Brown:header-rows: 1
26*68e843eeSJed Brown:widths: auto
27*68e843eeSJed Brown* - User code
28*68e843eeSJed Brown  - Supported BPs
29*68e843eeSJed Brown* - `mfem`
30*68e843eeSJed Brown  - * BP1 (scalar mass operator) with $Q=P+1$
31*68e843eeSJed Brown    * BP3 (scalar Laplace operator) with $Q=P+1$
32*68e843eeSJed Brown* - `petsc`
33*68e843eeSJed Brown  - * BP1 (scalar mass operator) with $Q=P+1$
34*68e843eeSJed Brown    * BP2 (vector mass operator) with $Q=P+1$
35*68e843eeSJed Brown    * BP3 (scalar Laplace operator) with $Q=P+1$
36*68e843eeSJed Brown    * BP4 (vector Laplace operator) with $Q=P+1$
37*68e843eeSJed Brown    * BP5 (collocated scalar Laplace operator) with $Q=P$
38*68e843eeSJed Brown    * BP6 (collocated vector Laplace operator) with $Q=P$
39*68e843eeSJed Brown* - `nek5000`
40*68e843eeSJed Brown  - * BP1 (scalar mass operator) with $Q=P+1$
41*68e843eeSJed Brown    * BP3 (scalar Laplace operator) with $Q=P+1$
42*68e843eeSJed Brown:::
43bcb2dfaeSJed Brown
44bcb2dfaeSJed BrownThese are all **T-vector**-to-**T-vector** and include parallel scatter, element
45bcb2dfaeSJed Brownscatter, element evaluation kernel, element gather, and parallel gather (with the
46bcb2dfaeSJed Brownparallel gathers/scatters done externally to libCEED).
47bcb2dfaeSJed Brown
48bcb2dfaeSJed BrownBP1 and BP2 are $L^2$ projections, and thus have no boundary condition.
49bcb2dfaeSJed BrownThe rest of the BPs have homogeneous Dirichlet boundary conditions.
50bcb2dfaeSJed Brown
51bcb2dfaeSJed BrownThe BPs are parametrized by the number $P$ of Gauss-Legendre-Lobatto nodal points
52bcb2dfaeSJed Brown(with $P=p+1$, and $p$ the degree of the basis polynomial) for the Lagrange
53bcb2dfaeSJed Brownpolynomials, as well as the number of quadrature points, $Q$.
54bcb2dfaeSJed BrownA $Q$-point Gauss-Legendre quadrature is used for all BPs except BP5 and BP6,
55bcb2dfaeSJed Brownwhich choose $Q = P$ and Gauss-Legendre-Lobatto quadrature to collocate with the
56bcb2dfaeSJed Browninterpolation nodes. This latter choice is popular in applications that use spectral
57bcb2dfaeSJed Brownelement methods because it produces a diagonal mass matrix (enabling easy explicit
58bcb2dfaeSJed Browntime integration) and significantly reduces the number of floating point operations
59bcb2dfaeSJed Brownto apply the operator.
60bcb2dfaeSJed Brown
61bcb2dfaeSJed Brown% bps-exclusion-marker
62bcb2dfaeSJed Brown
63bcb2dfaeSJed BrownFor a more detailed description of the operators employed in the BPs, please see the dedicated [BPs documentation section](https://libceed.readthedocs.io/en/latest/examples/bps.html).
64bcb2dfaeSJed Brown
65bcb2dfaeSJed Brown## PETSc+libCEED Navier-Stokes Solver
66bcb2dfaeSJed Brown
67bcb2dfaeSJed BrownThe Navier-Stokes problem solves the compressible Navier-Stokes
68bcb2dfaeSJed Brownequations using an explicit or implicit time integration. A more detailed
69bcb2dfaeSJed Browndescription of the problem formulation can be found in the
70bcb2dfaeSJed Brown[fluids/](./fluids) folder and the corresponding [fluids documentation page](https://libceed.readthedocs.io/en/latest/examples/fluids/index.html).
71bcb2dfaeSJed Brown
72bcb2dfaeSJed Brown## PETSc+libCEED Solid mechanics elasticity mini-app
73bcb2dfaeSJed Brown
74bcb2dfaeSJed BrownThis example solves the steady-state static momentum balance equations using unstructured high-order finite/spectral element spatial discretizations. A more detailed
75bcb2dfaeSJed Browndescription of the problem formulation can be found in the
76bcb2dfaeSJed Brown[solids/](./solids) folder and the corresponding [solids documentation page](https://libceed.readthedocs.io/en/latest/examples/solids/index.html).
77bcb2dfaeSJed Brown
78bcb2dfaeSJed Brown## PETSc+libCEED Surface Area Examples
79bcb2dfaeSJed Brown
80bcb2dfaeSJed BrownThese examples, located in the [petsc/](./petsc) folder, use the mass operator to compute the surface area of a
81bcb2dfaeSJed Browncube or a discrete cubed-sphere, using PETSc. For a detailed description, please see the corresponding [area documentation page](https://libceed.readthedocs.io/en/latest/examples/petsc/index.html#area).
82bcb2dfaeSJed Brown
83bcb2dfaeSJed Brown## PETSc+libCEED Bakeoff Problems on the Cubed-Sphere
84bcb2dfaeSJed Brown
85bcb2dfaeSJed BrownThese examples, located in the [petsc/](./petsc) folder, reproduce the Bakeoff Problems 1-6 on a discrete
86bcb2dfaeSJed Browncubed-sphere, using PETSc. For a detailed description, please see the corresponding [problems on the cubed-sphere documentation page](https://libceed.readthedocs.io/en/latest/examples/petsc/index.html#bakeoff-problems-on-the-cubed-sphere).
87bcb2dfaeSJed Brown
88bcb2dfaeSJed Brown## Running Examples
89bcb2dfaeSJed Brown
90bcb2dfaeSJed BrownTo build the examples, set the `MFEM_DIR`, `PETSC_DIR`, and
91bcb2dfaeSJed Brown`NEK5K_DIR` variables and, from the `examples/` directory, run
92bcb2dfaeSJed Brown
93bcb2dfaeSJed Brown```{include} ../README.md
94bcb2dfaeSJed Brown:start-after: running-examples-inclusion-marker
95bcb2dfaeSJed Brown:end-before: benchmarks-marker
96bcb2dfaeSJed Brown```
97