ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
dipoles.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 DIPOLES
25
26#include "actor/traits.hpp"
27
29
36
37#include <cstddef>
38#include <functional>
39#include <memory>
40#include <optional>
41#include <stdexcept>
42#include <type_traits>
43#include <variant>
44
45namespace Dipoles {
46
48 std::variant<std::shared_ptr<DipolarDirectSum>,
49#ifdef DIPOLAR_DIRECT_SUM
50 std::shared_ptr<DipolarDirectSumGpu>,
51#endif
52#ifdef DIPOLAR_BARNES_HUT
53 std::shared_ptr<DipolarBarnesHutGpu>,
54#endif
55#ifdef DP3M
56 std::shared_ptr<DipolarP3M>,
57#endif
58#ifdef SCAFACOS_DIPOLES
59 std::shared_ptr<DipolarScafacos>,
60#endif
61 std::shared_ptr<DipolarLayerCorrection>>;
62
64 /// @brief Main electrostatics solver.
65 std::optional<MagnetostaticsActor> solver;
67};
68
69namespace traits {
70
71/** @brief Whether an actor is a solver. */
72template <typename T>
73using is_solver = std::is_convertible<std::shared_ptr<T>, MagnetostaticsActor>;
74
75/** @brief The dipolar method supports dipole fields calculation. */
76template <class T> struct has_dipole_fields : std::false_type {};
77#ifdef DIPOLE_FIELD_TRACKING
78template <> struct has_dipole_fields<DipolarDirectSum> : std::true_type {};
79#endif // DIPOLE_FIELD_TRACKING
80
81} // namespace traits
82} // namespace Dipoles
83
84#endif // DIPOLES
This file contains the defaults for ESPResSo.
P3M algorithm for long-range magnetic dipole-dipole interaction.
std::is_convertible< std::shared_ptr< T >, MagnetostaticsActor > is_solver
Whether an actor is a solver.
Definition dipoles.hpp:73
std::variant< std::shared_ptr< DipolarDirectSum >, std::shared_ptr< DipolarDirectSumGpu >, std::shared_ptr< DipolarBarnesHutGpu >, std::shared_ptr< DipolarP3M >, std::shared_ptr< DipolarScafacos >, std::shared_ptr< DipolarLayerCorrection > > MagnetostaticsActor
Definition dipoles.hpp:61
Dipolar all with all and no replica.
std::optional< MagnetostaticsActor > solver
Main electrostatics solver.
Definition dipoles.hpp:65
The dipolar method supports dipole fields calculation.
Definition dipoles.hpp:76