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