27#include "communication.hpp"
30#include "system/System.hpp"
31#include "thermostat.hpp"
50 return lb_fluid->get_pressure_tensor();
66 unsigned int shear_plane_normal)
const {
67 lb_fluid->check_lebc(shear_direction, shear_plane_normal);
70std::optional<Utils::Vector3d>
72 bool consider_points_in_halo)
const {
73 return lb_fluid->get_velocity_at_pos(pos, consider_points_in_halo);
78 bool consider_points_in_halo)
const {
79 return lb_fluid->get_density_at_pos(pos, consider_points_in_halo);
88 return lb_fluid->add_force_at_pos(pos, force);
92 std::vector<Utils::Vector3d>
const &forces) {
93 lb_fluid->add_forces_at_pos(pos, forces);
96std::vector<Utils::Vector3d>
98 return lb_fluid->get_velocities_at_pos(pos);
106 auto const energy_conversion =
108 auto const lb_kT =
lb_fluid->get_kT() * energy_conversion;
109 if (not ::Thermostat::are_kT_equal(lb_kT, kT)) {
110 throw std::runtime_error(
"Temperature change not supported by LB");
115 auto const agrid =
lb_params->get_agrid();
116 auto [lb_left, lb_right] =
lb_fluid->get_lattice().get_local_domain();
119 auto const &md_left = system.
local_geo->my_left();
120 auto const &md_right = system.
local_geo->my_right();
131 auto const energy_conversion =
133 auto const kT =
lb_fluid->get_kT() * energy_conversion;
134 auto const seed =
lb_fluid->get_seed();
142 auto le_protocol = system.lees_edwards->get_protocol();
144 not std::holds_alternative<LeesEdwards::Off>(*le_protocol)) {
146 throw std::runtime_error(
147 "Lees-Edwards LB doesn't support thermalization");
149 auto const &le_bc = system.box_geo->lees_edwards_bc();
150 auto lees_edwards_object = std::make_unique<LeesEdwardsPack>(
151 le_bc.shear_direction, le_bc.shear_plane_normal,
152 [&
params, le_protocol, &system]() {
153 return get_pos_offset(system.get_sim_time(), *le_protocol) /
156 [&
params, le_protocol, &system]() {
157 return get_shear_velocity(system.get_sim_time(), *le_protocol) *
158 (params.get_tau() / params.get_agrid());
LBWalberlaBase provides the public interface of the LB waLBerla bridge.
Vector implementation and trait types for boost qvm interoperability.
Interface of a lattice-based fluid model.
virtual void set_collision_model(double kT, unsigned int seed)=0
Configure the default collision model.
virtual void ghost_communication()=0
Perform a full ghost communication.
auto get_time_step() const
Get time_step.
std::shared_ptr< LocalBox > local_geo
This file contains the defaults for ESPResSo.
This file contains the errorhandling code for severe errors, like a broken bond or illegal parameter ...
void walberla_agrid_sanity_checks(std::string method, Utils::Vector3d const &geo_left, Utils::Vector3d const &geo_right, Utils::Vector3d const &lattice_left, Utils::Vector3d const &lattice_right, double agrid)
void walberla_tau_sanity_checks(std::string method, double tau, double time_step)
Molecular dynamics integrator.
static SteepestDescentParameters params
Currently active steepest descent instance.
void update_collision_model()
Utils::Vector3d get_momentum() const
std::shared_ptr< LBWalberlaBase > lb_fluid
Utils::VectorXd< 9 > get_pressure_tensor() const
void ghost_communication_vel()
std::optional< Utils::Vector3d > get_velocity_at_pos(Utils::Vector3d const &pos, bool consider_points_in_halo) const
void veto_time_step(double time_step) const
void add_forces_at_pos(std::vector< Utils::Vector3d > const &pos, std::vector< Utils::Vector3d > const &forces)
void veto_kT(double kT) const
std::optional< double > get_density_at_pos(Utils::Vector3d const &pos, bool consider_points_in_halo) const
std::shared_ptr< LBWalberlaParams > lb_params
std::vector< Utils::Vector3d > get_velocities_at_pos(std::vector< Utils::Vector3d > const &pos)
void ghost_communication()
void ghost_communication_pdf()
void sanity_checks(System::System const &system) const
void lebc_sanity_checks(unsigned int shear_direction, unsigned int shear_plane_normal) const
bool add_force_at_pos(Utils::Vector3d const &pos, Utils::Vector3d const &force)
void on_lees_edwards_change()