ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
magnetostatics/solver.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#include "actor/optional.hpp"
25#include "actor/traits.hpp"
26
27#include "Particle.hpp"
28
29#include <utils/Vector.hpp>
30
31#include <functional>
32#include <memory>
33#include <optional>
34#include <type_traits>
35
36namespace Dipoles {
37
38struct Solver {
39#ifdef ESPRESSO_DIPOLES
40 struct Implementation;
41 /// @brief Pointer-to-implementation.
42 std::unique_ptr<Implementation> impl;
43 /// @brief Whether to reinitialize the solver on observable calculation.
45
46 void sanity_checks() const;
47 double cutoff() const;
48
49 void on_observable_calc();
50 void on_dipoles_change();
51 void on_boxl_change();
56
57 void calc_pressure_long_range() const;
58 void calc_long_range_force() const;
59 double calc_energy_long_range() const;
60 Solver();
61#else // ESPRESSO_DIPOLES
62 Solver() = default;
63 constexpr double cutoff() const { return inactive_cutoff; }
64#endif // ESPRESSO_DIPOLES
65
66 using ShortRangeForceKernel = std::function<ParticleForce(
67 double, Utils::Vector3d const &, Utils::Vector3d const &,
68 Utils::Vector3d const &, double, double)>;
70 std::function<double(Particle const &, Particle const &,
71 Utils::Vector3d const &, double, double)>;
72
73 inline std::optional<ShortRangeForceKernel> pair_force_kernel() const;
74 inline std::optional<ShortRangeEnergyKernel> pair_energy_kernel() const;
75};
76
77} // namespace Dipoles
Vector implementation and trait types for boost qvm interoperability.
constexpr double inactive_cutoff
Special cutoff value for an inactive interaction.
Definition config.hpp:44
void sanity_checks() const
Definition dipoles.cpp:46
std::function< ParticleForce(double, Utils::Vector3d const &, Utils::Vector3d const &, Utils::Vector3d const &, double, double)> ShortRangeForceKernel
std::optional< ShortRangeForceKernel > pair_force_kernel() const
double cutoff() const
Definition dipoles.cpp:85
void on_cell_structure_change()
Definition dipoles.cpp:78
std::unique_ptr< Implementation > impl
Pointer-to-implementation.
void on_boxl_change()
Definition dipoles.cpp:59
void on_periodicity_change()
Definition dipoles.cpp:71
void calc_pressure_long_range() const
Definition dipoles.cpp:123
bool reinit_on_observable_calc
Whether to reinitialize the solver on observable calculation.
void on_observable_calc()
Definition dipoles.cpp:96
std::function< double(Particle const &, Particle const &, Utils::Vector3d const &, double, double)> ShortRangeEnergyKernel
void calc_long_range_force() const
Definition dipoles.cpp:129
void on_dipoles_change()
Definition dipoles.cpp:52
std::optional< ShortRangeEnergyKernel > pair_energy_kernel() const
void on_node_grid_change()
Definition dipoles.cpp:65
double calc_energy_long_range() const
Definition dipoles.cpp:135
Force information on a particle.
Definition Particle.hpp:345
Struct holding all information for one particle.
Definition Particle.hpp:450