22#ifdef DIPOLAR_DIRECT_SUM
28#include "communication.hpp"
30#include "system/System.hpp"
34 for (
unsigned int i = 0u; i < 3u; i++) {
35 box[i] =
static_cast<float>(box_geo.
length()[i]);
54 auto &gpu = system.gpu;
62 auto const npart =
static_cast<unsigned>(gpu.n_particles());
63 auto const forces_device = gpu.get_particle_forces_device();
64 auto const torques_device = gpu.get_particle_torques_device();
65 auto const positions_device = gpu.get_particle_positions_device();
66 auto const dipoles_device = gpu.get_particle_dipoles_device();
68 static_cast<float>(
prefactor), npart, positions_device, dipoles_device,
69 forces_device, torques_device, box, periodicity);
74 auto &gpu = system.gpu;
82 auto const npart =
static_cast<unsigned>(gpu.n_particles());
83 auto const energy_device = &(gpu.get_energy_device()->dipolar);
84 auto const positions_device = gpu.get_particle_positions_device();
85 auto const dipoles_device = gpu.get_particle_dipoles_device();
87 positions_device, dipoles_device, box,
88 periodicity, energy_device);
Utils::Vector3d const & length() const
Box length.
constexpr bool periodic(unsigned coord) const
Check periodicity in direction.
void set_prefactor(double new_prefactor)
double prefactor
Magnetostatics prefactor.
int this_node
The number of this node.
This file contains the defaults for ESPResSo.
static void get_simulation_box(BoxGeometry const &box_geo, float *box, int *per)
void DipolarDirectSum_kernel_wrapper_energy(float k, unsigned int n, float *pos, float *dip, float box_l[3], int periodic[3], float *E)
void DipolarDirectSum_kernel_wrapper_force(float k, unsigned int n, float *pos, float *dip, float *f, float *torque, float box_l[3], int periodic[3])
DipolarDirectSumGpu(double prefactor)
void on_activation() const
void long_range_energy() const
void add_long_range_forces() const
static constexpr std::size_t force
static constexpr std::size_t torque
static constexpr std::size_t pos
static constexpr std::size_t dip