ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
short_range_cabana_helpers.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 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#pragma once
21
22#include <config/config.hpp>
23
24#include "PropagationMode.hpp"
25#include "aosoa_pack.hpp"
27
28#include <Kokkos_Core.hpp>
29
30// Helper functions to check if specific algorithms are active
31#ifdef ESPRESSO_GAY_BERNE
32// Configured-for-type-pair: mask bit set iff gay_berne has a real cutoff.
33// In-range check is deferred to where it matters.
34ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool
36 return (ia_params.active_pair_mask &
38}
39ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool
40gay_berne_active(double dist, IA_parameters const &ia_params) {
41 return gay_berne_configured(ia_params) and dist < ia_params.gay_berne.cut;
42}
43#endif
44
45#ifdef ESPRESSO_DPD
46// True iff the DPD thermostat is on AND this type pair has DPD configured.
47ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool
48dpd_active(IA_parameters const &ia_params, int thermo_switch) {
49 return (thermo_switch & THERMO_DPD) and
50 ((ia_params.active_pair_mask &
52}
53#endif
54
55#ifdef ESPRESSO_THOLE
56KOKKOS_INLINE_FUNCTION bool thole_active(IA_parameters const &ia_params,
57 bool has_coulomb_kernel) {
58 return (ia_params.thole.scaling_coeff != 0. and ia_params.thole.q1q2 != 0. and
59 has_coulomb_kernel);
60}
61#endif
@ THERMO_DPD
#define ESPRESSO_ATTR_ALWAYS_INLINE
Various procedures concerning interactions between particles.
constexpr unsigned pair_potential_bit(PairPotential p)
Bitmask for a pair potential.
ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool gay_berne_configured(IA_parameters const &ia_params)
ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool gay_berne_active(double dist, IA_parameters const &ia_params)
KOKKOS_INLINE_FUNCTION bool thole_active(IA_parameters const &ia_params, bool has_coulomb_kernel)
ESPRESSO_ATTR_ALWAYS_INLINE KOKKOS_INLINE_FUNCTION bool dpd_active(IA_parameters const &ia_params, int thermo_switch)
Parameters for non-bonded interactions.
GayBerne_Parameters gay_berne
unsigned active_pair_mask
Bitmask of pair potentials active for this type pair.