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 "aosoa_pack.hpp"
26
27#include <Kokkos_Core.hpp>
28
29// Helper functions to check if specific algorithms are active
30#ifdef ESPRESSO_GAY_BERNE
31KOKKOS_INLINE_FUNCTION bool gay_berne_active(double dist,
32 IA_parameters const &ia_params) {
33 return dist < ia_params.gay_berne.cut;
34}
35#endif
36
37#ifdef ESPRESSO_THOLE
38KOKKOS_INLINE_FUNCTION bool thole_active(IA_parameters const &ia_params,
39 bool has_coulomb_kernel) {
40 return (ia_params.thole.scaling_coeff != 0. and ia_params.thole.q1q2 != 0. and
41 has_coulomb_kernel);
42}
43#endif
44
46 bool need_directors = false;
48};
49
51 [[maybe_unused]] double dist,
52 [[maybe_unused]] IA_parameters const &ia_params,
53 [[maybe_unused]] bool has_coulomb, [[maybe_unused]] bool has_dipoles,
54 [[maybe_unused]] auto const &aosoa, [[maybe_unused]] std::size_t i,
55 [[maybe_unused]] std::size_t j) {
56 PairDataFlags flags;
57#ifdef ESPRESSO_GAY_BERNE
58 flags.need_directors |= gay_berne_active(dist, ia_params);
59#endif
60#ifdef ESPRESSO_DIPOLES
61 flags.need_directors |= has_dipoles;
62#endif
63#ifdef ESPRESSO_EXCLUSIONS
65 aosoa.has_exclusion(i) or aosoa.has_exclusion(j);
66#endif
67#ifdef ESPRESSO_THOLE
68 flags.need_particle_pointers |= thole_active(ia_params, has_coulomb);
69#endif
70 return flags;
71}
Various procedures concerning interactions between particles.
KOKKOS_INLINE_FUNCTION PairDataFlags compute_pair_data_flags(double dist, IA_parameters const &ia_params, bool has_coulomb, bool has_dipoles, auto const &aosoa, std::size_t i, std::size_t j)
KOKKOS_INLINE_FUNCTION bool thole_active(IA_parameters const &ia_params, bool has_coulomb_kernel)
KOKKOS_INLINE_FUNCTION bool gay_berne_active(double dist, IA_parameters const &ia_params)
Parameters for non-bonded interactions.
GayBerne_Parameters gay_berne