32#include <boost/container/vector.hpp>
33#include <boost/serialization/is_bitwise_serializable.hpp>
34#include <boost/serialization/level.hpp>
35#include <boost/serialization/vector.hpp>
65#ifdef ESPRESSO_THERMAL_STONER_WOHLFARTH
118#ifdef ESPRESSO_ROTATION
133#ifdef ESPRESSO_EXTERNAL_FORCES
151 constexpr static double mass{1.0};
155#ifdef ESPRESSO_ROTATIONAL_INERTIA
162#ifdef ESPRESSO_ELECTROSTATICS
165 constexpr static double q{0.0};
168#ifdef ESPRESSO_LB_ELECTROHYDRODYNAMICS
173#ifdef ESPRESSO_DIPOLES
178#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
183#ifdef ESPRESSO_VIRTUAL_SITES_RELATIVE
208#ifdef ESPRESSO_THERMOSTAT_PER_PARTICLE
210#ifndef ESPRESSO_PARTICLE_ANISOTROPY
215#ifdef ESPRESSO_ROTATION
217#ifndef ESPRESSO_PARTICLE_ANISOTROPY
225#ifdef ESPRESSO_EXTERNAL_FORCES
228#ifdef ESPRESSO_ROTATION
234#ifdef ESPRESSO_ENGINE
238#ifdef ESPRESSO_THERMAL_STONER_WOHLFARTH
250#ifdef ESPRESSO_ROTATIONAL_INERTIA
253#ifdef ESPRESSO_ROTATION
256#ifdef ESPRESSO_ELECTROSTATICS
259#ifdef ESPRESSO_LB_ELECTROHYDRODYNAMICS
262#ifdef ESPRESSO_DIPOLES
265#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
268#ifdef ESPRESSO_VIRTUAL_SITES_RELATIVE
271#ifdef ESPRESSO_THERMOSTAT_PER_PARTICLE
273#ifdef ESPRESSO_ROTATION
277#ifdef ESPRESSO_EXTERNAL_FORCES
280#ifdef ESPRESSO_ROTATION
284#ifdef ESPRESSO_ENGINE
287#ifdef ESPRESSO_THERMAL_STONER_WOHLFARTH
302#ifdef ESPRESSO_ROTATION
311#ifdef ESPRESSO_BOND_CONSTRAINT
319#ifdef ESPRESSO_ROTATION
322#ifdef ESPRESSO_BOND_CONSTRAINT
336#ifdef ESPRESSO_ROTATION
350#ifdef ESPRESSO_ROTATION
359#ifdef ESPRESSO_ROTATION
366#ifdef ESPRESSO_ROTATION
380#ifdef ESPRESSO_ROTATION
389#ifdef ESPRESSO_ROTATION
415#ifdef ESPRESSO_BOND_CONSTRAINT
426 return *
this = *
this +
rhs;
443#ifdef ESPRESSO_BOND_CONSTRAINT
447#ifdef ESPRESSO_EXCLUSIONS
459 constexpr auto const &
type()
const {
return p.
type; }
466 return id() ==
rhs.id();
470 return id() !=
rhs.id();
473 constexpr auto const &
bonds()
const {
return bl; }
474 constexpr auto &
bonds() {
return bl; }
476 constexpr auto const &
pos()
const {
return r.
p; }
477 constexpr auto &
pos() {
return r.
p; }
478 constexpr auto const &
v()
const {
return m.
v; }
479 constexpr auto &
v() {
return m.
v; }
480 constexpr auto const &
force()
const {
return f.
f; }
500 constexpr auto const &
mass()
const {
return p.
mass; }
504#ifdef ESPRESSO_ROTATION
510 return detail::get_nth_bit(p.
rotation, axis);
527 constexpr auto const &
quat()
const {
return r.
quat; }
533#ifdef ESPRESSO_EXTERNAL_FORCES
539 constexpr auto can_rotate()
const {
return false; }
542#ifdef ESPRESSO_DIPOLES
543 constexpr auto const &
dipm()
const {
return p.
dipm; }
547#ifdef ESPRESSO_THERMAL_STONER_WOHLFARTH
589#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
594#ifdef ESPRESSO_ROTATIONAL_INERTIA
597 constexpr auto const &
q()
const {
return p.
q; }
598#ifdef ESPRESSO_ELECTROSTATICS
599 constexpr auto &
q() {
return p.
q; }
601#ifdef ESPRESSO_LB_ELECTROHYDRODYNAMICS
602 constexpr auto const &
mu_E()
const {
return p.
mu_E; }
605#ifdef ESPRESSO_VIRTUAL_SITES
614 constexpr auto is_virtual()
const {
return false; }
616#ifdef ESPRESSO_VIRTUAL_SITES_RELATIVE
620#ifdef ESPRESSO_THERMOSTAT_PER_PARTICLE
623#ifdef ESPRESSO_ROTATION
628#ifdef ESPRESSO_EXTERNAL_FORCES
632 return static_cast<bool>(p.
ext_flag);
636 return detail::get_nth_bit(p.
ext_flag, axis);
650 constexpr bool is_fixed_along(
unsigned int const)
const {
return false; }
652#ifdef ESPRESSO_ENGINE
656#ifdef ESPRESSO_BOND_CONSTRAINT
665#ifdef ESPRESSO_EXCLUSIONS
669 return std::ranges::find(el, pid) != el.end();
674 friend boost::serialization::access;
675 template <
class Archive>
void serialize(
Archive &
ar,
long int ) {
682#ifdef ESPRESSO_EXCLUSIONS
689#ifdef ESPRESSO_ENGINE
692#ifdef ESPRESSO_THERMAL_STONER_WOHLFARTH
701#ifdef ESPRESSO_BOND_CONSTRAINT
704#ifdef ESPRESSO_VIRTUAL_SITES_RELATIVE
709#ifdef ESPRESSO_ENGINE
712#ifdef ESPRESSO_THERMAL_STONER_WOHLFARTH
720#ifdef ESPRESSO_BOND_CONSTRAINT
723#ifdef ESPRESSO_VIRTUAL_SITES_RELATIVE
Vector implementation and trait types for boost qvm interoperability.
Custom vector container optimized for size.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
@ TRANS_VS_CENTER_OF_MASS
constexpr Vector< T, 3 > convert_quaternion_to_director(Quaternion< T > const &quat)
Convert quaternion to director.
Quaternion implementation and trait types for boost qvm interoperability.
Force information on a particle.
Utils::Vector3d torque
torque.
ParticleForce(const Utils::Vector3d &f, const Utils::Vector3d &torque)
void serialize(Archive &ar, long int)
friend ParticleForce operator+(ParticleForce const &lhs, ParticleForce const &rhs)
ParticleForce(const Utils::Vector3d &f)
ParticleForce(ParticleForce const &)=default
ParticleForce & operator+=(ParticleForce const &rhs)
ParticleForce & operator=(ParticleForce const &)=default
Information on a particle that is needed only on the node the particle belongs to.
bool ghost
is particle a ghost particle.
short int lees_edwards_flag
void serialize(Archive &ar, long int)
double lees_edwards_offset
Accumulated applied Lees-Edwards offset.
Utils::Vector3d p_old
position from the last Verlet list update.
Momentum information on a particle.
Utils::Vector3d v
velocity.
Utils::Vector3d omega
angular velocity.
void serialize(Archive &ar, long int)
Properties of a self-propelled particle.
void serialize(Archive &ar, long int)
bool swimming
Is the particle a swimmer.
bool is_engine_force_on_fluid
Whether f_swim is applied to the particle or to the fluid.
double f_swim
Imposed constant force.
Positional information on a particle.
Utils::Quaternion< double > quat
quaternion to define particle orientation
Utils::Vector3i i
index of the simulation box image where the particle really sits.
constexpr Utils::Vector3d calc_director() const
unit director calculated from the quaternion
Utils::Vector3d p_last_timestep
particle position at the previous time step (RATTLE algorithm)
void serialize(Archive &ar, long int)
Utils::Vector3d p
periodically folded position.
The following properties define, with respect to which real particle a virtual site is placed and at ...
void serialize(Archive &ar, long int)
Utils::Quaternion< double > rel_orientation
Relative position of the virtual site.
Utils::Quaternion< double > quat
Orientation of the virtual particle in the body fixed frame.
Properties of a particle which are not supposed to change during the integration, but have to be know...
Utils::Vector3d gamma_rot
Friction coefficient for rotation.
double dipm
dipole moment (absolute value)
Utils::Vector3d rinertia
rotational inertia
ParticleParametersSwimming swim
int identity
unique identifier for the particle.
Utils::Vector3d ext_torque
External torque.
void serialize(Archive &ar, long int)
Utils::Vector3d ext_force
External force.
Utils::Vector3d mu_E
electrophoretic mobility times E-field: mu_0 * E
int mol_id
Molecule identifier.
Utils::Vector3d dip_fld
total dipole field
ThermalStonerWohlfarthParameters magnetodynamics
uint8_t ext_flag
Flag for fixed particle coordinates.
int propagation
which propagation schemes should be applied to the particle
struct ParticleProperties::VirtualSitesRelativeParameters vs_relative
Utils::Vector3d gamma
Friction coefficient for translation.
uint8_t rotation
Bitfield for the particle axes of rotation.
int type
particle type, used for non-bonded interactions.
friend ParticleRattle operator+(ParticleRattle const &lhs, ParticleRattle const &rhs)
Utils::Vector3d correction
position/velocity correction
ParticleRattle & operator+=(ParticleRattle const &rhs)
void serialize(Archive &ar, long int)
Struct holding all information for one particle.
constexpr auto const & dip_fld() const
constexpr auto & stoner_wohlfarth_tau0_inv()
constexpr auto & torque()
constexpr void set_fixed_along(int const axis, bool const fixed_flag)
constexpr auto calc_director() const
bool has_exclusion(int pid) const
constexpr void set_cannot_rotate_all_axes()
constexpr auto const & bonds() const
constexpr auto & stoner_wohlfarth_is_enabled()
constexpr auto const & magnetic_anisotropy_field_inv() const
constexpr auto const & stoner_wohlfarth_is_enabled() const
constexpr auto & force_and_torque()
constexpr auto & vs_relative()
constexpr auto & propagation()
constexpr auto const & quat() const
constexpr auto calc_dip() const
constexpr bool can_rotate() const
constexpr auto const & pos() const
constexpr auto const & swimming() const
Utils::compact_vector< int > const & exclusions() const
constexpr auto const & rattle_correction() const
constexpr auto & rinertia()
constexpr auto & stoner_wohlfarth_dt_incr()
constexpr auto const & rinertia() const
constexpr auto const & mass() const
constexpr auto const & dipm() const
Utils::compact_vector< int > & exclusions()
constexpr auto & rotation()
constexpr auto const & type() const
constexpr auto const & omega() const
constexpr auto & stoner_wohlfarth_phi_0()
constexpr auto & pos_last_time_step()
constexpr auto & magnetic_anisotropy_energy()
constexpr auto & ext_force()
constexpr auto const & saturation_magnetization() const
constexpr auto const & stoner_wohlfarth_dt_incr() const
constexpr auto & magnetic_anisotropy_field_inv()
constexpr auto & dip_fld()
constexpr auto const & magnetic_anisotropy_energy() const
constexpr auto const & ext_force() const
constexpr void set_can_rotate_all_axes()
constexpr auto const & propagation() const
constexpr bool operator==(Particle const &rhs) const
constexpr auto & ext_torque()
constexpr auto const & ext_torque() const
constexpr auto & pos_at_last_verlet_update()
constexpr bool operator!=(Particle const &rhs) const
constexpr auto const & rotation() const
constexpr void set_can_rotate_around(unsigned int const axis, bool const rot_flag)
constexpr auto const & force() const
constexpr auto is_virtual() const
constexpr auto const & vs_relative() const
constexpr auto const & fixed() const
constexpr auto const & gamma() const
constexpr auto & rattle_params()
constexpr bool has_fixed_coordinates() const
constexpr auto const & gamma_rot() const
constexpr auto const & image_box() const
constexpr auto & lees_edwards_flag()
constexpr bool is_fixed_along(unsigned int const axis) const
constexpr auto const & mu_E() const
constexpr auto & image_box()
constexpr auto const & stoner_wohlfarth_tau0_inv() const
constexpr auto const & id() const
constexpr auto const & mol_id() const
constexpr auto const & q() const
constexpr bool can_rotate_around(unsigned int const axis) const
constexpr auto const & stoner_wohlfarth_phi_0() const
constexpr auto const & force_and_torque() const
constexpr auto const & rattle_params() const
constexpr auto & lees_edwards_offset()
constexpr auto const & pos_at_last_verlet_update() const
constexpr void set_ghost(bool const ghost_flag)
constexpr auto const & pos_last_time_step() const
constexpr auto & swimming()
constexpr auto & mol_id()
constexpr bool is_ghost() const
constexpr auto & gamma_rot()
constexpr auto const & v() const
constexpr auto const & torque() const
constexpr auto const & lees_edwards_flag() const
constexpr auto const & lees_edwards_offset() const
constexpr auto & rattle_correction()
constexpr auto & saturation_magnetization()
Properties for thermal Stoner-Wohlfarth magnetodynamics.
bool is_enabled
Flag to distinguish virtual particles carrying the dipole moment in the thermal Stoner-Wohlfarth mode...
double tau0_inv
Browns attempt frequency.
double ani_energy
Magnetic anisotropy energy (K1 * V) in units of energy.
void serialize(Archive &ar, long int)
double dt_incr
time units parameter for the kinetic Monte Carlo step
double ani_fld_inv
Inverse anisotropy field in reduced units.
double sat_mag
saturation magnetisation of a polarizable particle
double phi0
angle between the director and dipole moment of a Stoner-Wohlfarth particle
Quaternion representation.
static Quaternion< T > identity()
Construct an identity quaternion.