![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include <Solver.hpp>
Inheritance diagram for LB::Solver:
Collaboration diagram for LB::Solver:Classes | |
| struct | Conversions |
| struct | Implementation |
Public Member Functions | |
| Solver () | |
| bool | is_solver_set () const |
| Return true if a LB solver is active. | |
| void | reset () |
| Remove the LB solver. | |
| template<typename LB , class... Args> | |
| void | set (Args... args) |
| Set the LB solver. | |
| template<class Connector > | |
| void | connect (Connector &&connector) const |
| Connector to the implementation internal state. | |
| void | propagate () |
| Propagate the LB fluid. | |
| void | ghost_communication () |
| Perform a full ghost communication. | |
| void | ghost_communication_pdf () |
| Perform a ghost communication of the PDF field. | |
| void | ghost_communication_vel () |
| Perform a ghost communication of the velocity field. | |
| void | init () const |
| Perform a full initialization of the lattice-Boltzmann system. | |
| void | sanity_checks () const |
| Perform LB parameter and boundary velocity checks. | |
| void | veto_time_step (double time_step) const |
| Check if a MD time step is compatible with the LB tau. | |
| void | veto_kT (double kT) const |
| Check if a thermostat is compatible with the LB temperature. | |
| void | lebc_sanity_checks (unsigned int shear_direction, unsigned int shear_plane_normal) const |
| Perform LB LEbc parameter checks. | |
| bool | is_gpu () const |
| double | get_tau () const |
| Get the LB time step. | |
| double | get_agrid () const |
| Get the LB grid spacing. | |
| double | get_kT () const |
| Get the thermal energy parameter of the LB fluid. | |
| auto | get_lattice_speed () const |
| Get the lattice speed (agrid/tau). | |
| Utils::VectorXd< 9 > | get_pressure_tensor () const |
| Utils::Vector3d | get_momentum () const |
| std::function< bool(Utils::Vector3d const &)> | make_lattice_position_checker (bool consider_points_in_halo) const |
| Make a functor to check if a position is in the local domain. | |
| std::optional< Utils::Vector3d > | get_interpolated_velocity (Utils::Vector3d const &pos) const |
| Calculate the interpolated fluid velocity in LB units. | |
| std::optional< double > | get_interpolated_density (Utils::Vector3d const &pos) const |
| Calculate the interpolated fluid density in LB units. | |
| std::vector< double > | get_interpolated_densities (std::vector< Utils::Vector3d > const &pos) const |
| Calculate the interpolated fluid densities in LB units. | |
| Utils::Vector3d | get_coupling_interpolated_velocity (Utils::Vector3d const &pos) const |
| Calculate the interpolated fluid velocity in MD units. | |
| std::vector< Utils::Vector3d > | get_coupling_interpolated_velocities (std::vector< Utils::Vector3d > const &pos) const |
| Calculate the interpolated fluid velocities in MD units. | |
| void | add_forces_at_pos (std::vector< Utils::Vector3d > const &pos, std::vector< Utils::Vector3d > const &forces) |
| void | add_force_density (Utils::Vector3d const &pos, Utils::Vector3d const &force_density) |
| Add a force density to the fluid at the given position. | |
| void | on_boxl_change () |
| void | on_node_grid_change () |
| void | on_cell_structure_change () |
| void | on_timestep_change () |
| void | on_temperature_change () |
| void | on_lees_edwards_change () |
| void | update_collision_model () |
| void | veto_boxl_change () const |
| template<> | |
| void | set (std::shared_ptr< LBNone > lb_instance) |
| template<> | |
| void | set (std::shared_ptr< LBWalberlaBase > lb_fluid, std::shared_ptr< LBWalberlaParams > lb_params) |
Public Member Functions inherited from System::Leaf< Solver > | |
| void | bind_system (std::shared_ptr< System > const &system) |
| void | detach_system (std::shared_ptr< System > const &system) |
Additional Inherited Members | |
Protected Member Functions inherited from System::Leaf< Solver > | |
| auto & | get_system () |
| auto & | get_system () const |
Protected Attributes inherited from System::Leaf< Solver > | |
| std::weak_ptr< System > | m_system |
Definition at line 37 of file lb/Solver.hpp.
| LB::Solver::Solver | ( | ) |
Definition at line 53 of file lb/Solver.cpp.
| void LB::Solver::add_force_density | ( | Utils::Vector3d const & | pos, |
| Utils::Vector3d const & | force_density | ||
| ) |
Add a force density to the fluid at the given position.
| pos | Position at which the force density is to be applied. |
| force_density | Force density to apply. |
Definition at line 299 of file lb/Solver.cpp.
References LB::Solver::Conversions::force_to_lb, and LB::Solver::Conversions::pos_to_lb.
Referenced by lb_tracers_add_particle_force_to_fluid().
| void LB::Solver::add_forces_at_pos | ( | std::vector< Utils::Vector3d > const & | pos, |
| std::vector< Utils::Vector3d > const & | forces | ||
| ) |
Definition at line 280 of file lb/Solver.cpp.
References LB::Solver::Conversions::force_to_lb, and LB::Solver::Conversions::pos_to_lb.
Referenced by LB::ParticleCoupling::kernel().
|
inline |
Connector to the implementation internal state.
For developers: use this mechanism to access the underlying variant.
Definition at line 63 of file lb/Solver.hpp.
Referenced by EK::EKWalberla::propagate().
| double LB::Solver::get_agrid | ( | ) | const |
Get the LB grid spacing.
Definition at line 176 of file lb/Solver.cpp.
References LB::check_solver().
Referenced by get_lattice_speed(), LB::ParticleCoupling::kernel(), lb_tracers_add_particle_force_to_fluid(), Observables::SanityChecksLB::mismatch(), and Observables::SanityChecksLB::SanityChecksLB().
| std::vector< Utils::Vector3d > LB::Solver::get_coupling_interpolated_velocities | ( | std::vector< Utils::Vector3d > const & | pos | ) | const |
Calculate the interpolated fluid velocities in MD units.
Special method used only for particle coupling. Uses the LB ghost layer. Achieved by linear interpolation (eq. 11 in [2]).
| pos | Positions in MD units at which the velocities are calculated. |
| interpolated | fluid velocities in MD units. |
Definition at line 262 of file lb/Solver.cpp.
References LB::Solver::Conversions::pos_to_lb, and LB::Solver::Conversions::vel_to_md.
Referenced by LB::ParticleCoupling::kernel().
| Utils::Vector3d LB::Solver::get_coupling_interpolated_velocity | ( | Utils::Vector3d const & | pos | ) | const |
Calculate the interpolated fluid velocity in MD units.
Special method used only for particle coupling. Uses the LB ghost layer. Achieved by linear interpolation (eq. 11 in [2]).
| pos | Position in MD units at which the velocity is calculated. |
| interpolated | fluid velocity in MD units. |
Definition at line 252 of file lb/Solver.cpp.
References LB::Solver::Conversions::pos_to_lb, and LB::Solver::Conversions::vel_to_md.
Referenced by lb_drag_force(), and lb_tracers_propagate().
| std::vector< double > LB::Solver::get_interpolated_densities | ( | std::vector< Utils::Vector3d > const & | pos | ) | const |
Calculate the interpolated fluid densities in LB units.
The LB ghost layer is used. Achieved by linear interpolation (eq. 11 in [2]).
| pos | Positions in MD units at which the velocities are calculated. |
| interpolated | fluid densities in LB units. |
Definition at line 235 of file lb/Solver.cpp.
References System::System::box_geo, System::get_system(), and LB::Solver::Conversions::pos_to_lb.
| std::optional< double > LB::Solver::get_interpolated_density | ( | Utils::Vector3d const & | pos | ) | const |
Calculate the interpolated fluid density in LB units.
Use this function in MPI-parallel code. The LB ghost layer is ignored.
| pos | Position in MD units at which the density is calculated. |
| interpolated | fluid density in LB units. |
Definition at line 225 of file lb/Solver.cpp.
References System::System::box_geo, System::get_system(), and LB::Solver::Conversions::pos_to_lb.
| std::optional< Utils::Vector3d > LB::Solver::get_interpolated_velocity | ( | Utils::Vector3d const & | pos | ) | const |
Calculate the interpolated fluid velocity in LB units.
Use this function in MPI-parallel code. The LB ghost layer is ignored.
| pos | Position in MD units at which the velocity is calculated. |
| interpolated | fluid velocity in LB units. |
Definition at line 211 of file lb/Solver.cpp.
References System::System::box_geo, System::get_system(), and LB::Solver::Conversions::pos_to_lb.
| double LB::Solver::get_kT | ( | ) | const |
Get the thermal energy parameter of the LB fluid.
Definition at line 186 of file lb/Solver.cpp.
References LB::check_solver().
Referenced by LB::ParticleCoupling::ParticleCoupling().
|
inline |
Get the lattice speed (agrid/tau).
Definition at line 135 of file lb/Solver.hpp.
References get_agrid(), and get_tau().
Referenced by calc_linear_momentum(), and LB::ParticleCoupling::ParticleCoupling().
| Utils::Vector3d LB::Solver::get_momentum | ( | ) | const |
Definition at line 311 of file lb/Solver.cpp.
References LB::check_solver().
Referenced by calc_linear_momentum().
| Utils::VectorXd< 9 > LB::Solver::get_pressure_tensor | ( | ) | const |
Definition at line 191 of file lb/Solver.cpp.
References LB::check_solver().
Referenced by Observables::LBFluidPressureTensor::operator()().
| double LB::Solver::get_tau | ( | ) | const |
Get the LB time step.
Definition at line 181 of file lb/Solver.cpp.
References LB::check_solver().
Referenced by get_lattice_speed(), and LB::ParticleCoupling::ParticleCoupling().
| void LB::Solver::ghost_communication | ( | ) |
Perform a full ghost communication.
Definition at line 77 of file lb/Solver.cpp.
References LB::check_solver().
| void LB::Solver::ghost_communication_pdf | ( | ) |
Perform a ghost communication of the PDF field.
Definition at line 82 of file lb/Solver.cpp.
References LB::check_solver().
| void LB::Solver::ghost_communication_vel | ( | ) |
Perform a ghost communication of the velocity field.
Definition at line 87 of file lb/Solver.cpp.
References LB::check_solver().
|
inline |
Perform a full initialization of the lattice-Boltzmann system.
All derived parameters and the fluid are reset to their default values.
Definition at line 92 of file lb/Solver.hpp.
| bool LB::Solver::is_gpu | ( | ) | const |
Definition at line 171 of file lb/Solver.cpp.
References LB::check_solver().
| bool LB::Solver::is_solver_set | ( | ) | const |
Return true if a LB solver is active.
Definition at line 65 of file lb/Solver.cpp.
References LB::is_solver_set().
Referenced by calc_linear_momentum(), and lb_sanity_checks().
| void LB::Solver::lebc_sanity_checks | ( | unsigned int | shear_direction, |
| unsigned int | shear_plane_normal | ||
| ) | const |
Perform LB LEbc parameter checks.
Definition at line 112 of file lb/Solver.cpp.
| std::function< bool(Utils::Vector3d const &)> LB::Solver::make_lattice_position_checker | ( | bool | consider_points_in_halo | ) | const |
Make a functor to check if a position is in the local domain.
Definition at line 198 of file lb/Solver.cpp.
References System::System::box_geo, System::get_system(), and LB::Solver::Conversions::pos_to_lb.
| void LB::Solver::on_boxl_change | ( | ) |
Definition at line 135 of file lb/Solver.cpp.
| void LB::Solver::on_cell_structure_change | ( | ) |
Definition at line 122 of file lb/Solver.cpp.
| void LB::Solver::on_lees_edwards_change | ( | ) |
Definition at line 159 of file lb/Solver.cpp.
| void LB::Solver::on_node_grid_change | ( | ) |
Definition at line 141 of file lb/Solver.cpp.
| void LB::Solver::on_temperature_change | ( | ) |
Definition at line 153 of file lb/Solver.cpp.
| void LB::Solver::on_timestep_change | ( | ) |
Definition at line 147 of file lb/Solver.cpp.
| void LB::Solver::propagate | ( | ) |
| void LB::Solver::reset | ( | ) |
Remove the LB solver.
Definition at line 67 of file lb/Solver.cpp.
References System::get_system(), and System::System::lb.
Referenced by ScriptInterface::walberla::LBFluid::do_call_method().
| void LB::Solver::sanity_checks | ( | ) | const |
Perform LB parameter and boundary velocity checks.
Definition at line 92 of file lb/Solver.cpp.
References System::Leaf< Solver >::get_system().
| void LB::Solver::set | ( | Args... | args | ) |
Set the LB solver.
For developers: a specialization must exist for every new LB type.
Referenced by ScriptInterface::walberla::LBFluid::do_call_method().
| void LB::Solver::set | ( | std::shared_ptr< LBNone > | lb_instance | ) |
Definition at line 317 of file lb/Solver.cpp.
| void LB::Solver::set | ( | std::shared_ptr< LBWalberlaBase > | lb_fluid, |
| std::shared_ptr< LBWalberlaParams > | lb_params | ||
| ) |
Definition at line 325 of file lb/Solver.cpp.
References System::Leaf< Solver >::get_system().
| void LB::Solver::update_collision_model | ( | ) |
Definition at line 165 of file lb/Solver.cpp.
| void LB::Solver::veto_boxl_change | ( | ) | const |
Definition at line 129 of file lb/Solver.cpp.
| void LB::Solver::veto_kT | ( | double | kT | ) | const |
Check if a thermostat is compatible with the LB temperature.
Definition at line 106 of file lb/Solver.cpp.
| void LB::Solver::veto_time_step | ( | double | time_step | ) | const |
Check if a MD time step is compatible with the LB tau.
Definition at line 99 of file lb/Solver.cpp.