29#include "system/System.hpp"
48static auto is_solver_set(std::unique_ptr<Solver::Implementation>
const &ptr) {
49 return ptr !=
nullptr and ptr->solver.has_value();
52static void check_solver(std::unique_ptr<Solver::Implementation>
const &ptr) {
64 std::visit([](
auto &ptr) {
return ptr->is_ready_for_propagation(); },
70 std::visit([](
auto &ptr) { ptr->propagate(); }, *impl->solver);
76 std::visit([&](
auto &ptr) { ptr->sanity_checks(system); }, *impl->solver);
82 std::visit([=](
auto &ptr) { ptr->veto_time_step(time_step); },
89 std::visit([=](
auto &ptr) { ptr->veto_kT(kT); }, *impl->solver);
95 std::visit([](
auto const &ptr) { ptr->veto_boxl_change(); }, *impl->solver);
101 auto &solver = *impl->solver;
102 std::visit([](
auto &ptr) { ptr->on_cell_structure_change(); }, solver);
108 std::visit([](
auto &ptr) { ptr->on_boxl_change(); }, *impl->solver);
114 std::visit([](
auto &ptr) { ptr->on_node_grid_change(); }, *impl->solver);
120 std::visit([](
auto &ptr) { ptr->on_timestep_change(); }, *impl->solver);
126 std::visit([](
auto &ptr) { ptr->on_temperature_change(); }, *impl->solver);
132 return std::visit([](
auto &ptr) {
return ptr->get_tau(); }, *impl->solver);
135template <>
void Solver::set<EKNone>(std::shared_ptr<EKNone> ek_instance) {
137 assert(not impl->solver.has_value());
138 impl->solver = ek_instance;
143void Solver::set<EKWalberla>(std::shared_ptr<EKWalberla> ek_instance) {
145 assert(not impl->solver.has_value());
147 ek_instance->sanity_checks(system);
148 impl->solver = ek_instance;
Vector implementation and trait types for boost qvm interoperability.
This file contains the defaults for ESPResSo.
static auto is_solver_set(std::unique_ptr< Solver::Implementation > const &ptr)
static void check_solver(std::unique_ptr< Solver::Implementation > const &ptr)
void veto_time_step(double time_step) const
Check if a MD time step is compatible with the EK tau.
void on_node_grid_change()
void propagate()
Propagate the EK species.
void sanity_checks() const
Perform EK parameter checks.
void on_cell_structure_change()
void veto_boxl_change() const
bool is_ready_for_propagation() const
Return true if an EK solver can be propagated.
double get_tau() const
Get the EK time step.
void on_timestep_change()
void on_temperature_change()
void veto_kT(double kT) const
Check if a thermostat is compatible with the EK temperature.
void reset()
Remove the EK solver.
bool is_solver_set() const
Return true if an EK solver is active.