32#include "communication.hpp"
34#include "system/System.hpp"
47 impl = std::make_unique<Implementation>();
55 std::visit([](
auto &ptr) { ptr->sanity_checks(); }, *
impl->solver);
74 std::visit([](
auto &ptr) { ptr->on_node_grid_change(); }, *
impl->solver);
95 if (
auto dp3m = get_actor_by_type<DipolarP3M>(
impl->solver)) {
96 return dp3m->dp3m.params.r_cut;
107 if (
auto dp3m = get_actor_by_type<DipolarP3M>(
impl->solver)) {
108 dp3m->count_magnetic_particles();
122 void operator()(std::shared_ptr<DipolarP3M>
const &actor)
const {
126 void operator()(std::shared_ptr<DipolarLayerCorrection>
const &actor)
const {
128 std::visit(*
this, actor->base_solver);
130 void operator()(std::shared_ptr<DipolarDirectSum>
const &actor)
const {
133#ifdef DIPOLAR_DIRECT_SUM
134 void operator()(std::shared_ptr<DipolarDirectSumGpu>
const &actor)
const {
135 actor->add_long_range_forces();
138#ifdef DIPOLAR_BARNES_HUT
139 void operator()(std::shared_ptr<DipolarBarnesHutGpu>
const &actor)
const {
140 actor->add_long_range_forces();
143#ifdef SCAFACOS_DIPOLES
144 void operator()(std::shared_ptr<DipolarScafacos>
const &actor)
const {
145 actor->add_long_range_forces();
156 double operator()(std::shared_ptr<DipolarP3M>
const &actor)
const {
161 operator()(std::shared_ptr<DipolarLayerCorrection>
const &actor)
const {
162 auto energy = std::visit(*
this, actor->base_solver);
163 return energy + actor->energy_correction(
m_particles);
165 double operator()(std::shared_ptr<DipolarDirectSum>
const &actor)
const {
168#ifdef DIPOLAR_DIRECT_SUM
169 double operator()(std::shared_ptr<DipolarDirectSumGpu>
const &actor)
const {
170 actor->long_range_energy();
174#ifdef DIPOLAR_BARNES_HUT
175 double operator()(std::shared_ptr<DipolarBarnesHutGpu>
const &actor)
const {
176 actor->long_range_energy();
180#ifdef SCAFACOS_DIPOLES
181 double operator()(std::shared_ptr<DipolarScafacos>
const &actor)
const {
182 return actor->long_range_energy();
187#ifdef DIPOLE_FIELD_TRACKING
193 void operator()(std::shared_ptr<DipolarDirectSum>
const &actor)
const {
197 template <
typename T,
198 std::enable_if_t<!traits::has_dipole_fields<T>::value> * =
nullptr>
201 <<
"dipolar method " << Utils::demangle<T>();
225#ifdef DIPOLE_FIELD_TRACKING
Vector implementation and trait types for boost qvm interoperability.
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< DipolarBarnesHutGpu > const &actor) const
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 operator()(std::shared_ptr< DipolarBarnesHutGpu > const &actor) const
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.