62 if (
not m_obs_pressure) {
64 m_obs_pressure = std::make_shared<PressureObservable>();
65 m_obs_pressure->observable = std::make_unique<Observable_stat>(9ul, 0
ul, 0);
66 m_obs_pressure->local =
67 decltype(m_obs_pressure->local)(
"local_pressure",
n_threads, 9ul);
70 auto &local_pressure = m_obs_pressure->local;
72 obs_pressure.reset(
static_cast<std::size_t
>(bonded_ias->get_next_key()),
73 nonbonded_ias->get_max_seen_particle_type());
75 if (long_range_interactions_sanity_checks()) {
81 auto const volume = box_geo->volume();
90 [](
auto &a,
auto const &b) { a += b; });
101 cell_structure->get_verlet_skin(),
102 get_interaction_range(),
110 static_cast<std::size_t
>(bonded_ias->get_next_key()),
111 std::size_t(nonbonded_ias->get_max_seen_particle_type() + 1)};
113 using exec = Kokkos::DefaultHostExecutionSpace;
114 if (local_pressure.extent(1) != layout.total * 9ul) {
115 Kokkos::realloc(Kokkos::WithoutInitializing, local_pressure,
116 exec{}.concurrency(), layout.total * 9ul);
120 auto const &unique_particles = cell_structure->get_unique_particles();
121 auto const n_particles = unique_particles.size();
122 Kokkos::View<int *, Kokkos::LayoutRight, exec> mol_id(
"mol_id", n_particles);
123 for (std::size_t i = 0; i < n_particles; ++i) {
124 mol_id(i) = unique_particles[i]->mol_id();
135 thermostat->
dpd.get(),
137 cell_structure->get_unique_particles(),
140 cell_structure->get_aosoa(),
143 thermostat->thermo_switch};
145 auto &
bs = cell_structure->bond_state();
147 layout, cell_structure->get_aosoa()};
158 propagation->integ_switch);
161 nonbonded_ias->get_max_seen_particle_type() + 1);
163#ifdef ESPRESSO_ELECTROSTATICS
168#ifdef ESPRESSO_DIPOLES
174#ifdef ESPRESSO_VIRTUAL_SITES_RELATIVE
182#ifdef ESPRESSO_BOND_CONSTRAINT
183 if (propagation->is_inertial()
and bonded_ias->get_n_rigid_bonds() >= 1) {
189 auto const &rigid_bond_virial = bonded_ias->rigid_bond_virial;
190 for (std::size_t bond_id = 0; bond_id < rigid_bond_virial.size();
192 auto const stress = rigid_bond_virial[bond_id] /
sq_dt;
194 for (std::size_t k = 0; k < 9u; ++k)
ESPRESSO_ATTR_ALWAYS_INLINE void kokkos_deep_copy(auto const &exec_space, auto const &view, auto const &value)
Wrapper for Kokkos::deep_copy that skips fork/join when the number of threads is 1.
static void reduce_cabana_pressure(Kokkos::View< double **, Kokkos::LayoutRight, Kokkos::HostSpace > const &local_pressure, PressureBinLayout const &layout, Observable_stat &obs, BondedInteractionsMap const &bonded_ias, int n_types)
void cabana_short_range(auto const &pair_bonds_kernel, auto const &angle_bonds_kernel, auto const &dihedral_bonds_kernel, auto const &nonbonded_kernel, CellStructure &cell_structure, double pair_cutoff, double bond_cutoff, auto const &make_verlet_criterion, auto const integ_switch, ShortRangeVerletPairLoop const &verlet_pair_loop={})
Struct holding all information for one particle.