IOSS 2.0
Loading...
Searching...
No Matches
Ioss_CodeTypes.h
Go to the documentation of this file.
1// Copyright(C) 1999-2024 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#pragma once
8
9#include <array>
10#include <cstddef>
11#include <cstdint>
12#include <string>
13#include <vector>
14
15#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \
16 defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__)
17#define __IOSS_WINDOWS__ 1
18#endif
19
20namespace Ioss {
21 using IntVector = std::vector<int>;
22 using Int64Vector = std::vector<int64_t>;
23 using NameList = std::vector<std::string>;
24 using IJK_t = std::array<int, 3>;
25} // namespace Ioss
26
27inline std::string IOSS_SCALAR() { return {"scalar"}; }
28inline std::string IOSS_VECTOR_2D() { return {"vector_2d"}; }
29inline std::string IOSS_VECTOR_3D() { return {"vector_3d"}; }
30inline std::string IOSS_SYM_TENSOR() { return {"sym_tensor_33"}; }
31
32#if defined(BUILT_IN_SIERRA)
33#define MAP_USE_SORTED_VECTOR
34#define SEACAS_HAVE_MPI
35/* #undef IOSS_THREADSAFE */
36/* #undef SEACAS_HAVE_KOKKOS */
37#define SEACAS_HAVE_EXODUS
38#define SEACAS_HAVE_EXONULL
39#define SEACAS_HAVE_CGNS
40/* #undef SEACAS_HAVE_FAODEL */
41#define SEACAS_HAVE_PAMGEN
42#else
43#include "SEACASIoss_config.h"
44#endif
45
46#if defined(IOSS_THREADSAFE)
47#include <mutex>
48#endif
49
50#if (__cplusplus >= 201703L)
51#define IOSS_MAYBE_UNUSED [[maybe_unused]]
52#define IOSS_NODISCARD [[nodiscard]]
53#else
54#define IOSS_MAYBE_UNUSED
55#define IOSS_NODISCARD
56#endif
57
58#if defined(SEACAS_HAVE_MPI)
59#include <mpi.h>
60using Ioss_MPI_Comm = MPI_Comm;
61#define IOSS_PAR_UNUSED(x)
62#define ADIOS2_USE_MPI 1
63#else
64using Ioss_MPI_Comm = int;
65#if (__cplusplus >= 201703L)
66// For C++17, we rely on IOSS_MAYBE_UNUSED instead. Can eventually remove all IOSS_PAR_UNUSED...
67#define IOSS_PAR_UNUSED(x)
68#else
69#define IOSS_PAR_UNUSED(x) \
70 do { \
71 (void)(x); \
72 } while (0)
73#endif
74#endif
75
76#ifdef SEACAS_HAVE_KOKKOS
77#include <Kokkos_Core.hpp> // for Kokkos::complex
78#endif
79
80#include <complex>
81#if defined(FOUR_BYTE_REAL)
82//'FOUR_BYTE_REAL' is a sierra macro which may or may not be defined
83// when this header is compiled...
84// If FOUR_BYTE_REAL is defined then we know we need float, otherwise
85// stick with double.
86using Complex = std::complex<float>;
87#ifdef SEACAS_HAVE_KOKKOS
88using Kokkos_Complex = Kokkos::complex<float>;
89#endif
90#else
91using Complex = std::complex<double>;
92#ifdef SEACAS_HAVE_KOKKOS
93using Kokkos_Complex = Kokkos::complex<double>;
94#endif
95#endif
96
97#if defined(IOSS_THREADSAFE)
98#define IOSS_FUNC_ENTER(m) std::lock_guard<std::mutex> guard(m)
99#else
100
101#if defined IOSS_TRACE
102#include "Ioss_Tracer.h"
103#define IOSS_FUNC_ENTER(m) Ioss::Tracer m(__func__)
104#else
105#define IOSS_FUNC_ENTER(m)
106#endif
107#endif
108
109#ifndef IOSS_DEBUG_OUTPUT
110#define IOSS_DEBUG_OUTPUT 0
111#endif
112
113// For use to create a no-op get or put_field_internal function...
114#define IOSS_NOOP_GFI(type) \
115 int64_t get_field_internal(const type *, const Ioss::Field &, void *, size_t) const override \
116 { \
117 return -1; \
118 }
119#define IOSS_NOOP_PFI(type) \
120 int64_t put_field_internal(const type *, const Ioss::Field &, void *, size_t) const override \
121 { \
122 return -1; \
123 }
std::string IOSS_VECTOR_2D()
Definition Ioss_CodeTypes.h:28
std::complex< double > Complex
Definition Ioss_CodeTypes.h:91
int Ioss_MPI_Comm
Definition Ioss_CodeTypes.h:64
std::string IOSS_SCALAR()
Definition Ioss_CodeTypes.h:27
std::string IOSS_SYM_TENSOR()
Definition Ioss_CodeTypes.h:30
std::string IOSS_VECTOR_3D()
Definition Ioss_CodeTypes.h:29
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
std::vector< int64_t > Int64Vector
Definition Ioss_CodeTypes.h:22
Ioss::NameList NameList
Definition Ioss_ChangeSetFactory.h:25
std::vector< int > IntVector
Definition Ioss_CodeTypes.h:21
std::array< int, 3 > IJK_t
Definition Ioss_CodeTypes.h:24