21#ifdef ESPRESSO_WALBERLA
27#include "communication.hpp"
30#include "system/System.hpp"
31#include "thermostat.hpp"
54 return lb_fluid->get_pressure_tensor();
70 unsigned int shear_plane_normal)
const {
71 lb_fluid->check_lebc(shear_direction, shear_plane_normal);
79std::optional<Utils::Vector3d>
97 return lb_fluid->add_force_at_pos(pos, force);
101 std::vector<Utils::Vector3d>
const &forces) {
102 lb_fluid->add_forces_at_pos(pos, forces);
107 return lb_fluid->get_densities_at_pos(pos);
110std::vector<Utils::Vector3d>
112 return lb_fluid->get_velocities_at_pos(pos);
124 throw std::runtime_error(
"Temperature change not supported by LB");
146 auto const seed =
lb_fluid->get_seed();
158 throw std::runtime_error(
159 "Lees-Edwards LB doesn't support thermalization");
161 auto const &
le_bc =
system.box_geo->lees_edwards_bc();
163 le_bc.shear_direction,
le_bc.shear_plane_normal,
165 return get_pos_offset(system.get_sim_time(), *le_protocol) /
169 return get_shear_velocity(system.get_sim_time(), *le_protocol) *
170 (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.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
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.
bool are_kT_equal(double old_kT, double new_kT)
Check that two kT values are close up to a small tolerance.
void update_collision_model()
std::vector< double > get_densities_at_pos(std::vector< Utils::Vector3d > const &pos)
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)
std::function< bool(Utils::Vector3d const &)> make_lattice_position_checker(bool consider_points_in_halo) const
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()