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