1bcb2dfaeSJed Brown# libCEED: Examples 2bcb2dfaeSJed Brown 317be3a41SJeremy L ThompsonThis page provides a brief description of the examples for the libCEED library. 4bcb2dfaeSJed Brown 5bcb2dfaeSJed Brown## Basic libCEED Examples 6bcb2dfaeSJed Brown 717be3a41SJeremy L ThompsonTwo examples that rely only upon libCEED without any external libraries are provided in the [ceed/](./ceed) folder. 817be3a41SJeremy L ThompsonFor more details, please see the dedicated [documentation section](https://libceed.org/en/latest/examples/ceed/index.html). 9bcb2dfaeSJed Brown 10bcb2dfaeSJed Brown## Bakeoff Problems 11bcb2dfaeSJed Brown 12525f58efSJeremy L Thompson<!-- bps-inclusion --> 13bcb2dfaeSJed Brown 1417be3a41SJeremy L ThompsonThe Center for Efficient Exascale Discretizations (CEED) uses Bakeoff Problems (BPs) to test and compare the performance of high-order finite element implementations. 1517be3a41SJeremy L ThompsonThe definitions of the problems are given on the ceed [website](https://ceed.exascaleproject.org/bps/). 16*45e62b5fSJeremy L ThompsonEach of the following bakeoff problems that use external discretization libraries (such as deal.II, MFEM, PETSc, and Nek5000) are located in the subdirectories `deal.II/`, `mfem/`, `petsc/`, and `nek5000/`, respectively. 17bcb2dfaeSJed Brown 18bcb2dfaeSJed BrownHere we provide a short summary: 19bcb2dfaeSJed Brown 2068e843eeSJed Brown:::{list-table} 2168e843eeSJed Brown:header-rows: 1 2268e843eeSJed Brown:widths: auto 2368e843eeSJed Brown* - User code 2468e843eeSJed Brown - Supported BPs 25*45e62b5fSJeremy L Thompson* - `deal.II` 26*45e62b5fSJeremy L Thompson - * BP1 (scalar mass operator) with $Q=P+1$ 27*45e62b5fSJeremy L Thompson * BP2 (vector mass operator) with $Q=P+1$ 28*45e62b5fSJeremy L Thompson * BP3 (scalar Laplace operator) with $Q=P+1$ 29*45e62b5fSJeremy L Thompson * BP4 (vector Laplace operator) with $Q=P+1$ 30*45e62b5fSJeremy L Thompson * BP5 (collocated scalar Laplace operator) with $Q=P$ 31*45e62b5fSJeremy L Thompson * BP6 (collocated vector Laplace operator) with $Q=P$ 3268e843eeSJed Brown* - `mfem` 3368e843eeSJed Brown - * BP1 (scalar mass operator) with $Q=P+1$ 3468e843eeSJed Brown * BP3 (scalar Laplace operator) with $Q=P+1$ 3568e843eeSJed Brown* - `petsc` 3668e843eeSJed Brown - * BP1 (scalar mass operator) with $Q=P+1$ 3768e843eeSJed Brown * BP2 (vector mass operator) with $Q=P+1$ 3868e843eeSJed Brown * BP3 (scalar Laplace operator) with $Q=P+1$ 3968e843eeSJed Brown * BP4 (vector Laplace operator) with $Q=P+1$ 4068e843eeSJed Brown * BP5 (collocated scalar Laplace operator) with $Q=P$ 4168e843eeSJed Brown * BP6 (collocated vector Laplace operator) with $Q=P$ 4268e843eeSJed Brown* - `nek5000` 4368e843eeSJed Brown - * BP1 (scalar mass operator) with $Q=P+1$ 4468e843eeSJed Brown * BP3 (scalar Laplace operator) with $Q=P+1$ 4568e843eeSJed Brown::: 46bcb2dfaeSJed Brown 4717be3a41SJeremy L ThompsonThese 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). 48bcb2dfaeSJed Brown 49bcb2dfaeSJed BrownBP1 and BP2 are $L^2$ projections, and thus have no boundary condition. 50bcb2dfaeSJed BrownThe rest of the BPs have homogeneous Dirichlet boundary conditions. 51bcb2dfaeSJed Brown 5217be3a41SJeremy L ThompsonThe 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$. 5317be3a41SJeremy L ThompsonA $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. 5417be3a41SJeremy L ThompsonThis 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. 55bcb2dfaeSJed Brown 56525f58efSJeremy L Thompson<!-- bps-exclusion --> 57bcb2dfaeSJed Brown 5813964f07SJed BrownFor 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). 59bcb2dfaeSJed Brown 60*45e62b5fSJeremy L Thompson## PETSc+libCEED Fluid Dynamics Navier-Stokes Mini-App 61bcb2dfaeSJed Brown 6217be3a41SJeremy L ThompsonThe Navier-Stokes problem solves the compressible Navier-Stokes equations using an explicit or implicit time integration. 6317be3a41SJeremy L ThompsonA 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). 64bcb2dfaeSJed Brown 65*45e62b5fSJeremy L Thompson## PETSc+libCEED Solid Mechanics Elasticity Mini-App 66bcb2dfaeSJed Brown 6717be3a41SJeremy L ThompsonThis example solves the steady-state static momentum balance equations using unstructured high-order finite/spectral element spatial discretizations. 6817be3a41SJeremy L ThompsonA 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). 69bcb2dfaeSJed Brown 70bcb2dfaeSJed Brown## PETSc+libCEED Surface Area Examples 71bcb2dfaeSJed Brown 7217be3a41SJeremy L ThompsonThese 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. 7317be3a41SJeremy L ThompsonFor a detailed description, please see the corresponding [area documentation page](https://libceed.org/en/latest/examples/petsc/index.html#area). 74bcb2dfaeSJed Brown 75bcb2dfaeSJed Brown## PETSc+libCEED Bakeoff Problems on the Cubed-Sphere 76bcb2dfaeSJed Brown 7717be3a41SJeremy L ThompsonThese examples, located in the [petsc/](./petsc) folder, reproduce the Bakeoff Problems 1-6 on a discrete cubed-sphere, using PETSc. 7817be3a41SJeremy L ThompsonFor 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). 79bcb2dfaeSJed Brown 80*45e62b5fSJeremy L Thompson## libCEED Python Examples 81*45e62b5fSJeremy L Thompson 82*45e62b5fSJeremy L ThompsonThese Jupyter notebooks explore the concepts of the libCEED API, including how to install the Python interface and the usage of each API object, with interactive examples. 83*45e62b5fSJeremy L ThompsonThe basic libCEED C examples in `/ceed` folder are also available as Python examples. 84*45e62b5fSJeremy L Thompson 85*45e62b5fSJeremy L Thompson## libCEED Rust Examples 86*45e62b5fSJeremy L Thompson 87*45e62b5fSJeremy L ThompsonThe basic libCEED C examples in `/ceed` folder are also available as Rust examples. 88*45e62b5fSJeremy L Thompson 89bcb2dfaeSJed Brown## Running Examples 90bcb2dfaeSJed Brown 91*45e62b5fSJeremy L ThompsonTo build the examples, set the `DEAL_II_DIR`, `MFEM_DIR`, `PETSC_DIR`, and `NEK5K_DIR` variables and, from the `examples/` directory, run 92bcb2dfaeSJed Brown 93bcb2dfaeSJed Brown```{include} ../README.md 94525f58efSJeremy L Thompson:start-after: <!-- running-examples-inclusion --> 95525f58efSJeremy L Thompson:end-before: <!-- running-examples-exclusion --> 96bcb2dfaeSJed Brown``` 97