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