26#ifdef ESPRESSO_DIPOLES
81 std::shared_ptr<DipolarP3M>,
83 std::shared_ptr<DipolarDirectSum>>;
100 [
this](
auto &solver) { solver->bind_system(
m_system.lock()); });
101 sanity_checks_periodicity();
107 visit_base_solver([](
auto &solver) { solver->on_activation(); });
113 visit_base_solver([](
auto &actor) { actor->on_boxl_change(); });
116 visit_base_solver([](
auto &solver) { solver->on_node_grid_change(); });
119 sanity_checks_periodicity();
120 visit_base_solver([](
auto &solver) { solver->on_periodicity_change(); });
123 visit_base_solver([](
auto &solver) { solver->on_cell_structure_change(); });
128 visit_base_solver([](
auto &solver) { solver->init(); });
132 sanity_checks_periodicity();
133 visit_base_solver([](
auto &actor) { actor->sanity_checks(); });
162 void check_gap(
Particle const &p)
const;
163 double tune_far_cut()
const;
165 void sanity_checks_periodicity()
const;
167 template <
class Visitor>
void visit_base_solver(Visitor &&visitor)
const {
std::weak_ptr< System > m_system
P3M algorithm for long-range magnetic dipole-dipole interaction.
Adapt a magnetostatics solver to remove contributions from the z-direction.
double epsilon_correction
void add_force_corrections() const
Add the dipolar force and torque corrections.
void sanity_checks() const
BaseSolver base_solver
Magnetostatics solver that is adapted.
void on_node_grid_change() const
void on_periodicity_change() const
double energy_correction() const
Calculate the dipolar energy correction.
std::variant< std::shared_ptr< DipolarP3M >, std::shared_ptr< DipolarDirectSum > > BaseSolver
void add_long_range_forces() const
Accumulate long-range dipolar forces with corrections.
void on_cell_structure_change() const
void on_boxl_change()
Recalculate all box-length-dependent parameters.
double long_range_energy() const
Calculate long-range dipolar energy with corrections.
Struct holding all information for one particle.
Parameters for the DLC method.
bool far_calculated
Flag whether far_cut was set by the user, or calculated by ESPResSo.
double maxPWerror
maximal pairwise error of the potential and force
double far_cut
Cutoff of the exponential sum.
double gap_size
Size of the empty gap.
double box_h
Up to where particles can be found.
Whether an actor is a layer correction method.