ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
short_range_verlet.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2025-2026 The ESPResSo project
3
*
4
* This file is part of ESPResSo.
5
*
6
* ESPResSo is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* ESPResSo is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
// Sole instantiation site of the update_cabana_state AoSoA-commit /
21
// Verlet-list-build template for VerletCriterion<>. forces.cpp, energy.cpp and
22
// pressure.cpp used to each instantiate this giant (identical each time); they
23
// now call the non-template wrapper below so the build-lambda instantiations
24
// exist ONLY here.
25
26
#include "
short_range_verlet.hpp
"
27
28
#include <
config/config.hpp
>
29
30
#include "
cell_system/CellStructure.hpp
"
31
#include "
electrostatics/coulomb.hpp
"
32
#include "
integrators/Propagation.hpp
"
33
#include "
magnetostatics/dipoles.hpp
"
34
#include "
nonbonded_interactions/VerletCriterion.hpp
"
35
#include "system/System.hpp"
36
37
#include "
short_range_cabana.hpp
"
38
39
void
update_verlet_state
(
System::System
const
&
system
,
40
double
const
collision_cut
) {
41
auto
&cell_structure = *
system
.cell_structure;
42
auto
const
skin
= cell_structure.get_verlet_skin();
43
auto
const
coulomb_cut
=
system
.coulomb.cutoff();
44
auto
const
dipolar_cut
=
system
.dipoles.cutoff();
45
auto
const
pair_cutoff
=
system
.get_interaction_range();
46
auto
const
integ_switch =
system
.propagation->integ_switch;
47
// When no electrostatics/dipolar/collision cutoff is active, build the
48
// criterion variant that compiles those dead per-candidate branches out of
49
// the build loop; otherwise the full one. pair_cutoff is the interaction
50
// range, which is also the criterion's maximum cutoff. Both
51
// update_cabana_state instantiations live in this single TU. The criterion
52
// is handed over as a factory so its O(n_types^2) cutoff table is only
53
// built when the Verlet list is actually rebuilt.
54
bool
const
short_range_only
=
coulomb_cut
==
inactive_cutoff
and
55
dipolar_cut
==
inactive_cutoff
and
56
collision_cut
==
inactive_cutoff
;
57
if
(
short_range_only
) {
58
auto
const
make_criterion
= [&] {
59
return
VerletCriterion<GetNonbondedCutoff, true>
{
60
system
,
skin
,
pair_cutoff
,
coulomb_cut
,
dipolar_cut
,
collision_cut
};
61
};
62
update_cabana_state
(cell_structure,
make_criterion
,
pair_cutoff
,
63
integ_switch);
64
}
else
{
65
auto
const
make_criterion
= [&] {
66
return
VerletCriterion<GetNonbondedCutoff, false>
{
67
system
,
skin
,
pair_cutoff
,
coulomb_cut
,
dipolar_cut
,
collision_cut
};
68
};
69
update_cabana_state
(cell_structure,
make_criterion
,
pair_cutoff
,
70
integ_switch);
71
}
72
}
CellStructure.hpp
Propagation.hpp
VerletCriterion.hpp
System::System
Main system class.
Definition
core/system/System.hpp:87
VerletCriterion
Returns true if the particles are to be considered for short range interactions.
Definition
VerletCriterion.hpp:59
stream
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Definition
common_cuda.cu:34
config.hpp
inactive_cutoff
constexpr double inactive_cutoff
Special cutoff value for an inactive interaction.
Definition
config.hpp:53
coulomb.hpp
dipoles.hpp
short_range_cabana.hpp
update_cabana_state
ESPRESSO_ATTR_ALWAYS_INLINE void update_cabana_state(CellStructure &cell_structure, auto const &make_verlet_criterion, double const pair_cutoff, auto const integ_switch)
Definition
short_range_cabana.hpp:174
update_verlet_state
void update_verlet_state(System::System const &system, double const collision_cut)
Definition
short_range_verlet.cpp:39
short_range_verlet.hpp
src
core
short_range_verlet.cpp
Generated on Tue Aug 18 2026 01:33:36 for ESPResSo by
1.9.8