32#include "communication.hpp"
34#include "system/System.hpp"
45 impl = std::make_unique<Implementation>();
53 std::visit([](
auto &ptr) { ptr->sanity_checks(); }, *
impl->solver);
72 std::visit([](
auto &ptr) { ptr->on_node_grid_change(); }, *
impl->solver);
93 if (
auto dp3m = get_actor_by_type<DipolarP3M>(
impl->solver)) {
94 return dp3m->dp3m_params.r_cut;
105 if (
auto dp3m = get_actor_by_type<DipolarP3M>(
impl->solver)) {
106 dp3m->count_magnetic_particles();
120 void operator()(std::shared_ptr<DipolarP3M>
const &actor)
const {
124 void operator()(std::shared_ptr<DipolarLayerCorrection>
const &actor)
const {
126 std::visit(*
this, actor->base_solver);
128 void operator()(std::shared_ptr<DipolarDirectSum>
const &actor)
const {
131#ifdef DIPOLAR_DIRECT_SUM
132 void operator()(std::shared_ptr<DipolarDirectSumGpu>
const &actor)
const {
133 actor->add_long_range_forces();
136#ifdef SCAFACOS_DIPOLES
137 void operator()(std::shared_ptr<DipolarScafacos>
const &actor)
const {
138 actor->add_long_range_forces();
149 double operator()(std::shared_ptr<DipolarP3M>
const &actor)
const {
154 operator()(std::shared_ptr<DipolarLayerCorrection>
const &actor)
const {
155 auto energy = std::visit(*
this, actor->base_solver);
156 return energy + actor->energy_correction(
m_particles);
158 double operator()(std::shared_ptr<DipolarDirectSum>
const &actor)
const {
161#ifdef DIPOLAR_DIRECT_SUM
162 double operator()(std::shared_ptr<DipolarDirectSumGpu>
const &actor)
const {
163 actor->long_range_energy();
167#ifdef SCAFACOS_DIPOLES
168 double operator()(std::shared_ptr<DipolarScafacos>
const &actor)
const {
169 return actor->long_range_energy();
174#ifdef DIPOLE_FIELD_TRACKING
180 void operator()(std::shared_ptr<DipolarDirectSum>
const &actor)
const {
184 template <
typename T,
185 std::enable_if_t<!traits::has_dipole_fields<T>::value> * =
nullptr>
188 <<
"dipolar method " << Utils::demangle<T>();
212#ifdef DIPOLE_FIELD_TRACKING
This file contains the defaults for ESPResSo.
This file contains the errorhandling code for severe errors, like a broken bond or illegal parameter ...
#define runtimeWarningMsg()
#define runtimeErrorMsg()
Solver const & get_dipoles()
double operator()(std::shared_ptr< DipolarLayerCorrection > const &actor) const
ParticleRange const & m_particles
double operator()(std::shared_ptr< DipolarDirectSumGpu > const &actor) const
double operator()(std::shared_ptr< DipolarDirectSum > const &actor) const
LongRangeEnergy(ParticleRange const &particles)
double operator()(std::shared_ptr< DipolarScafacos > const &actor) const
double operator()(std::shared_ptr< DipolarP3M > const &actor) const
LongRangeField(ParticleRange const &particles)
ParticleRange const & m_particles
void operator()(std::shared_ptr< DipolarDirectSum > const &actor) const
void operator()(std::shared_ptr< T > const &) const
void operator()(std::shared_ptr< DipolarDirectSum > const &actor) const
void operator()(std::shared_ptr< DipolarScafacos > const &actor) const
void operator()(std::shared_ptr< DipolarDirectSumGpu > const &actor) const
ParticleRange const & m_particles
void operator()(std::shared_ptr< DipolarLayerCorrection > const &actor) const
void operator()(std::shared_ptr< DipolarP3M > const &actor) const
LongRangeForce(ParticleRange const &particles)
void sanity_checks() const
void on_cell_structure_change()
void calc_long_range_field(ParticleRange const &particles) const
std::unique_ptr< Implementation > impl
Pointer-to-implementation.
void calc_long_range_force(ParticleRange const &particles) const
double calc_energy_long_range(ParticleRange const &particles) const
void on_periodicity_change()
void calc_pressure_long_range() const
bool reinit_on_observable_calc
Whether to reinitialize the solver on observable calculation.
void on_observable_calc()
void on_node_grid_change()
void visit_try_catch(Visitor &&visitor, Variant &actor)
Run a kernel on a variant and queue errors.