1# libCEED: Examples 2 3This page provides a brief description of the examples for the libCEED library. 4 5## Example 1 6 7This example uses the mass matrix to compute the length, area, or volume of a 8region, depending upon runtime parameters. 9 10## Bakeoff Problems 11 12This section provides a brief description of the bakeoff problems, used as examples 13for the libCEED library. These bakeoff problems are high-order benchmarks designed 14to test and compare the performance of high-order finite element codes. 15 16For further documentation, readers may wish to consult the 17[CEED documentation](http://ceed.exascaleproject.org/bps/) of the bakeoff problems. 18 19### Bakeoff Problem 1 20 21Bakeoff problem 1 is the *L<sup>2</sup>* projection problem into the finite element space. 22 23The supplied examples solve *_B_ u = f*, where *_B_* is the mass matrix. 24 25The nodal points, *p*, are Gauss-Legendre-Lobatto, and the quadrature points, *q* are Gauss-Legendre. There is one more quadrature point in each dimension than nodal point, *q = p + 1*. 26 27### Bakeoff Problem 2 28 29Bakeoff problem 2 is the *L<sup>2</sup>* projection problem into the finite element space on a vector system. 30 31The supplied examples solve *_B_ _u_ = f*, where *_B_* is the mass matrix. 32 33The nodal points, *p*, are Gauss-Legendre-Lobatto, and the quadrature points, *q* are Gauss-Legendre. There is one more quadrature point in each dimension than nodal point, *q = p + 1*. 34 35### Bakeoff Problem 3 36 37Bakeoff problem 3 is the Poisson problem. 38 39The supplied examples solve *_A_ u = f*, where *_A_* is the Poisson operator. 40 41The nodal points, *p*, are Gauss-Legendre-Lobatto, and the quadrature points, *q* are Gauss-Legendre. There is one more quadrature point in each dimension than nodal point, *q = p + 1*. 42 43### Bakeoff Problem 4 44 45Bakeoff problem 4 is the Poisson problem on a vector system. 46 47The supplied examples solve *_A_ _u_ = f*, where *_A_* is the Laplace operator for the Poisson equation. 48 49The nodal points, *p*, are Gauss-Legendre-Lobatto, and the quadrature points, *q* are Gauss-Legendre. There is one more quadrature point in each dimension than nodal point, *q = p + 1*. 50 51### Bakeoff Problem 5 52 53Bakeoff problem 5 is the Poisson problem. 54 55The supplied examples solve *_A_ u = f*, where *_A_* is the Poisson operator. 56 57The nodal points, *p*, are Gauss-Legendre-Lobatto, and the quadrature points, *q* are Gauss-Legendre-Lobatto. The nodal points and quadrature points are collocated. 58 59### Bakeoff Problem 6 60 61Bakeoff problem 6 is the Poisson problem on a vector system. 62 63The supplied examples solve *_A_ _u_ = f*, where *_A_* is the Laplace operator for the Poisson equation. 64 65The nodal points, *p*, are Gauss-Legendre-Lobatto, and the quadrature points, *q* are Gauss-Legendre-Lobatto. The nodal points and quadrature points are collocated. 66 67## Navier-Stokes Solver 68 69The Navier-Stokes problem solves the compressible Navier-Stokes equations using an explicit time integration. A more detailed description of the problem formulation 70can be found in the `navier-stokes` folder. 71 72## Running Examples 73 74To build the examples, set the `MFEM_DIR`, `PETSC_DIR` and `NEK5K_DIR` variables 75and run: 76 77```console 78# libCEED examples on CPU and GPU 79cd ceed 80make 81./ex1 -ceed /cpu/self 82./ex1 -ceed /gpu/occa 83cd .. 84 85# MFEM+libCEED examples on CPU and GPU 86cd mfem 87make 88./bp1 -ceed /cpu/self -no-vis 89./bp3 -ceed /gpu/occa -no-vis 90cd .. 91 92# Nek5000+libCEED examples on CPU and GPU 93cd nek 94make 95./nek-examples.sh -e bp1 -ceed /cpu/self -b 3 96./nek-examples.sh -e bp3 -ceed /gpu/occa -b 3 97cd .. 98 99# PETSc+libCEED examples on CPU and GPU 100cd petsc 101make 102./bps -problem bp1 -ceed /cpu/self 103./bps -problem bp2 -ceed /gpu/occa 104./bps -problem bp3 -ceed /cpu/self 105./bps -problem bp4 -ceed /gpu/occa 106./bps -problem bp5 -ceed /cpu/self 107./bps -problem bp6 -ceed /gpu/occa 108cd .. 109 110cd navier-stokes 111make 112./navierstokes -ceed /cpu/self 113./navierstokes -ceed /gpu/occa 114cd .. 115``` 116 117The above code assumes a GPU-capable machine with the OCCA backend 118enabled. Depending on the available backends, other CEED resource specifiers can 119be provided with the `-ceed` option. 120