xref: /libCEED/interface/ceed-types.c (revision d4cc18453651bd0f94c1a2e078b2646a92dafdcc)
1*9ba83ac0SJeremy L Thompson // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
375affc3bSjeremylt //
43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
575affc3bSjeremylt //
63d8e8822SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
775affc3bSjeremylt 
849aac155SJeremy L Thompson #include <ceed.h>
96f117663SJeremy L Thompson #include <ceed/backend.h>
1075affc3bSjeremylt 
11e15f9bd0SJeremy L Thompson const char *const CeedErrorTypesShifted[] = {
12e15f9bd0SJeremy L Thompson     [CEED_ERROR_SUCCESS - CEED_ERROR_UNSUPPORTED]      = "success",
13e15f9bd0SJeremy L Thompson     [CEED_ERROR_MINOR - CEED_ERROR_UNSUPPORTED]        = "generic minor error",
14e15f9bd0SJeremy L Thompson     [CEED_ERROR_DIMENSION - CEED_ERROR_UNSUPPORTED]    = "dimension mismatch",
15e15f9bd0SJeremy L Thompson     [CEED_ERROR_INCOMPLETE - CEED_ERROR_UNSUPPORTED]   = "object setup incomplete",
16e1e9e29dSJed Brown     [CEED_ERROR_INCOMPATIBLE - CEED_ERROR_UNSUPPORTED] = "incompatible arguments",
17e15f9bd0SJeremy L Thompson     [CEED_ERROR_ACCESS - CEED_ERROR_UNSUPPORTED]       = "access lock in use",
18e15f9bd0SJeremy L Thompson     [CEED_ERROR_MAJOR - CEED_ERROR_UNSUPPORTED]        = "generic major error",
19e15f9bd0SJeremy L Thompson     [CEED_ERROR_BACKEND - CEED_ERROR_UNSUPPORTED]      = "internal backend error",
20e15f9bd0SJeremy L Thompson     [CEED_ERROR_UNSUPPORTED - CEED_ERROR_UNSUPPORTED]  = "operation unsupported by backend",
21e15f9bd0SJeremy L Thompson };
222b730f8bSJeremy L Thompson const char *const *CeedErrorTypes = &CeedErrorTypesShifted[-CEED_ERROR_UNSUPPORTED];
23e15f9bd0SJeremy L Thompson 
2475affc3bSjeremylt const char *const CeedMemTypes[] = {
2575affc3bSjeremylt     [CEED_MEM_HOST]   = "host",
2675affc3bSjeremylt     [CEED_MEM_DEVICE] = "device",
2775affc3bSjeremylt };
2875affc3bSjeremylt 
2975affc3bSjeremylt const char *const CeedCopyModes[] = {
3075affc3bSjeremylt     [CEED_COPY_VALUES] = "copy values",
3175affc3bSjeremylt     [CEED_USE_POINTER] = "use pointer",
3275affc3bSjeremylt     [CEED_OWN_POINTER] = "own pointer",
3375affc3bSjeremylt };
3475affc3bSjeremylt 
3575affc3bSjeremylt const char *const CeedTransposeModes[] = {
3675affc3bSjeremylt     [CEED_TRANSPOSE]   = "transpose",
3775affc3bSjeremylt     [CEED_NOTRANSPOSE] = "no transpose",
3875affc3bSjeremylt };
3975affc3bSjeremylt 
4075affc3bSjeremylt const char *const CeedEvalModes[] = {
412b730f8bSJeremy L Thompson     [CEED_EVAL_NONE] = "none", [CEED_EVAL_INTERP] = "interpolation",      [CEED_EVAL_GRAD] = "gradient", [CEED_EVAL_DIV] = "divergence",
422b730f8bSJeremy L Thompson     [CEED_EVAL_CURL] = "curl", [CEED_EVAL_WEIGHT] = "quadrature weights",
4375affc3bSjeremylt };
4475affc3bSjeremylt 
4575affc3bSjeremylt const char *const CeedQuadModes[] = {
4675affc3bSjeremylt     [CEED_GAUSS]         = "Gauss",
4775affc3bSjeremylt     [CEED_GAUSS_LOBATTO] = "Gauss Lobatto",
4875affc3bSjeremylt };
4975affc3bSjeremylt 
5075affc3bSjeremylt const char *const CeedElemTopologies[] = {
512b730f8bSJeremy L Thompson     [CEED_TOPOLOGY_LINE] = "line",       [CEED_TOPOLOGY_TRIANGLE] = "triangle", [CEED_TOPOLOGY_QUAD] = "quadrilateral",
522b730f8bSJeremy L Thompson     [CEED_TOPOLOGY_TET] = "tetrahedron", [CEED_TOPOLOGY_PYRAMID] = "pyramid",   [CEED_TOPOLOGY_PRISM] = "prism",
5350c301a5SRezgar Shakeri     [CEED_TOPOLOGY_HEX] = "hexahedron",
5475affc3bSjeremylt };
55cdf32b93SJeremy L Thompson 
56cdf32b93SJeremy L Thompson const char *const CeedContextFieldTypes[] = {
57cdf32b93SJeremy L Thompson     [CEED_CONTEXT_FIELD_DOUBLE] = "double",
58cdf32b93SJeremy L Thompson     [CEED_CONTEXT_FIELD_INT32]  = "int32",
595b6ec284SJeremy L Thompson     [CEED_CONTEXT_FIELD_BOOL]   = "bool",
60cdf32b93SJeremy L Thompson };
6150c301a5SRezgar Shakeri 
6250c301a5SRezgar Shakeri const char *const CeedFESpaces[] = {
6350c301a5SRezgar Shakeri     [CEED_FE_SPACE_H1]    = "H^1 space",
6450c301a5SRezgar Shakeri     [CEED_FE_SPACE_HDIV]  = "H(div) space",
65c4e3f59bSSebastian Grimberg     [CEED_FE_SPACE_HCURL] = "H(curl) space",
6650c301a5SRezgar Shakeri };
67