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