18#include <Cabana_LinkedCellList.hpp>
19#include <Cabana_VerletList.hpp>
20#include <Kokkos_Array.hpp>
21#include <Kokkos_Core.hpp>
22#include <Kokkos_ScatterView.hpp>
31KOKKOS_INLINE_FUNCTION
constexpr unsigned int uint_c(
const T& val)
33 return static_cast<unsigned int>(val);
37KOKKOS_INLINE_FUNCTION
constexpr uint8_t
uint8_c(
const T& val)
39 return static_cast<uint8_t
>(val);
43KOKKOS_INLINE_FUNCTION
constexpr uint16_t
uint16_c(
const T& val)
45 return static_cast<uint16_t
>(val);
49KOKKOS_INLINE_FUNCTION
constexpr uint32_t
uint32_c(
const T& val)
51 return static_cast<uint32_t
>(val);
55KOKKOS_INLINE_FUNCTION
constexpr uint64_t
uint64_c(
const T& val)
57 return static_cast<uint64_t
>(val);
62KOKKOS_INLINE_FUNCTION
constexpr int int_c(
const T& val)
64 return static_cast<int>(val);
68KOKKOS_INLINE_FUNCTION
constexpr int8_t
int8_c(
const T& val)
70 return static_cast<int8_t
>(val);
74KOKKOS_INLINE_FUNCTION
constexpr int16_t
int16_c(
const T& val)
76 return static_cast<int16_t
>(val);
80KOKKOS_INLINE_FUNCTION
constexpr int32_t
int32_c(
const T& val)
82 return static_cast<int32_t
>(val);
86KOKKOS_INLINE_FUNCTION
constexpr int64_t
int64_c(
const T& val)
88 return static_cast<int64_t
>(val);
93KOKKOS_INLINE_FUNCTION
constexpr idx_t idx_c(
const T& val)
95 return static_cast<idx_t>(val);
103KOKKOS_INLINE_FUNCTION
constexpr real_t operator""_r(
const long double val)
105 return static_cast<real_t>(val);
108KOKKOS_INLINE_FUNCTION
constexpr real_t operator""_r(
const unsigned long long val)
110 return static_cast<real_t>(val);
116 return static_cast<real_t>(t);
120KOKKOS_INLINE_FUNCTION
constexpr double double_c(
const T& val)
122 return static_cast<double>(val);
126KOKKOS_INLINE_FUNCTION
constexpr float float_c(
const T& val)
128 return static_cast<float>(val);
131template <
typename FLOAT>
135 const FLOAT& epsilon = std::numeric_limits<FLOAT>::epsilon())
137 return std::abs(lhs - rhs) < epsilon;
148KOKKOS_INLINE_FUNCTION
constexpr std::underlying_type_t<Enum>
to_underlying(Enum e)
noexcept
150 return static_cast<std::underlying_type_t<Enum>
>(e);
166#ifdef MRMD_USE_SHARED_SPACE
167static_assert(Kokkos::has_shared_space,
168 "MRMD_USE_SHARED_SPACE is defined but Kokkos does not have a shared space");
169using HostType = Kokkos::Device<Kokkos::DefaultHostExecutionSpace, Kokkos::SharedSpace>;
171using DeviceType = Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::SharedSpace>;
173using HostType = Kokkos::Device<Kokkos::DefaultHostExecutionSpace,
174 Kokkos::DefaultHostExecutionSpace::memory_space>;
177 Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>;
180using VerletList [[deprecated]] = Cabana::VerletList<Kokkos::DefaultExecutionSpace::memory_space,
181 Cabana::HalfNeighborTag,
182 Cabana::VerletLayout2D,
184using HalfVerletList = Cabana::VerletList<Kokkos::DefaultExecutionSpace::memory_space,
185 Cabana::HalfNeighborTag,
186 Cabana::VerletLayout2D,
188using FullVerletList = Cabana::VerletList<Kokkos::DefaultExecutionSpace::memory_space,
189 Cabana::FullNeighborTag,
190 Cabana::VerletLayout2D,
192using NeighborList [[deprecated]] = Cabana::NeighborList<HalfVerletList>;
Concept for predicates that take one coordinate as input, e.g.
Definition datatypes.hpp:201
Concept for predicates that take one position as input, e.g.
Definition datatypes.hpp:210
Concept for predicates that take two positions as input, e.g.
Definition datatypes.hpp:221
Definition BerendsenBarostat.cpp:18
KOKKOS_INLINE_FUNCTION constexpr uint8_t uint8_c(const T &val)
Definition datatypes.hpp:37
Kokkos::View< idx_t * > IntView
Definition datatypes.hpp:154
Kokkos::View< real_t * > ScalarView
Definition datatypes.hpp:159
KOKKOS_INLINE_FUNCTION constexpr unsigned int uint_c(const T &val)
Definition datatypes.hpp:31
Cabana::NeighborList< FullVerletList > FullNeighborList
Definition datatypes.hpp:194
Kokkos::Array< real_t, 3 > Point3D
Definition datatypes.hpp:100
Kokkos::Experimental::ScatterView< idx_t * > IntScatterView
Definition datatypes.hpp:155
Kokkos::Experimental::ScatterView< real_t > SingleScatterView
Definition datatypes.hpp:158
KOKKOS_INLINE_FUNCTION constexpr double double_c(const T &val)
Definition datatypes.hpp:120
Kokkos::Device< Kokkos::DefaultHostExecutionSpace, Kokkos::DefaultHostExecutionSpace::memory_space > HostType
Definition datatypes.hpp:174
KOKKOS_INLINE_FUNCTION constexpr uint32_t uint32_c(const T &val)
Definition datatypes.hpp:49
Cabana::NeighborList< HalfVerletList > NeighborList
Definition datatypes.hpp:192
Cabana::VerletList< Kokkos::DefaultExecutionSpace::memory_space, Cabana::FullNeighborTag, Cabana::VerletLayout2D, Cabana::TeamOpTag > FullVerletList
Definition datatypes.hpp:191
KOKKOS_INLINE_FUNCTION constexpr idx_t idx_c(const T &val)
Definition datatypes.hpp:93
Kokkos::View< real_t ** > MultiView
Definition datatypes.hpp:161
Kokkos::View< real_t > SingleView
Definition datatypes.hpp:157
KOKKOS_INLINE_FUNCTION constexpr int32_t int32_c(const T &val)
Definition datatypes.hpp:80
Kokkos::View< real_t *[3]> VectorView
Definition datatypes.hpp:163
KOKKOS_INLINE_FUNCTION constexpr int16_t int16_c(const T &val)
Definition datatypes.hpp:74
Cabana::VerletList< Kokkos::DefaultExecutionSpace::memory_space, Cabana::HalfNeighborTag, Cabana::VerletLayout2D, Cabana::TeamOpTag > HalfVerletList
Definition datatypes.hpp:187
KOKKOS_INLINE_FUNCTION constexpr uint16_t uint16_c(const T &val)
Definition datatypes.hpp:43
AXIS
Definition datatypes.hpp:141
@ X
index of the x coordinate in vector views
@ Z
index of the z coordinate in vector views
@ Y
index of the y coordinate in vector views
Kokkos::View< idx_t *[2]> PairView
Definition datatypes.hpp:156
KOKKOS_INLINE_FUNCTION constexpr float float_c(const T &val)
Definition datatypes.hpp:126
KOKKOS_INLINE_FUNCTION constexpr int64_t int64_c(const T &val)
Definition datatypes.hpp:86
Kokkos::Experimental::ScatterView< real_t *[3]> VectorScatterView
Definition datatypes.hpp:164
KOKKOS_INLINE_FUNCTION constexpr uint64_t uint64_c(const T &val)
Definition datatypes.hpp:55
Cabana::LinkedCellList< typename DeviceType::memory_space > LinkedCellList
Definition datatypes.hpp:179
int64_t idx_t
Definition datatypes.hpp:91
Cabana::VerletList< Kokkos::DefaultExecutionSpace::memory_space, Cabana::HalfNeighborTag, Cabana::VerletLayout2D, Cabana::TeamOpTag > VerletList
Definition datatypes.hpp:183
Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space > DeviceType
Definition datatypes.hpp:177
Kokkos::View< idx_t * > IndexView
Definition datatypes.hpp:153
KOKKOS_INLINE_FUNCTION constexpr int8_t int8_c(const T &val)
Definition datatypes.hpp:68
Kokkos::Experimental::ScatterView< real_t * > ScalarScatterView
Definition datatypes.hpp:160
double real_t
Definition datatypes.hpp:99
KOKKOS_INLINE_FUNCTION constexpr std::underlying_type_t< Enum > to_underlying(Enum e) noexcept
Definition datatypes.hpp:148
Kokkos::Experimental::ScatterView< real_t ** > MultiScatterView
Definition datatypes.hpp:162
KOKKOS_INLINE_FUNCTION constexpr int int_c(const T &val)
Definition datatypes.hpp:62
KOKKOS_INLINE_FUNCTION bool isFloatEqual(const FLOAT &lhs, const FLOAT &rhs, const FLOAT &epsilon=std::numeric_limits< FLOAT >::epsilon())
Definition datatypes.hpp:132
KOKKOS_INLINE_FUNCTION constexpr real_t real_c(T t)
Definition datatypes.hpp:114
Cabana::NeighborList< HalfVerletList > HalfNeighborList
Definition datatypes.hpp:193
Kokkos::Array< real_t, 3 > Vector3D
Definition datatypes.hpp:101