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_CGNS
39/* #undef SEACAS_HAVE_FAODEL */
40#define SEACAS_HAVE_PAMGEN
41#else
42#include "SEACASIoss_config.h"
43#endif
44
45#if defined(IOSS_THREADSAFE)
46#include <mutex>
47#endif
48
49#if (__cplusplus >= 201703L)
50#define IOSS_MAYBE_UNUSED [[maybe_unused]]
51#define IOSS_NODISCARD [[nodiscard]]
52#else
53#define IOSS_MAYBE_UNUSED
54#define IOSS_NODISCARD
55#endif
56
57#if defined(SEACAS_HAVE_MPI)
58#include <mpi.h>
59using Ioss_MPI_Comm = MPI_Comm;
60#define IOSS_PAR_UNUSED(x)
61#define ADIOS2_USE_MPI 1
62#else
63using Ioss_MPI_Comm = int;
64#if (__cplusplus >= 201703L)
65// For C++17, we rely on IOSS_MAYBE_UNUSED instead. Can eventually remove all IOSS_PAR_UNUSED...
66#define IOSS_PAR_UNUSED(x)
67#else
68#define IOSS_PAR_UNUSED(x) \
69 do { \
70 (void)(x); \
71 } while (0)
72#endif
73#endif
74
75#ifdef SEACAS_HAVE_KOKKOS
76#include <Kokkos_Core.hpp> // for Kokkos::complex
77#endif
78
79#include <complex>
80#if defined(FOUR_BYTE_REAL)
81//'FOUR_BYTE_REAL' is a sierra macro which may or may not be defined
82// when this header is compiled...
83// If FOUR_BYTE_REAL is defined then we know we need float, otherwise
84// stick with double.
85using Complex = std::complex<float>;
86#ifdef SEACAS_HAVE_KOKKOS
87using Kokkos_Complex = Kokkos::complex<float>;
88#endif
89#else
90using Complex = std::complex<double>;
91#ifdef SEACAS_HAVE_KOKKOS
92using Kokkos_Complex = Kokkos::complex<double>;
93#endif
94#endif
95
96#if defined(IOSS_THREADSAFE)
97#define IOSS_FUNC_ENTER(m) std::lock_guard<std::mutex> guard(m)
98#else
99
100#if defined IOSS_TRACE
101#include "Ioss_Tracer.h"
102#define IOSS_FUNC_ENTER(m) Ioss::Tracer m(__func__)
103#else
104#define IOSS_FUNC_ENTER(m)
105#endif
106#endif
107
108#ifndef IOSS_DEBUG_OUTPUT
109#define IOSS_DEBUG_OUTPUT 0
110#endif
111
112// For use to create a no-op get or put_field_internal function...
113#define IOSS_NOOP_GFI(type) \
114 int64_t get_field_internal(const type *, const Ioss::Field &, void *, size_t) const override \
115 { \
116 return -1; \
117 }
118#define IOSS_NOOP_PFI(type) \
119 int64_t put_field_internal(const type *, const Ioss::Field &, void *, size_t) const override \
120 { \
121 return -1; \
122 }
std::string IOSS_VECTOR_2D()
Definition Ioss_CodeTypes.h:28
std::complex< double > Complex
Definition Ioss_CodeTypes.h:90
int Ioss_MPI_Comm
Definition Ioss_CodeTypes.h:63
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
std::vector< int > IntVector
Definition Ioss_CodeTypes.h:21
std::array< int, 3 > IJK_t
Definition Ioss_CodeTypes.h:24
std::vector< std::string > NameList
Definition Ioss_CodeTypes.h:23