28#include "system/Leaf.hpp"
55 static constexpr std::size_t
pos = 0;
56 static constexpr std::size_t
force = 1;
57 static constexpr std::size_t
torque = 2;
58 static constexpr std::size_t
q = 3;
59 static constexpr std::size_t
dip = 4;
72#ifdef ESPRESSO_DIPOLES
75#ifdef ESPRESSO_ELECTROSTATICS
85 bool m_communication_enabled =
false;
87 bool m_split_particle_struct =
false;
89 bool m_need_particles_update =
false;
91 std::shared_ptr<Storage> m_data;
93 bool has_compatible_device_impl()
const;
94 void gpu_init_particle_comm();
95 void enable_particle_transfer();
96 void copy_particles_to_device();
102 void particles_scatter_forces(
ParticleRange const &particles,
103 std::span<float> host_forces,
104 std::span<float> host_torques)
const;
105#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
106 void particles_scatter_dip_fld(
ParticleRange const &particles,
107 std::span<float> host_dip_fld)
const;
115 if (m_need_particles_update and m_communication_enabled) {
116 copy_particles_to_device();
123#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
133#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
136#ifdef ESPRESSO_ROTATION
139#ifdef ESPRESSO_DIPOLES
142#ifdef ESPRESSO_ELECTROSTATICS
std::vector< T, CudaHostAllocator< T > > pinned_vector
Vector implementation and trait types for boost qvm interoperability.
Host and device containers for particle data.
Particle data communication manager for the GPU.
float * get_particle_dip_fld_device() const
~GpuParticleData()=default
float * get_particle_torques_device() const
float * get_particle_charges_device() const
void copy_forces_to_host(ParticleRange const &particles, int this_node)
GpuEnergy * get_energy_device() const
void copy_dip_fld_to_host(ParticleRange const &particles, int this_node)
float * get_particle_dipoles_device() const
float * get_particle_forces_device() const
GpuEnergy copy_energy_to_host() const
void clear_energy_on_device()
void enable_property(std::size_t property)
std::size_t n_particles() const
bool has_compatible_device() const
GpuParticleData()=default
float * get_particle_positions_device() const
Abstract class that represents a component of the system.
int this_node
The number of this node.
static auto gather_particle_data(BoxGeometry const &box_geo, ParticleRange const &particles)
Energies that are retrieved from the GPU.
Subset of Particle which is copied to the GPU.
Particle properties that need to be communicated to the GPU.
static constexpr std::size_t force
static constexpr std::size_t dip_fld
static constexpr std::size_t torque
static constexpr std::size_t pos
static constexpr std::size_t dip
static constexpr std::size_t q