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 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
45namespace Coulomb {
46
48 std::variant<std::shared_ptr<DebyeHueckel>,
49#ifdef P3M
50 std::shared_ptr<CoulombP3M>,
51 std::shared_ptr<ElectrostaticLayerCorrection>,
52#endif // P3M
53 std::shared_ptr<CoulombMMM1D>,
54#ifdef SCAFACOS
55 std::shared_ptr<CoulombScafacos>,
56#endif // SCAFACOS
57 std::shared_ptr<ReactionField>>;
58
59using ElectrostaticsExtension = std::variant<std::shared_ptr<ICCStar>>;
60
62 /// @brief Main electrostatics solver.
63 std::optional<ElectrostaticsActor> solver;
64 /// @brief Extension that modifies the solver behavior.
65 std::optional<ElectrostaticsExtension> extension;
67};
68
69namespace traits {
70
71#ifdef P3M
72/** @brief Whether an actor can be adapted by ELC. */
73template <typename T>
75 std::is_convertible<std::shared_ptr<T>,
77#endif // P3M
78
79/** @brief Whether an actor is a solver. */
80template <typename T>
81using is_solver = std::is_convertible<std::shared_ptr<T>, ElectrostaticsActor>;
82/** @brief Whether an actor is an extension. */
83template <typename T>
85 std::is_convertible<std::shared_ptr<T>, ElectrostaticsExtension>;
86
87/** @brief The electrostatic method supports pressure calculation. */
88template <class T> struct has_pressure : std::true_type {};
89#ifdef P3M
90template <>
91struct has_pressure<ElectrostaticLayerCorrection> : std::false_type {};
92#endif // P3M
93#ifdef SCAFACOS
94template <> struct has_pressure<CoulombScafacos> : std::false_type {};
95#endif // SCAFACOS
96template <> struct has_pressure<CoulombMMM1D> : std::false_type {};
97
98} // namespace traits
99} // namespace Coulomb
100#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:85
std::is_convertible< std::shared_ptr< T >, ElectrostaticLayerCorrection::BaseSolver > elc_adaptable
Whether an actor can be adapted by ELC.
Definition coulomb.hpp:76
std::is_convertible< std::shared_ptr< T >, ElectrostaticsActor > is_solver
Whether an actor is a solver.
Definition coulomb.hpp:81
std::variant< std::shared_ptr< ICCStar > > ElectrostaticsExtension
Definition coulomb.hpp:59
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:57
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:65
std::optional< ElectrostaticsActor > solver
Main electrostatics solver.
Definition coulomb.hpp:63
The electrostatic method supports pressure calculation.
Definition coulomb.hpp:88
std::variant< std::shared_ptr< CoulombP3M > > BaseSolver
Definition elc.hpp:169