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