xref: /libCEED/examples/README.md (revision 525f58efad3fdbd516b1ca0b43ee04d6060753fc)
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
12*525f58efSJeremy 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/).
1617be3a41SJeremy L ThompsonEach 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.
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
2568e843eeSJed Brown* - `mfem`
2668e843eeSJed Brown  - * BP1 (scalar mass operator) with $Q=P+1$
2768e843eeSJed Brown    * BP3 (scalar Laplace operator) with $Q=P+1$
2868e843eeSJed Brown* - `petsc`
2968e843eeSJed Brown  - * BP1 (scalar mass operator) with $Q=P+1$
3068e843eeSJed Brown    * BP2 (vector mass operator) with $Q=P+1$
3168e843eeSJed Brown    * BP3 (scalar Laplace operator) with $Q=P+1$
3268e843eeSJed Brown    * BP4 (vector Laplace operator) with $Q=P+1$
3368e843eeSJed Brown    * BP5 (collocated scalar Laplace operator) with $Q=P$
3468e843eeSJed Brown    * BP6 (collocated vector Laplace operator) with $Q=P$
3568e843eeSJed Brown* - `nek5000`
3668e843eeSJed Brown  - * BP1 (scalar mass operator) with $Q=P+1$
3768e843eeSJed Brown    * BP3 (scalar Laplace operator) with $Q=P+1$
3868e843eeSJed Brown:::
39bcb2dfaeSJed Brown
4017be3a41SJeremy 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).
41bcb2dfaeSJed Brown
42bcb2dfaeSJed BrownBP1 and BP2 are $L^2$ projections, and thus have no boundary condition.
43bcb2dfaeSJed BrownThe rest of the BPs have homogeneous Dirichlet boundary conditions.
44bcb2dfaeSJed Brown
4517be3a41SJeremy 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$.
4617be3a41SJeremy 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.
4717be3a41SJeremy 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.
48bcb2dfaeSJed Brown
49*525f58efSJeremy L Thompson<!-- bps-exclusion -->
50bcb2dfaeSJed Brown
5113964f07SJed 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).
52bcb2dfaeSJed Brown
53bcb2dfaeSJed Brown## PETSc+libCEED Navier-Stokes Solver
54bcb2dfaeSJed Brown
5517be3a41SJeremy L ThompsonThe Navier-Stokes problem solves the compressible Navier-Stokes equations using an explicit or implicit time integration.
5617be3a41SJeremy 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).
57bcb2dfaeSJed Brown
58bcb2dfaeSJed Brown## PETSc+libCEED Solid mechanics elasticity mini-app
59bcb2dfaeSJed Brown
6017be3a41SJeremy L ThompsonThis example solves the steady-state static momentum balance equations using unstructured high-order finite/spectral element spatial discretizations.
6117be3a41SJeremy 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).
62bcb2dfaeSJed Brown
63bcb2dfaeSJed Brown## PETSc+libCEED Surface Area Examples
64bcb2dfaeSJed Brown
6517be3a41SJeremy 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.
6617be3a41SJeremy L ThompsonFor a detailed description, please see the corresponding [area documentation page](https://libceed.org/en/latest/examples/petsc/index.html#area).
67bcb2dfaeSJed Brown
68bcb2dfaeSJed Brown## PETSc+libCEED Bakeoff Problems on the Cubed-Sphere
69bcb2dfaeSJed Brown
7017be3a41SJeremy L ThompsonThese examples, located in the [petsc/](./petsc) folder, reproduce the Bakeoff Problems 1-6 on a discrete cubed-sphere, using PETSc.
7117be3a41SJeremy 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).
72bcb2dfaeSJed Brown
73bcb2dfaeSJed Brown## Running Examples
74bcb2dfaeSJed Brown
7517be3a41SJeremy L ThompsonTo build the examples, set the `MFEM_DIR`, `PETSC_DIR`, and `NEK5K_DIR` variables and, from the `examples/` directory, run
76bcb2dfaeSJed Brown
77bcb2dfaeSJed Brown```{include} ../README.md
78*525f58efSJeremy L Thompson:start-after: <!-- running-examples-inclusion -->
79*525f58efSJeremy L Thompson:end-before: <!-- running-examples-exclusion -->
80bcb2dfaeSJed Brown```
81