ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
forces.cpp File Reference
#include <config/config.hpp>
#include "BoxGeometry.hpp"
#include "Particle.hpp"
#include "PropagationMode.hpp"
#include "bond_breakage/bond_breakage.hpp"
#include "cell_system/CellStructure.hpp"
#include "cell_system/for_each_particle.hpp"
#include "cells.hpp"
#include "collision_detection/CollisionDetection.hpp"
#include "communication.hpp"
#include "constraints/Constraints.hpp"
#include "electrostatics/icc.hpp"
#include "forces_init.hpp"
#include "forces_inline.hpp"
#include "galilei/ComFixed.hpp"
#include "ghosts.hpp"
#include "immersed_boundary/ImmersedBoundaries.hpp"
#include "integrators/Propagation.hpp"
#include "lb/particle_coupling.hpp"
#include "magnetostatics/dipoles.hpp"
#include "nonbonded_interactions/VerletCriterion.hpp"
#include "nonbonded_interactions/nonbonded_interaction_data.hpp"
#include "npt.hpp"
#include "rotation.hpp"
#include "short_range_cabana.hpp"
#include "short_range_loop.hpp"
#include "short_range_verlet.hpp"
#include "system/GpuParticleData.hpp"
#include "system/System.hpp"
#include "thermostat.hpp"
#include "virtual_sites/com.hpp"
#include "virtual_sites/relative.hpp"
#include <utils/Vector.hpp>
#include <utils/math/sqr.hpp>
#include "caliper_utils.hpp"
#include <Cabana_Core.hpp>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <memory>
#include <span>
#include <variant>
+ Include dependency graph for forces.cpp:

Go to the source code of this file.

Functions

static bool ghost_reduce_overlap_eligible (System::System const &system)
 Eligibility check for the split-phase ghost force reduction.
 
static void force_capping (CellStructure &cell_structure, double force_cap)
 
static void reinit_dip_fld (CellStructure const &cell_structure)
 
static BondsKernelData create_kokkos_bonds_kernel_data (System::System const &system)
 
static ForcesKernel create_cabana_neighbor_kernel (System::System const &system, Utils::Vector3d *virial, auto const &elc_kernel, auto const &coulomb_kernel, auto const &dipoles_kernel, auto const &coulomb_u_kernel)
 
template<bool HasCoulomb>
static ShortRangeVerletPairLoop make_specialized_verlet_pair_loop (InteractionsNonBonded const &nonbonded_ias, CellStructure::AoSoA_pack const &aosoa, CellStructure::ScatterForce scatter_force, CuboidMinimumImage const &minimum_image, double const max_cutoff_sq, Coulomb::ShortRangeForceKernel::kernel_type const *coulomb_ptr=nullptr, CoulombP3M const *p3m=nullptr)
 
static ShortRangeVerletPairLoop create_specialized_verlet_pair_loop (System::System const &system, Utils::Vector3d const *virial, auto const &elc_kernel, auto const &coulomb_kernel, auto const &dipoles_kernel)
 
static void reduce_cabana_forces_and_torques (System::System const &system, Utils::Vector3d *virial)
 

Function Documentation

◆ create_cabana_neighbor_kernel()

static ForcesKernel create_cabana_neighbor_kernel ( System::System const &  system,
Utils::Vector3d virial,
auto const &  elc_kernel,
auto const &  coulomb_kernel,
auto const &  dipoles_kernel,
auto const &  coulomb_u_kernel 
)
static

◆ create_kokkos_bonds_kernel_data()

static BondsKernelData create_kokkos_bonds_kernel_data ( System::System const &  system)
static

◆ create_specialized_verlet_pair_loop()

static ShortRangeVerletPairLoop create_specialized_verlet_pair_loop ( System::System const &  system,
Utils::Vector3d const *  virial,
auto const &  elc_kernel,
auto const &  coulomb_kernel,
auto const &  dipoles_kernel 
)
static

◆ force_capping()

static void force_capping ( CellStructure cell_structure,
double  force_cap 
)
static

◆ ghost_reduce_overlap_eligible()

static bool ghost_reduce_overlap_eligible ( System::System const &  system)
static

Eligibility check for the split-phase ghost force reduction.

The overlap is safe only when ALL of the following hold:

  1. More than one MPI rank: at 1 rank the reduce is a local-only copy, there is nothing to hide, so the split adds overhead for no gain.
  2. ComFixed is inactive: ComFixed applies a per-type force correction that must see the final (post-reduce) forces, which arrive on the blocking path.
  3. force_cap == 0: force capping requires the final forces (post-reduce).
  4. Integrator is VV or symplectic Euler: only these inertial methods use step_2; steepest-descent, BD, SD, and NPT are not eligible (NPT virial is not accumulated during step_2 overlap; BD/SD have no step_2 half-kick).
  5. NPT propagation not in use: the NPT step_2 updates the box pressure and box length using the virial gathered from forces; it must run after the full reduce. NPT also implies integ_switch != NVT/SE, so condition 4 already excludes it, but we check explicitly for clarity.
  6. Dipole field tracking not in use
  7. LB-tracer arm not active: TRANS_LB_TRACER particles have forces transferred to the LB fluid in the integrate loop after calculate_forces and before step_2; with the split-phase path the fluid coupling would run while the reduction is in flight, leading to incorrect force accumulation.

Definition at line 98 of file forces.cpp.

References System::System::comfixed, comm_cart, System::System::dipoles, System::System::get_force_cap(), Dipoles::Solver::impl, INTEG_METHOD_NVT, INTEG_METHOD_SYMPLECTIC_EULER, System::System::propagation, PropagationMode::TRANS_LANGEVIN_NPT, and PropagationMode::TRANS_LB_TRACER.

Referenced by System::System::calculate_forces().

◆ make_specialized_verlet_pair_loop()

template<bool HasCoulomb>
static ShortRangeVerletPairLoop make_specialized_verlet_pair_loop ( InteractionsNonBonded const &  nonbonded_ias,
CellStructure::AoSoA_pack const &  aosoa,
CellStructure::ScatterForce  scatter_force,
CuboidMinimumImage const &  minimum_image,
double const  max_cutoff_sq,
Coulomb::ShortRangeForceKernel::kernel_type const *  coulomb_ptr = nullptr,
CoulombP3M const *  p3m = nullptr 
)
static

Definition at line 216 of file forces.cpp.

◆ reduce_cabana_forces_and_torques()

static void reduce_cabana_forces_and_torques ( System::System const &  system,
Utils::Vector3d virial 
)
static

◆ reinit_dip_fld()

static void reinit_dip_fld ( CellStructure const &  cell_structure)
static