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