123 CALI_CXX_MARK_FUNCTION;
127 CALI_MARK_BEGIN(
"copy_particles_to_GPU");
131 CALI_MARK_END(
"copy_particles_to_GPU");
135#ifdef COLLISION_DETECTION
136 collision_detection->clear_queue();
138 bond_breakage->clear_queue();
139 auto particles = cell_structure->local_particles();
140 auto ghost_particles = cell_structure->ghost_particles();
142 if (coulomb.impl->extension) {
143 if (
auto icc = std::get_if<std::shared_ptr<ICCStar>>(
144 get_ptr(coulomb.impl->extension))) {
145 (**icc).iteration(*cell_structure, particles, ghost_particles);
153 thermostat_force_init();
157 auto const elc_kernel = coulomb.pair_force_elc_kernel();
158 auto const coulomb_kernel = coulomb.pair_force_kernel();
159 auto const dipoles_kernel = dipoles.pair_force_kernel();
162 auto const coulomb_cutoff = coulomb.cutoff();
168 auto const dipole_cutoff = dipoles.cutoff();
172#ifdef COLLISION_DETECTION
173 auto const collision_detection_cutoff = collision_detection->cutoff();
179 [coulomb_kernel_ptr =
get_ptr(coulomb_kernel), &bonded_ias = *bonded_ias,
180 &bond_breakage = *bond_breakage, &box_geo = *box_geo](
181 Particle &p1,
int bond_id, std::span<Particle *> partners) {
183 bond_breakage, box_geo, coulomb_kernel_ptr);
185 [coulomb_kernel_ptr =
get_ptr(coulomb_kernel),
186 dipoles_kernel_ptr =
get_ptr(dipoles_kernel),
187 elc_kernel_ptr =
get_ptr(elc_kernel), &nonbonded_ias = *nonbonded_ias,
188 &thermostat = *thermostat, &bonded_ias = *bonded_ias,
189#ifdef COLLISION_DETECTION
190 &collision_detection = *collision_detection,
193 auto const &ia_params =
194 nonbonded_ias.get_ia_param(p1.
type(), p2.type());
196 ia_params, thermostat, box_geo, bonded_ias,
197 coulomb_kernel_ptr, dipoles_kernel_ptr,
199#ifdef COLLISION_DETECTION
200 if (not collision_detection.is_off()) {
201 collision_detection.detect_collision(p1, p2, d.dist2);
205 *cell_structure, maximal_cutoff(), bonded_ias->maximal_cutoff(),
207 get_interaction_range(), coulomb_cutoff, dipole_cutoff,
208 collision_detection_cutoff});
210 constraints->add_forces(particles, get_sim_time());
211 oif_global->calculate_forces();
214 immersed_boundaries->volume_conservation(*cell_structure);
216 if (thermostat->lb and (propagation->used_propagations &
218 lb_couple_particles();
223 CALI_MARK_BEGIN(
"copy_forces_from_GPU");
225 gpu.copy_forces_to_host(particles,
this_node);
227 CALI_MARK_END(
"copy_forces_from_GPU");
231#ifdef VIRTUAL_SITES_RELATIVE
232 if (propagation->used_propagations &
239 cell_structure->ghosts_reduce_forces();
242 comfixed->apply(particles);
248 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.
bool add_bonded_force(Particle &p1, int bond_id, std::span< Particle * > partners, BondedInteractionsMap const &bonded_ia_params, BondBreakage::BondBreakage &bond_breakage, BoxGeometry const &box_geo, Coulomb::ShortRangeForceKernel::kernel_type const *kernel)
Force information on a particle.
Struct holding all information for one particle.
auto const & swimming() const
auto const & ext_force() const
auto const & type() const
auto const & ext_torque() const
auto calc_director() const