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
#include "
ParticleRange.hpp
"
29
30
#include <
utils/Vector.hpp
>
31
32
#include <functional>
33
#include <memory>
34
#include <optional>
35
#include <type_traits>
36
37
namespace
Dipoles
{
38
39
struct
Solver
{
40
#ifdef ESPRESSO_DIPOLES
41
struct
Implementation
;
42
/// @brief Pointer-to-implementation.
43
std::unique_ptr<Implementation>
impl
;
44
/// @brief Whether to reinitialize the solver on observable calculation.
45
bool
reinit_on_observable_calc
;
46
47
void
sanity_checks
()
const
;
48
double
cutoff
()
const
;
49
50
void
on_observable_calc
();
51
void
on_dipoles_change
();
52
void
on_boxl_change
();
53
void
on_node_grid_change
();
54
void
on_periodicity_change
();
55
void
on_cell_structure_change
();
56
void
on_particle_change
() {
reinit_on_observable_calc
=
true
; }
57
58
void
calc_pressure_long_range
()
const
;
59
void
calc_long_range_force
(
ParticleRange
const
&particles)
const
;
60
double
calc_energy_long_range
(
ParticleRange
const
&particles)
const
;
61
#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
62
void
calc_long_range_field
(
ParticleRange
const
&particles)
const
;
63
#endif
64
Solver
();
65
#else
// ESPRESSO_DIPOLES
66
Solver
() =
default
;
67
constexpr
double
cutoff
()
const
{
return
inactive_cutoff
; }
68
#endif
// ESPRESSO_DIPOLES
69
70
using
ShortRangeForceKernel
= std::function<
ParticleForce
(
71
double
,
Utils::Vector3d
const
&,
Utils::Vector3d
const
&,
72
Utils::Vector3d
const
&,
double
,
double
)>;
73
using
ShortRangeEnergyKernel
=
74
std::function<double(
Particle
const
&,
Particle
const
&,
75
Utils::Vector3d
const
&,
double
,
double
)>;
76
77
inline
std::optional<ShortRangeForceKernel>
pair_force_kernel
()
const
;
78
inline
std::optional<ShortRangeEnergyKernel>
pair_energy_kernel
()
const
;
79
};
80
81
#ifdef ESPRESSO_DIPOLES
82
Solver
const
&
get_dipoles
();
83
#endif
84
85
}
// namespace Dipoles
ParticleRange.hpp
Particle.hpp
Vector.hpp
Vector implementation and trait types for boost qvm interoperability.
ParticleRange
A range of particles.
Definition
ParticleRange.hpp:38
Utils::Vector
Definition
Vector.hpp:50
config.hpp
inactive_cutoff
constexpr double inactive_cutoff
Special cutoff value for an inactive interaction.
Definition
config.hpp:44
optional.hpp
Dipoles
Definition
magnetostatics/actor.hpp:30
Dipoles::get_dipoles
Solver const & get_dipoles()
Definition
dipoles.cpp:49
Dipoles::Solver::Implementation
Definition
dipoles.hpp:59
Dipoles::Solver
Definition
magnetostatics/solver.hpp:39
Dipoles::Solver::sanity_checks
void sanity_checks() const
Definition
dipoles.cpp:51
Dipoles::Solver::ShortRangeForceKernel
std::function< ParticleForce(double, Utils::Vector3d const &, Utils::Vector3d const &, Utils::Vector3d const &, double, double)> ShortRangeForceKernel
Definition
magnetostatics/solver.hpp:72
Dipoles::Solver::pair_force_kernel
std::optional< ShortRangeForceKernel > pair_force_kernel() const
Definition
dipoles_inline.hpp:101
Dipoles::Solver::cutoff
double cutoff() const
Definition
dipoles.cpp:90
Dipoles::Solver::on_cell_structure_change
void on_cell_structure_change()
Definition
dipoles.cpp:83
Dipoles::Solver::on_particle_change
void on_particle_change()
Definition
magnetostatics/solver.hpp:56
Dipoles::Solver::calc_long_range_field
void calc_long_range_field(ParticleRange const &particles) const
Dipoles::Solver::impl
std::unique_ptr< Implementation > impl
Pointer-to-implementation.
Definition
magnetostatics/solver.hpp:43
Dipoles::Solver::calc_long_range_force
void calc_long_range_force(ParticleRange const &particles) const
Definition
dipoles.cpp:180
Dipoles::Solver::calc_energy_long_range
double calc_energy_long_range(ParticleRange const &particles) const
Definition
dipoles.cpp:186
Dipoles::Solver::on_boxl_change
void on_boxl_change()
Definition
dipoles.cpp:64
Dipoles::Solver::on_periodicity_change
void on_periodicity_change()
Definition
dipoles.cpp:76
Dipoles::Solver::calc_pressure_long_range
void calc_pressure_long_range() const
Definition
dipoles.cpp:174
Dipoles::Solver::reinit_on_observable_calc
bool reinit_on_observable_calc
Whether to reinitialize the solver on observable calculation.
Definition
magnetostatics/solver.hpp:45
Dipoles::Solver::on_observable_calc
void on_observable_calc()
Definition
dipoles.cpp:101
Dipoles::Solver::ShortRangeEnergyKernel
std::function< double(Particle const &, Particle const &, Utils::Vector3d const &, double, double)> ShortRangeEnergyKernel
Definition
magnetostatics/solver.hpp:75
Dipoles::Solver::on_dipoles_change
void on_dipoles_change()
Definition
dipoles.cpp:57
Dipoles::Solver::pair_energy_kernel
std::optional< ShortRangeEnergyKernel > pair_energy_kernel() const
Definition
dipoles_inline.hpp:112
Dipoles::Solver::on_node_grid_change
void on_node_grid_change()
Definition
dipoles.cpp:70
Dipoles::Solver::Solver
Solver()
Definition
dipoles.cpp:44
ParticleForce
Force information on a particle.
Definition
Particle.hpp:345
Particle
Struct holding all information for one particle.
Definition
Particle.hpp:450
traits.hpp
src
core
magnetostatics
solver.hpp
Generated on Sun Dec 7 2025 02:31:13 for ESPResSo by
1.9.8