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