xref: /libCEED/interface/ceed-types.c (revision 93b6d8191bb649fce95198206c6bff32567615d1)
1 // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 
8 #include <ceed/ceed.h>
9 #include <ceed/backend.h>
10 
11 const char *const CeedErrorTypesShifted[] = {
12   [CEED_ERROR_SUCCESS - CEED_ERROR_UNSUPPORTED] = "success",
13   [CEED_ERROR_MINOR - CEED_ERROR_UNSUPPORTED] = "generic minor error",
14   [CEED_ERROR_DIMENSION - CEED_ERROR_UNSUPPORTED] = "dimension mismatch",
15   [CEED_ERROR_INCOMPLETE - CEED_ERROR_UNSUPPORTED] = "object setup incomplete",
16   [CEED_ERROR_INCOMPATIBLE - CEED_ERROR_UNSUPPORTED] = "incompatible arguments",
17   [CEED_ERROR_ACCESS - CEED_ERROR_UNSUPPORTED] = "access lock in use",
18   [CEED_ERROR_MAJOR - CEED_ERROR_UNSUPPORTED] = "generic major error",
19   [CEED_ERROR_BACKEND - CEED_ERROR_UNSUPPORTED] = "internal backend error",
20   [CEED_ERROR_UNSUPPORTED - CEED_ERROR_UNSUPPORTED] = "operation unsupported by backend",
21 };
22 const char *const *CeedErrorTypes =  &CeedErrorTypesShifted[-
23                                      CEED_ERROR_UNSUPPORTED];
24 
25 const char *const CeedMemTypes[] = {
26   [CEED_MEM_HOST] = "host",
27   [CEED_MEM_DEVICE] = "device",
28 };
29 
30 const char *const CeedCopyModes[] = {
31   [CEED_COPY_VALUES] = "copy values",
32   [CEED_USE_POINTER] = "use pointer",
33   [CEED_OWN_POINTER] = "own pointer",
34 };
35 
36 const char *const CeedTransposeModes[] = {
37   [CEED_TRANSPOSE] = "transpose",
38   [CEED_NOTRANSPOSE] = "no transpose",
39 };
40 
41 const char *const CeedEvalModes[] = {
42   [CEED_EVAL_NONE] = "none",
43   [CEED_EVAL_INTERP] = "interpolation",
44   [CEED_EVAL_GRAD] = "gradient",
45   [CEED_EVAL_DIV] = "divergence",
46   [CEED_EVAL_CURL] = "curl",
47   [CEED_EVAL_WEIGHT] = "quadrature weights",
48 };
49 
50 const char *const CeedQuadModes[] = {
51   [CEED_GAUSS] = "Gauss",
52   [CEED_GAUSS_LOBATTO] = "Gauss Lobatto",
53 };
54 
55 const char *const CeedElemTopologies[] = {
56   [CEED_TOPOLOGY_LINE] = "line",
57   [CEED_TOPOLOGY_TRIANGLE] = "triangle",
58   [CEED_TOPOLOGY_QUAD] = "quadrilateral",
59   [CEED_TOPOLOGY_TET] = "tetrahedron",
60   [CEED_TOPOLOGY_PYRAMID] = "pyramid",
61   [CEED_TOPOLOGY_PRISM] = "prism",
62   [CEED_TOPOLOGY_HEX] = "hexahedron",
63 };
64 
65 const char *const CeedContextFieldTypes[] = {
66   [CEED_CONTEXT_FIELD_DOUBLE] = "double",
67   [CEED_CONTEXT_FIELD_INT32] = "int32",
68 };
69 
70 const char *const CeedFESpaces[] = {
71   [CEED_FE_SPACE_H1] = "H^1 space",
72   [CEED_FE_SPACE_HDIV] = "H(div) space",
73 };
74