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