xref: /libCEED/examples/README.md (revision 9ef20713b5ca87ae555757898dac5ae4d01441dc)
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
25### Bakeoff Problem 2
26
27Bakeoff problem 2 is the *L<sup>2</sup>* projection problem into the finite element space on a vector system.
28
29The supplied examples solve *_B_ _u_ = f*, where *_B_* is the mass matrix.
30
31### Bakeoff Problem 3
32
33Bakeoff problem 3 is the Poisson problem.
34
35The supplied examples solve *_A_ u = f*, where *_A_* is the Poisson operator.
36
37### Bakeoff Problem 4
38
39Bakeoff problem 4 is the Poisson problem on a vector system.
40
41The supplied examples solve *_A_ _u_ = f*, where *_A_* is the Poisson operator.
42
43## Navier-Stokes Solver
44
45The Navier-Stokes problem solves the compressible Navier-Stokes equations using an explicit time integration.
46
47## Running Examples
48
49To build the examples, set the `MFEM_DIR`, `PETSC_DIR` and `NEK5K_DIR` variables
50and run:
51
52```console
53# libCEED examples on CPU and GPU
54cd ceed
55make
56./ex1 -ceed /cpu/self
57./ex1 -ceed /gpu/occa
58cd ../..
59
60# MFEM+libCEED examples on CPU and GPU
61cd mfem
62make
63./bp1 -ceed /cpu/self -no-vis
64./bp1 -ceed /gpu/occa -no-vis
65cd ../..
66
67# PETSc+libCEED examples on CPU and GPU
68cd petsc
69make
70./bps -problem bp1 -ceed /cpu/self
71./bps -problem bp1 -ceed /gpu/occa
72cd ../..
73
74cd navier-stokes
75make
76./navierstokes -ceed /cpu/self
77./navierstokes -ceed /gpu/occa
78cd ../..
79
80# Nek+libCEED examples on CPU and GPU
81cd nek5000
82./make-nek-examples.sh
83./run-nek-example.sh -ceed /cpu/self -b 3
84./run-nek-example.sh -ceed /gpu/occa -b 3
85cd ../..
86```
87
88The above code assumes a GPU-capable machine with the OCCA backend
89enabled. Depending on the available backends, other Ceed resource specifiers can
90be provided with the `-ceed` option.
91