121 CALI_CXX_MARK_FUNCTION;
125 CALI_MARK_BEGIN(
"copy_particles_to_GPU");
129 CALI_MARK_END(
"copy_particles_to_GPU");
133#ifdef COLLISION_DETECTION
134 collision_detection->clear_queue();
136 bond_breakage->clear_queue();
137 auto particles = cell_structure->local_particles();
139 if (coulomb.impl->extension) {
140 if (
auto icc = std::get_if<std::shared_ptr<ICCStar>>(
141 get_ptr(coulomb.impl->extension))) {
142 auto ghost_particles = cell_structure->ghost_particles();
143 (**icc).iteration(*cell_structure, particles, ghost_particles);
154 thermostat_force_init();
158 auto const elc_kernel = coulomb.pair_force_elc_kernel();
159 auto const coulomb_kernel = coulomb.pair_force_kernel();
160 auto const dipoles_kernel = dipoles.pair_force_kernel();
163 auto const coulomb_cutoff = coulomb.cutoff();
169 auto const dipole_cutoff = dipoles.cutoff();
173#ifdef COLLISION_DETECTION
174 auto const collision_detection_cutoff = collision_detection->cutoff();
180 [coulomb_kernel_ptr =
get_ptr(coulomb_kernel), &bonded_ias = *bonded_ias,
181 &bond_breakage = *bond_breakage, &box_geo = *box_geo](
182 Particle &p1,
int bond_id, std::span<Particle *> partners) {
184 bond_breakage, box_geo, coulomb_kernel_ptr);
186 [coulomb_kernel_ptr =
get_ptr(coulomb_kernel),
187 dipoles_kernel_ptr =
get_ptr(dipoles_kernel),
188 elc_kernel_ptr =
get_ptr(elc_kernel), &nonbonded_ias = *nonbonded_ias,
189 &thermostat = *thermostat, &bonded_ias = *bonded_ias,
190#ifdef COLLISION_DETECTION
191 &collision_detection = *collision_detection,
194 auto const &ia_params =
195 nonbonded_ias.get_ia_param(p1.
type(), p2.type());
197 ia_params, thermostat, box_geo, bonded_ias,
198 coulomb_kernel_ptr, dipoles_kernel_ptr,
200#ifdef COLLISION_DETECTION
201 if (not collision_detection.is_off()) {
202 collision_detection.detect_collision(p1, p2, d.dist2);
206 *cell_structure, maximal_cutoff(), bonded_ias->maximal_cutoff(),
208 get_interaction_range(), coulomb_cutoff, dipole_cutoff,
209 collision_detection_cutoff});
211 constraints->add_forces(particles, get_sim_time());
212 oif_global->calculate_forces();
215 immersed_boundaries->volume_conservation(*cell_structure);
217 if (thermostat->lb and (propagation->used_propagations &
219 lb_couple_particles();
224 CALI_MARK_BEGIN(
"copy_forces_from_GPU");
226 gpu.copy_forces_to_host(particles,
this_node);
228 CALI_MARK_END(
"copy_forces_from_GPU");
232#ifdef VIRTUAL_SITES_RELATIVE
233 if (propagation->used_propagations &
240 cell_structure->ghosts_reduce_forces();
243 comfixed->apply(particles);
249 propagation->recalc_forces =
false;
void add_non_bonded_pair_force(Particle &p1, Particle &p2, Utils::Vector3d const &d, double dist, double dist2, IA_parameters const &ia_params, Thermostat::Thermostat const &thermostat, BoxGeometry const &box_geo, BondedInteractionsMap const &bonded_ias, Coulomb::ShortRangeForceKernel::kernel_type const *coulomb_kernel, Dipoles::ShortRangeForceKernel::kernel_type const *dipoles_kernel, Coulomb::ShortRangeForceCorrectionsKernel::kernel_type const *elc_kernel)
Calculate non-bonded forces between a pair of particles and update their forces and torques.
Force information on a particle.
Struct holding all information for one particle.
auto const & swimming() const
auto const & force_and_torque() const
auto const & ext_force() const
auto const & type() const
auto const & ext_torque() const
auto const & force() const
auto calc_director() const