xref: /libCEED/examples/petsc/bps.h (revision 891038deaa55d3f0c57599b0bbe43569c9f61de7)
1 // Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3 // reserved. See files LICENSE and NOTICE for details.
4 //
5 // This file is part of CEED, a collection of benchmarks, miniapps, software
6 // libraries and APIs for efficient high-order finite element and spectral
7 // element discretizations for exascale applications. For more information and
8 // source code availability see http://github.com/ceed.
9 //
10 // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
11 // a collaborative effort of two U.S. Department of Energy organizations (Office
12 // of Science and the National Nuclear Security Administration) responsible for
13 // the planning and preparation of a capable exascale ecosystem, including
14 // software, applications, hardware, advanced system engineering and early
15 // testbed platforms, in support of the nation's exascale computing imperative.
16 
17 #ifndef bps_h
18 #define bps_h
19 
20 #include "include/bpsproblemdata.h"
21 #include "include/petscmacros.h"
22 #include "include/petscutils.h"
23 #include "include/matops.h"
24 #include "include/structs.h"
25 #include "include/libceedsetup.h"
26 
27 #include <ceed.h>
28 #include <petsc.h>
29 #include <petscdmplex.h>
30 #include <petscfe.h>
31 #include <petscsys.h>
32 #include <stdbool.h>
33 #include <string.h>
34 
35 #if PETSC_VERSION_LT(3,12,0)
36 #ifdef PETSC_HAVE_CUDA
37 #include <petsccuda.h>
38 // Note: With PETSc prior to version 3.12.0, providing the source path to
39 //       include 'cublas_v2.h' will be needed to use 'petsccuda.h'.
40 #endif
41 #endif
42 
43 // -----------------------------------------------------------------------------
44 // Command Line Options
45 // -----------------------------------------------------------------------------
46 
47 // MemType Options
48 static const char *const mem_types[] = {"host","device", "memType",
49                                         "CEED_MEM_", 0
50                                        };
51 
52 // Coarsening options
53 typedef enum {
54   COARSEN_UNIFORM = 0, COARSEN_LOGARITHMIC = 1
55 } CoarsenType;
56 static const char *const coarsen_types [] = {"uniform", "logarithmic",
57                                              "CoarsenType", "COARSEN", 0
58                                             };
59 
60 static const char *const bp_types[] = {"bp1", "bp2", "bp3", "bp4", "bp5", "bp6",
61                                        "BPType", "CEED_BP", 0
62                                       };
63 
64 #endif // bps_h
65