ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
coulomb.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 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#ifdef ESPRESSO_ELECTROSTATICS
25
26#include "actor/traits.hpp"
27
29
37
38#include <cstddef>
39#include <functional>
40#include <memory>
41#include <optional>
42#include <type_traits>
43#include <variant>
44
45#ifdef FFTW3_H
46#error "The FFTW3 library shouldn't be visible in this translation unit"
47#endif
48
49namespace Coulomb {
50
52 std::variant<std::shared_ptr<DebyeHueckel>,
53#ifdef ESPRESSO_P3M
54 std::shared_ptr<CoulombP3M>,
55 std::shared_ptr<ElectrostaticLayerCorrection>,
56#endif // ESPRESSO_P3M
57#ifdef ESPRESSO_GSL
58 std::shared_ptr<CoulombMMM1D>,
59#endif // ESPRESSO_GSL
60#ifdef ESPRESSO_SCAFACOS
61 std::shared_ptr<CoulombScafacos>,
62#endif // ESPRESSO_SCAFACOS
63 std::shared_ptr<ReactionField>>;
64
65using ElectrostaticsExtension = std::variant<std::shared_ptr<ICCStar>>;
66
68 /// @brief Main electrostatics solver.
69 std::optional<ElectrostaticsActor> solver;
70 /// @brief Extension that modifies the solver behavior.
71 std::optional<ElectrostaticsExtension> extension;
73};
74
75namespace traits {
76
77/** @brief The electrostatic method supports pressure calculation. */
78template <class T> struct has_pressure : std::true_type {};
79#ifdef ESPRESSO_P3M
80template <>
81struct has_pressure<ElectrostaticLayerCorrection> : std::false_type {};
82#endif // ESPRESSO_P3M
83#ifdef ESPRESSO_SCAFACOS
84template <> struct has_pressure<CoulombScafacos> : std::false_type {};
85#endif // ESPRESSO_SCAFACOS
86#ifdef ESPRESSO_GSL
87template <> struct has_pressure<CoulombMMM1D> : std::false_type {};
88#endif // ESPRESSO_GSL
89
90} // namespace traits
91} // namespace Coulomb
92#endif // ESPRESSO_ELECTROSTATICS
Calculate the Debye-Hückel energy and force for a particle pair.
ELC algorithm for long-range Coulomb interactions.
ICC is a method that allows to take into account the influence of arbitrarily shaped dielectric inter...
MMM1D algorithm for long-range Coulomb interactions on the CPU.
std::variant< std::shared_ptr< ICCStar > > ElectrostaticsExtension
Definition coulomb.hpp:65
std::variant< std::shared_ptr< DebyeHueckel >, std::shared_ptr< CoulombP3M >, std::shared_ptr< ElectrostaticLayerCorrection >, std::shared_ptr< CoulombMMM1D >, std::shared_ptr< CoulombScafacos >, std::shared_ptr< ReactionField > > ElectrostaticsActor
Definition coulomb.hpp:63
P3M algorithm for long-range Coulomb interaction.
Calculate the Reaction Field energy and force for a particle pair , .
Parameters for the MMM1D electrostatic interaction.
Definition mmm1d.hpp:51
std::optional< ElectrostaticsExtension > extension
Extension that modifies the solver behavior.
Definition coulomb.hpp:71
std::optional< ElectrostaticsActor > solver
Main electrostatics solver.
Definition coulomb.hpp:69
The electrostatic method supports pressure calculation.
Definition coulomb.hpp:78