24#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
28#include <Kokkos_Core.hpp>
60 void resize(std::size_t num_particles) {
64#ifdef ESPRESSO_ELECTROSTATICS
73#if defined(ESPRESSO_GAY_BERNE) or defined(ESPRESSO_DIPOLES)
76#ifdef ESPRESSO_DIPOLES
81 Kokkos::realloc(
position, num_particles);
82#ifdef ESPRESSO_ELECTROSTATICS
83 Kokkos::realloc(
charge, num_particles);
85 Kokkos::realloc(
id, num_particles);
86 Kokkos::realloc(
type, num_particles);
87 Kokkos::realloc(
flags, num_particles);
89 Kokkos::realloc(
velocity, num_particles);
91#if defined(ESPRESSO_GAY_BERNE) or defined(ESPRESSO_DIPOLES)
92 Kokkos::realloc(
director, num_particles);
94#ifdef ESPRESSO_DIPOLES
95 Kokkos::realloc(
dipm, num_particles);
100 template <
typename array_layout>
102 Kokkos::View<
double *[3], array_layout, Kokkos::HostSpace>
const &view,
103 std::size_t i)
const {
104 return {view(i, 0), view(i, 1), view(i, 2)};
107 template <
typename array_layout>
109 Kokkos::View<
double *[3], array_layout, Kokkos::HostSpace> &view,
111 view(i, 0) = value[0];
112 view(i, 1) = value[1];
113 view(i, 2) = value[2];
117 flags(i) = value ? uint8_t{1} : uint8_t{0};
IdToIndexViewType id_to_index
Utils::Vector3d get_vector_at(Kokkos::View< double *[3], array_layout, Kokkos::HostSpace > const &view, std::size_t i) const
Kokkos::View< double *, Kokkos::HostSpace > ChargeViewType
bool has_exclusion(std::size_t i) const
Kokkos::View< uint8_t *, Kokkos::HostSpace > FlagsViewType
Kokkos::View< double *, Kokkos::HostSpace > DipmViewType
void set_vector_at(Kokkos::View< double *[3], array_layout, Kokkos::HostSpace > &view, std::size_t i, Utils::Vector3d const &value)
Kokkos::View< double *[3], Kokkos::LayoutRight, Kokkos::HostSpace > DirectorViewType
PositionViewType position
AoSoA_pack(std::size_t num_particles)
Kokkos::View< int *, Kokkos::HostSpace > TypeViewType
Kokkos::View< double *[3], Kokkos::LayoutRight, Kokkos::HostSpace > PositionViewType
void set_has_exclusion(std::size_t i, bool value)
DirectorViewType director
Kokkos::View< int *, Kokkos::HostSpace > IdViewType
VelocityViewType velocity
void resize(std::size_t num_particles)