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 "vtk_ioss_mangle.h"
11 
12 #include <array>
13 #include <cstddef>
14 #include <cstdint>
15 #include <string>
16 #include <vector>
17 
18 #if defined(_MSC_VER)
19 #ifdef _WIN64
20 #define ssize_t __int64
21 #else
22 #define ssize_t long
23 #endif
24 #endif
25 
26 namespace Ioss {
27   using IntVector   = std::vector<int>;
28   using Int64Vector = std::vector<int64_t>;
29   using NameList    = std::vector<std::string>;
30   using IJK_t       = std::array<int, 3>;
31 } // namespace Ioss
32 
IOSS_SCALAR()33 inline const std::string IOSS_SCALAR() { return std::string("scalar"); }
IOSS_VECTOR_2D()34 inline const std::string IOSS_VECTOR_2D() { return std::string("vector_2d"); }
IOSS_VECTOR_3D()35 inline const std::string IOSS_VECTOR_3D() { return std::string("vector_3d"); }
IOSS_SYM_TENSOR()36 inline const std::string IOSS_SYM_TENSOR() { return std::string("sym_tensor_33"); }
37 
38 #if defined(BUILT_IN_SIERRA)
39 #define SEACAS_HAVE_MPI
40 /* #undef IOSS_THREADSAFE */
41 /* #undef SEACAS_HAVE_KOKKOS */
42 #define SEACAS_HAVE_EXODUS
43 #define SEACAS_HAVE_CGNS
44 /* #undef SEACAS_HAVE_FAODEL */
45 #define SEACAS_HAVE_PAMGEN
46 #else
47 #include <SEACASIoss_config.h>
48 #endif
49 
50 #if defined(IOSS_THREADSAFE)
51 #include <mutex>
52 #endif
53 
54 #if defined(SEACAS_HAVE_MPI)
55 #include <vtk_mpi.h>
56 #define PAR_UNUSED(x)
57 #else
58 #define PAR_UNUSED(x)                                                                              \
59   do {                                                                                             \
60     (void)(x);                                                                                     \
61   } while (0)
62 
63 #ifndef MPI_COMM_SELF
64 #define MPI_COMM_SELF 0
65 #endif
66 #ifndef MPI_COMM_WORLD
67 #define MPI_COMM_WORLD 0
68 using MPI_Comm       = int;
69 #endif
70 #endif
71 
72 #ifdef SEACAS_HAVE_KOKKOS
73 #include <Kokkos_Core.hpp> // for Kokkos::complex
74 #endif
75 
76 #include <complex>
77 #if defined(FOUR_BYTE_REAL)
78 //'FOUR_BYTE_REAL' is a sierra macro which may or may not be defined
79 // when this header is compiled...
80 // If FOUR_BYTE_REAL is defined then we know we need float, otherwise
81 // stick with double.
82 using Complex = std::complex<float>;
83 #ifdef SEACAS_HAVE_KOKKOS
84 using Kokkos_Complex = Kokkos::complex<float>;
85 #endif
86 #else
87 using Complex        = std::complex<double>;
88 #ifdef SEACAS_HAVE_KOKKOS
89 using Kokkos_Complex = Kokkos::complex<double>;
90 #endif
91 #endif
92 #endif
93 
94 #if defined(IOSS_THREADSAFE)
95 #define IOSS_FUNC_ENTER(m) std::lock_guard<std::mutex> guard(m)
96 #else
97 
98 #if defined IOSS_TRACE
99 #include <Ioss_Tracer.h>
100 #define IOSS_FUNC_ENTER(m) Ioss::Tracer m(__func__)
101 #else
102 #define IOSS_FUNC_ENTER(m)
103 #endif
104 #endif
105 
106 #ifndef IOSS_DEBUG_OUTPUT
107 #define IOSS_DEBUG_OUTPUT 0
108 #endif
109