25#include "communication.hpp"
32#include "system/System.hpp"
33#include "thermostat.hpp"
37#include <boost/mpi/collectives.hpp>
52 m_system.lock()->nonbonded_ias->make_particle_type_exist(
type);
55IA_parameters const &ShapeBasedConstraint::get_ia_param(
int type)
const {
56 return m_system.lock()->nonbonded_ias->get_ia_param(
type, part_rep.
type());
72 particles.begin(), particles.end(),
73 std::numeric_limits<double>::infinity(),
74 [
this, &box_geo](
double acc,
Particle const &p) {
75 auto const &ia_params = get_ia_param(p.type());
76 if (is_active(ia_params)) {
79 m_shape->calculate_dist(box_geo.folded_position(p.pos()), dist, vec);
80 acc = std::min(acc, dist);
85 boost::mpi::minimum<double>(), 0);
99 auto &
system = *m_system.lock();
100 auto const coulomb_kernel =
system.coulomb.pair_force_kernel();
119 part_rep.v(), part_rep.id(),
123 system.thermostat->dpd->rng_increment();
126 }
else if (m_penetrable && (
dist <= 0)) {
127 if ((!m_only_positive) && (
dist < 0)) {
138 part_rep.v(), part_rep.id(),
142 system.thermostat->dpd->rng_increment();
151#ifdef ESPRESSO_ROTATION
157 m_local_force -=
pf.f;
163void ShapeBasedConstraint::add_energy(
const Particle &p,
170 auto &
system = *m_system.lock();
171 auto const coulomb_kernel =
system.coulomb.pair_energy_kernel();
178 }
else if (
dist <= 0.
and m_penetrable) {
179 if (!m_only_positive
and dist < 0.) {
193 if (part_rep.type() >= 0) {
195 p.
type(), part_rep.type(), p.
mol_id(), part_rep.mol_id(), energy);
Vector implementation and trait types for boost qvm interoperability.
Data structures for bonded interactions.
double total_normal_force() const
double min_dist(BoxGeometry const &box_geo, ParticleRange const &particles) const
Calculate the minimum distance between all particle pairs.
Utils::Vector3d total_force() const
Observable for the pressure and energy.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
boost::mpi::communicator comm_cart
The communicator.
constexpr double inactive_cutoff
Special cutoff value for an inactive interaction.
const T * get_ptr(std::optional< T > const &opt)
Utils::Vector3d dpd_pair_force(Utils::Vector3d const &p1_position, Utils::Vector3d const &p1_velocity, int const &p1_id, Utils::Vector3d const &p2_position, Utils::Vector3d const &p2_velocity, int const &p2_id, DPDThermostat const &dpd, BoxGeometry const &box_geo, IA_parameters const &ia_params, Utils::Vector3d const &d, double dist, double dist2)
Routines to use DPD as thermostat or pair force .
double calc_non_bonded_pair_energy(Particle const &p1, Particle const &p2, IA_parameters const &ia_params, Utils::Vector3d const &d, double const dist, BondedInteractionsMap const &bonded_ias, Coulomb::Solver const &coulomb, Coulomb::ShortRangeEnergyKernel::kernel_type const *coulomb_kernel)
Calculate non-bonded energies between a pair of particles.
This file contains the errorhandling code for severe errors, like a broken bond or illegal parameter ...
#define runtimeErrorMsg()
ParticleForce calc_opposing_force(ParticleForce const &pf, Utils::Vector3d const &d)
ParticleForce calc_non_central_force(Particle const &p1, Particle const &p2, IA_parameters const &ia_params, Utils::Vector3d const &d, double const dist)
ESPRESSO_ATTR_ALWAYS_INLINE Utils::Vector3d calc_central_radial_force(IA_parameters const &ia_params, Utils::Vector3d const &d, double const dist)
static bool is_active(IA_parameters const &data)
Check if a non-bonded interaction is defined.
Various procedures concerning interactions between particles.
Parameters for non-bonded interactions.
double max_cut
maximal cutoff for this pair of particle types.
Force information on a particle.
Utils::Vector3d torque
torque.
Struct holding all information for one particle.
auto const & type() const
auto const & mol_id() const
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.