24#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM
31#include <Cabana_Core.hpp>
38#if defined(__GNUG__) or defined(__clang__)
39#define ESPRESSO_ATTR_ALWAYS_INLINE [[gnu::always_inline]]
41#define ESPRESSO_ATTR_ALWAYS_INLINE
55#ifdef ESPRESSO_ROTATION
72 std::vector<Particle *>
const &unique_particles_,
74#ifdef ESPRESSO_ROTATION
87#ifdef ESPRESSO_ROTATION
99#ifdef ESPRESSO_GAY_BERNE
120#ifdef ESPRESSO_DIPOLES
130 auto const &ia_params =
139 auto const dist = d.norm();
142#if defined(ESPRESSO_DIPOLES) or defined(ESPRESSO_GAY_BERNE)
143 bool const need_directors =
146#if defined(ESPRESSO_EXCLUSIONS) or defined(ESPRESSO_THOLE)
152 if (need_particle_pointers) {
159#if defined(ESPRESSO_GAY_BERNE) or defined(ESPRESSO_DIPOLES)
161 if (need_directors) {
171 if (dist < ia_params.max_cut) {
172#ifdef ESPRESSO_EXCLUSIONS
173 bool skip_non_bonded =
false;
178 constexpr bool skip_non_bonded =
false;
180 if (not skip_non_bonded) {
191#ifdef ESPRESSO_GAY_BERNE
207 virial = hadamard_product(pf.f, d);
218 auto const dist2 = dist * dist;
228#ifdef ESPRESSO_ELECTROSTATICS
235 pf.f += (*coulomb_kernel)(q1q2, d, dist);
237 (*elc_kernel)(pos1, pos2, f1_asym, f2_asym, q1q2);
241 virial[0] += (*coulomb_u_kernel)(pos1, pos2, q1q2, d, dist);
249#ifdef ESPRESSO_DIPOLES
253 pf += (*dipoles_kernel)(d1d2,
aosoa.
dipm(i) * dir1,
254 aosoa.
dipm(j) * dir2, d, dist, dist * dist);
260#ifdef ESPRESSO_ELECTROSTATICS
265 auto const thread_id = omp_get_thread_num();
270#ifdef ESPRESSO_ROTATION
279#ifdef ESPRESSO_ROTATION
Vector implementation and trait types for boost qvm interoperability.
container for bonded interactions.
ESPRESSO_ATTR_ALWAYS_INLINE Utils::Vector< T, 3 > get_mi_vector(const Utils::Vector< T, 3 > &a, const Utils::Vector< T, 3 > &b) const
Get the minimum-image vector between two coordinates.
auto & get_ia_param(int i, int j)
Get interaction parameters between particle types i and j.
std::shared_ptr< DPDThermostat > dpd
int thermo_switch
Bitmask of currently active thermostats.
Utils::Vector3d dpd_pair_force(DPDParameters const ¶ms, Utils::Vector3d const &v, double dist, Utils::Vector3d const &noise)
bool do_nonbonded(Particle const &p1, Particle const &p2)
Determine if the non-bonded interactions between p1 and p2 should be calculated.
#define ESPRESSO_ATTR_ALWAYS_INLINE
ParticleForce calc_opposing_force(ParticleForce const &pf, Utils::Vector3d const &d)
ESPRESSO_ATTR_ALWAYS_INLINE Utils::Vector3d calc_central_radial_force(IA_parameters const &ia_params, Utils::Vector3d const &d, double const dist)
ParticleForce gb_pair_force(Utils::Vector3d const &ui, Utils::Vector3d const &uj, IA_parameters const &ia_params, Utils::Vector3d const &d, double dist)
Calculate Gay-Berne force and torques.
Utils::Vector3d get_vector_at(Kokkos::View< double *[3], array_layout, Kokkos::HostSpace > const &view, std::size_t i) const
bool has_exclusion(std::size_t i) const
PositionViewType position
DirectorViewType director
VelocityViewType velocity
Solver::ShortRangeEnergyKernel kernel_type
Solver::ShortRangeForceCorrectionsKernel kernel_type
Solver::ShortRangeForceKernel kernel_type
Solver::ShortRangeForceKernel kernel_type
ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool thole_active(IA_parameters const &ia_params) const
std::vector< Particle * > const & unique_particles
ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool gay_berne_active(double dist, IA_parameters const &ia_params) const
Coulomb::ShortRangeEnergyKernel::kernel_type const *const coulomb_u_kernel
Coulomb::ShortRangeForceCorrectionsKernel::kernel_type const * elc_kernel
ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool npt_active() const
BoxGeometry const & box_geo
ForcesKernel(BondedInteractionsMap const &bonded_ias_, InteractionsNonBonded const &nonbonded_ias_, Coulomb::ShortRangeForceKernel::kernel_type const *coulomb_kernel_, Dipoles::ShortRangeForceKernel::kernel_type const *dipoles_kernel_, Coulomb::ShortRangeForceCorrectionsKernel::kernel_type const *elc_kernel_, Coulomb::ShortRangeEnergyKernel::kernel_type const *coulomb_u_kernel_, Thermostat::Thermostat const &thermostat_, BoxGeometry const &box_geo_, std::vector< Particle * > const &unique_particles_, CellStructure::ForceType const &local_force_, CellStructure::ForceType const &local_torque_, Utils::Vector3d *const global_virial_, CellStructure::VirialType const &local_virial_, CellStructure::AoSoA_pack const &aosoa_)
CellStructure::VirialType const & local_virial
ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool dipoles_active() const
Dipoles::ShortRangeForceKernel::kernel_type const *const dipoles_kernel
CellStructure::AoSoA_pack const & aosoa
CellStructure::ForceType const & local_torque
InteractionsNonBonded const & nonbonded_ias
Utils::Vector3d *const global_virial
ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION void operator()(std::size_t i, std::size_t j) const
BondedInteractionsMap const & bonded_ias
CellStructure::ForceType const & local_force
Coulomb::ShortRangeForceKernel::kernel_type const *const coulomb_kernel
Thermostat::Thermostat const & thermostat
Parameters for non-bonded interactions.
GayBerne_Parameters gay_berne
Force information on a particle.
Struct holding all information for one particle.
Utils::Vector3d thole_pair_force(Particle const &p1, Particle const &p2, IA_parameters const &ia_params, Utils::Vector3d const &d, double dist, BondedInteractionsMap const &bonded_ias, Coulomb::ShortRangeForceKernel::kernel_type const *kernel)
Calculate Thole force.