xref: /libCEED/julia/LibCEED.jl/src/Globals.jl (revision edb2538e3dd6743c029967fc4e89c6fcafedb8c2)
1"""
2    CeedScalar
3
4Scalar (floating point) type. Typically equivalent to `Float64`, but libCEED can be configured at
5compile-time to use `Float32`. See also `get_scalar_type`.
6"""
7const CeedScalar = C.CeedScalar
8
9"""
10    CeedInt
11
12Integer type, used for indexing. Equivalent to `Int32`.
13"""
14const CeedInt = C.CeedInt
15
16"""
17    CeedInt8
18
19Integer type, for small integers. Equivalent to `Int8`.
20"""
21const CeedInt8 = C.CeedInt8
22
23"""
24    CeedSize
25
26Integer type, used for array sizes. Equivalent to `Int`.
27"""
28const CeedSize = C.CeedSize
29
30"""
31    QuadMode
32
33One of `GAUSS` or `GAUSS_LOBATTO`.
34"""
35const QuadMode = C.CeedQuadMode
36const GAUSS = C.CEED_GAUSS
37const GAUSS_LOBATTO = C.CEED_GAUSS_LOBATTO
38
39"""
40    MemType
41
42One of `MEM_HOST` or `MEM_DEVICE`.
43"""
44const MemType = C.CeedMemType
45const MEM_HOST = C.CEED_MEM_HOST
46const MEM_DEVICE = C.CEED_MEM_DEVICE
47
48"""
49    CopyMode
50
51One of `COPY_VALUES`, `USE_POINTER` or `OWN_POINTER`.
52
53`OWN_POINTER` is not typically supported for objects created in Julia, because those must be
54destroyed by the garbage collector, and cannot be freed from C.
55"""
56const CopyMode = C.CeedCopyMode
57const COPY_VALUES = C.CEED_COPY_VALUES
58const USE_POINTER = C.CEED_USE_POINTER
59const OWN_POINTER = C.CEED_OWN_POINTER
60
61"""
62    EvalMode
63
64Evaluation mode used in the specification of input and output fields for Q-functions, e.g.
65in [`@interior_qf`](@ref).
66
67One of:
68- `EVAL_NONE`
69- `EVAL_INTERP`
70- `EVAL_GRAD`
71- `EVAL_DIV`
72- `EVAL_CURL`
73- `EVAL_WEIGHT`
74
75See the [libCEED
76documentation](https://libceed.org/en/latest/api/CeedBasis/?highlight=EVAL_MODE#c.CeedEvalMode)
77for further information.
78"""
79const EvalMode = C.CeedEvalMode
80const EVAL_NONE = C.CEED_EVAL_NONE
81const EVAL_INTERP = C.CEED_EVAL_INTERP
82const EVAL_GRAD = C.CEED_EVAL_GRAD
83const EVAL_DIV = C.CEED_EVAL_DIV
84const EVAL_CURL = C.CEED_EVAL_CURL
85const EVAL_WEIGHT = C.CEED_EVAL_WEIGHT
86
87"""
88    NormType
89
90Denotes type of vector norm. One of `NORM_1`, `NORM_2`, or `NORM_MAX`.
91"""
92const NormType = C.CeedNormType
93const NORM_1 = C.CEED_NORM_1
94const NORM_2 = C.CEED_NORM_2
95const NORM_MAX = C.CEED_NORM_MAX
96
97"""
98    TransposeMose
99
100Denotes whether a linear transformation or its transpose should be applied. Either
101`NOTRANSPOSE` or `TRANSPOSE`.
102"""
103const TransposeMode = C.CeedTransposeMode
104const NOTRANSPOSE = C.CEED_NOTRANSPOSE
105const TRANSPOSE = C.CEED_TRANSPOSE
106
107"""
108    Topology
109
110Type of basis shape to create non-tensor H1 element basis. One of `LINE`, `TRIANGLE`,
111`QUAD`, `TET`, `PYRAMID`, `PRISM`, or `HEX`.
112
113The dimension can be extracted with bitshift:
114
115    dim = Int(topology) >> 16
116"""
117const Topology = C.CeedElemTopology
118const LINE = C.CEED_TOPOLOGY_LINE
119const TRIANGLE = C.CEED_TOPOLOGY_TRIANGLE
120const QUAD = C.CEED_TOPOLOGY_QUAD
121const TET = C.CEED_TOPOLOGY_TET
122const PYRAMID = C.CEED_TOPOLOGY_PYRAMID
123const PRISM = C.CEED_TOPOLOGY_PRISM
124const HEX = C.CEED_TOPOLOGY_HEX
125
126function set_globals()
127    @doc """
128        STRIDES_BACKEND
129
130    Indicate that the stride is determined by the backend.
131    """
132    global STRIDES_BACKEND = C.CEED_STRIDES_BACKEND[]
133end
134