Loading [MathJax]/extensions/TeX/AMSmath.js
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
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 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 P3M
54 std::shared_ptr<CoulombP3M>,
55 std::shared_ptr<ElectrostaticLayerCorrection>,
56#endif // P3M
57 std::shared_ptr<CoulombMMM1D>,
58#ifdef SCAFACOS
59 std::shared_ptr<CoulombScafacos>,
60#endif // SCAFACOS
61 std::shared_ptr<ReactionField>>;
62
63using ElectrostaticsExtension = std::variant<std::shared_ptr<ICCStar>>;
64
66 /// @brief Main electrostatics solver.
67 std::optional<ElectrostaticsActor> solver;
68 /// @brief Extension that modifies the solver behavior.
69 std::optional<ElectrostaticsExtension> extension;
71};
72
73namespace traits {
74
75#ifdef P3M
76/** @brief Whether an actor can be adapted by ELC. */
77template <typename T>
79 std::is_convertible<std::shared_ptr<T>,
81#endif // P3M
82
83/** @brief Whether an actor is a solver. */
84template <typename T>
85using is_solver = std::is_convertible<std::shared_ptr<T>, ElectrostaticsActor>;
86/** @brief Whether an actor is an extension. */
87template <typename T>
89 std::is_convertible<std::shared_ptr<T>, ElectrostaticsExtension>;
90
91/** @brief The electrostatic method supports pressure calculation. */
92template <class T> struct has_pressure : std::true_type {};
93#ifdef P3M
94template <>
95struct has_pressure<ElectrostaticLayerCorrection> : std::false_type {};
96#endif // P3M
97#ifdef SCAFACOS
98template <> struct has_pressure<CoulombScafacos> : std::false_type {};
99#endif // SCAFACOS
100template <> struct has_pressure<CoulombMMM1D> : std::false_type {};
101
102} // namespace traits
103} // namespace Coulomb
104#endif // ELECTROSTATICS
This file contains the defaults for ESPResSo.
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::is_convertible< std::shared_ptr< T >, ElectrostaticsExtension > is_extension
Whether an actor is an extension.
Definition coulomb.hpp:89
std::is_convertible< std::shared_ptr< T >, ElectrostaticLayerCorrection::BaseSolver > elc_adaptable
Whether an actor can be adapted by ELC.
Definition coulomb.hpp:80
std::is_convertible< std::shared_ptr< T >, ElectrostaticsActor > is_solver
Whether an actor is a solver.
Definition coulomb.hpp:85
std::variant< std::shared_ptr< ICCStar > > ElectrostaticsExtension
Definition coulomb.hpp:63
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:61
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:69
std::optional< ElectrostaticsActor > solver
Main electrostatics solver.
Definition coulomb.hpp:67
The electrostatic method supports pressure calculation.
Definition coulomb.hpp:92
std::variant< std::shared_ptr< CoulombP3M > > BaseSolver
Definition elc.hpp:169