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