IOSS  2.0
Ioss_CodeTypes.h
Go to the documentation of this file.
1 // Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 // NTESS, the U.S. Government retains certain rights in this software.
4 //
5 // See packages/seacas/LICENSE for details
6 
7 #ifndef IOSS_code_types_h
8 #define IOSS_code_types_h
9 
10 #include <array>
11 #include <cstddef>
12 #include <cstdint>
13 #include <string>
14 #include <vector>
15 
16 #if defined(_MSC_VER)
17 #ifdef _WIN64
18 #define ssize_t __int64
19 #else
20 #define ssize_t long
21 #endif
22 #endif
23 
24 namespace Ioss {
25  using IntVector = std::vector<int>;
26  using Int64Vector = std::vector<int64_t>;
27  using NameList = std::vector<std::string>;
28  using IJK_t = std::array<int, 3>;
29 } // namespace Ioss
30 
31 inline const std::string IOSS_SCALAR() { return std::string("scalar"); }
32 inline const std::string IOSS_VECTOR_2D() { return std::string("vector_2d"); }
33 inline const std::string IOSS_VECTOR_3D() { return std::string("vector_3d"); }
34 inline const std::string IOSS_SYM_TENSOR() { return std::string("sym_tensor_33"); }
35 
36 #if defined(BUILT_IN_SIERRA)
37 #define SEACAS_HAVE_MPI
38 /* #undef IOSS_THREADSAFE */
39 /* #undef SEACAS_HAVE_KOKKOS */
40 /* #undef SEACAS_HAVE_DATAWAREHOUSE */
41 #define SEACAS_HAVE_EXODUS
42 #define SEACAS_HAVE_CGNS
43 #define SEACAS_HAVE_PAMGEN
44 #else
45 #include <SEACASIoss_config.h>
46 #endif
47 
48 #if defined(IOSS_THREADSAFE)
49 #include <mutex>
50 #endif
51 
52 #if defined(SEACAS_HAVE_MPI)
53 #include <mpi.h>
54 #define PAR_UNUSED(x)
55 #else
56 #define PAR_UNUSED(x) \
57  do { \
58  (void)(x); \
59  } while (0)
60 
61 #ifndef MPI_COMM_SELF
62 #define MPI_COMM_SELF 0
63 #endif
64 #ifndef MPI_COMM_WORLD
65 #define MPI_COMM_WORLD 0
66 using MPI_Comm = int;
67 #endif
68 #endif
69 
70 #ifdef SEACAS_HAVE_KOKKOS
71 #include <Kokkos_Core.hpp> // for Kokkos::complex
72 #endif
73 
74 #include <complex>
75 #if defined(FOUR_BYTE_REAL)
76 //'FOUR_BYTE_REAL' is a sierra macro which may or may not be defined
77 // when this header is compiled...
78 // If FOUR_BYTE_REAL is defined then we know we need float, otherwise
79 // stick with double.
80 using Complex = std::complex<float>;
81 #ifdef SEACAS_HAVE_KOKKOS
82 using Kokkos_Complex = Kokkos::complex<float>;
83 #endif
84 #else
85 using Complex = std::complex<double>;
86 #ifdef SEACAS_HAVE_KOKKOS
87 using Kokkos_Complex = Kokkos::complex<double>;
88 #endif
89 #endif
90 #endif
91 
92 #if defined(IOSS_THREADSAFE)
93 #define IOSS_FUNC_ENTER(m) std::lock_guard<std::mutex> guard(m)
94 #else
95 
96 #if defined IOSS_TRACE
97 #include <Ioss_Tracer.h>
98 #define IOSS_FUNC_ENTER(m) Ioss::Tracer m(__func__)
99 #else
100 #define IOSS_FUNC_ENTER(m)
101 #endif
102 #endif
103 
104 #ifndef IOSS_DEBUG_OUTPUT
105 #define IOSS_DEBUG_OUTPUT 0
106 #endif
Ioss::NameList
std::vector< std::string > NameList
Definition: Ioss_CodeTypes.h:27
Complex
std::complex< double > Complex
Definition: Ioss_CodeTypes.h:85
Ioss::IntVector
std::vector< int > IntVector
Definition: Ioss_CodeTypes.h:25
IOSS_VECTOR_3D
const std::string IOSS_VECTOR_3D()
Definition: Ioss_CodeTypes.h:33
IOSS_SYM_TENSOR
const std::string IOSS_SYM_TENSOR()
Definition: Ioss_CodeTypes.h:34
Ioss
The main namespace for the Ioss library.
Definition: Ioad_DatabaseIO.C:40
Ioss::Int64Vector
std::vector< int64_t > Int64Vector
Definition: Ioss_CodeTypes.h:26
IOSS_SCALAR
const std::string IOSS_SCALAR()
Definition: Ioss_CodeTypes.h:31
Ioss::IJK_t
std::array< int, 3 > IJK_t
Definition: Ioss_CodeTypes.h:28
Ioss_Tracer.h
MPI_Comm
int MPI_Comm
Definition: Ioss_CodeTypes.h:66
IOSS_VECTOR_2D
const std::string IOSS_VECTOR_2D()
Definition: Ioss_CodeTypes.h:32