IOSS  2.0
Ioss_CodeTypes.h
Go to the documentation of this file.
1 // Copyright(C) 1999-2017 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 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // * Redistributions in binary form must reproduce the above
13 // copyright notice, this list of conditions and the following
14 // disclaimer in the documentation and/or other materials provided
15 // with the distribution.
16 //
17 // * Neither the name of NTESS nor the names of its
18 // contributors may be used to endorse or promote products derived
19 // from this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 #ifndef IOSS_code_types_h
34 #define IOSS_code_types_h
35 
36 #include <array>
37 #include <cstddef>
38 #include <cstdint>
39 #include <string>
40 #include <vector>
41 
42 namespace Ioss {
43  using IntVector = std::vector<int>;
44  using Int64Vector = std::vector<int64_t>;
45  using NameList = std::vector<std::string>;
46  using IJK_t = std::array<int, 3>;
47 } // namespace Ioss
48 
49 inline const std::string IOSS_SCALAR() { return std::string("scalar"); }
50 inline const std::string IOSS_VECTOR_2D() { return std::string("vector_2d"); }
51 inline const std::string IOSS_VECTOR_3D() { return std::string("vector_3d"); }
52 inline const std::string IOSS_SYM_TENSOR() { return std::string("sym_tensor_33"); }
53 
54 #if defined(SIERRA_PARALLEL_MPI)
55 #define SEACAS_HAVE_MPI
56 #define NO_DATAWAREHOUSE_SUPPORT
57 /* #undef IOSS_THREADSAFE */
58 /* #undef SEACAS_HAVE_KOKKOS */
59 #define SEACAS_HAVE_CGNS
60 #define PARALLEL_AWARE_EXODUS
61 #else
62 #include <SEACASIoss_config.h>
63 #endif
64 
65 #if defined(PARALLEL_AWARE_EXODUS)
66 #ifndef SEACAS_HAVE_MPI
67 #define SEACAS_HAVE_MPI
68 #endif
69 #endif
70 
71 #if defined(IOSS_THREADSAFE)
72 #include <mutex>
73 #endif
74 
75 #if defined(SEACAS_HAVE_MPI)
76 #include <mpi.h>
77 #else
78 #ifndef MPI_COMM_WORLD
79 #define MPI_COMM_WORLD 0
80 using MPI_Comm = int;
81 #endif
82 #endif
83 
84 #ifdef SEACAS_HAVE_KOKKOS
85 #include <Kokkos_Core.hpp> // for Kokkos::complex
86 #endif
87 
88 #include <complex>
89 #if defined(FOUR_BYTE_REAL)
90 //'FOUR_BYTE_REAL' is a sierra macro which may or may not be defined
91 // when this header is compiled...
92 // If FOUR_BYTE_REAL is defined then we know we need float, otherwise
93 // stick with double.
94 using Complex = std::complex<float>;
95 #ifdef SEACAS_HAVE_KOKKOS
96 using Kokkos_Complex = Kokkos::complex<float>;
97 #endif
98 #else
99 using Complex = std::complex<double>;
100 #ifdef SEACAS_HAVE_KOKKOS
101 using Kokkos_Complex = Kokkos::complex<double>;
102 #endif
103 #endif
104 #endif
105 
106 #if defined(IOSS_THREADSAFE)
107 #define IOSS_FUNC_ENTER(m) std::lock_guard<std::mutex> guard(m)
108 #else
109 
110 #if defined IOSS_TRACE
111 #include <Ioss_Tracer.h>
112 #define IOSS_FUNC_ENTER(m) Ioss::Tracer m(__func__)
113 
114 #else
115 #define IOSS_FUNC_ENTER(m)
116 #endif
117 #endif
118 
119 #define IOSS_DEBUG_OUTPUT 0
std::vector< std::string > NameList
Definition: Ioss_CodeTypes.h:45
The main namespace for the Ioss library.
Definition: Iocgns_DatabaseIO.h:50
const std::string IOSS_VECTOR_2D()
Definition: Ioss_CodeTypes.h:50
std::vector< int > IntVector
Definition: Ioss_CodeTypes.h:43
const std::string IOSS_SCALAR()
Definition: Ioss_CodeTypes.h:49
const std::string IOSS_SYM_TENSOR()
Definition: Ioss_CodeTypes.h:52
std::complex< double > Complex
Definition: Ioss_CodeTypes.h:99
std::array< int, 3 > IJK_t
Definition: Ioss_CodeTypes.h:46
const std::string IOSS_VECTOR_3D()
Definition: Ioss_CodeTypes.h:51
std::vector< int64_t > Int64Vector
Definition: Ioss_CodeTypes.h:44
int MPI_Comm
Definition: Ioss_CodeTypes.h:80