57 double kT,
unsigned int seed) {
58 auto const omega = shear_mode_relaxation_rate();
59 auto const omega_odd = odd_mode_relaxation_rate(omega);
60 auto const blocks = get_lattice().get_blocks();
61 m_kT = FloatType_c(kT);
64 m_last_applied_force_field_id, m_pdf_field_id, zero_centered_to_lb(m_kT),
65 omega, omega, omega_odd, omega, seed,
uint32_t{0
u});
66 m_collision_model = std::make_shared<CollisionModel>(std::move(
obj));
67 m_run_stream_collide_sweep = StreamCollideSweepVisitor(
blocks);
68 setup_streaming_communicator();
83#if defined(__CUDACC__) and defined(WALBERLA_BUILD_WITH_CUDA)
85 throw std::runtime_error(
"Lees-Edwards LB doesn't support GPU yet");
91 auto const omega = shear_mode_relaxation_rate();
92 auto const omega_odd = odd_mode_relaxation_rate(omega);
93 if (shear_plane_normal != 1u) {
94 throw std::domain_error(
95 "Lees-Edwards LB only supports shear_plane_normal=\"y\"");
97 auto const &lattice = get_lattice();
99 auto const blocks = lattice.get_blocks();
100 if (lattice.get_node_grid()[shear_direction] != 1
or
101 blocks->getSize(shear_direction) != 1ul
or
102 blocks->getSize(shear_plane_normal) !=
103 lattice.get_node_grid()[shear_plane_normal]) {
104 throw std::domain_error(
"LB LEbc doesn't support domain decomposition "
105 "along the shear direction, nor multiple blocks "
106 "along the normal direction");
109 auto const block_origin = lattice.get_local_grid_range(
false).first;
114 m_collision_model = std::make_shared<CollisionModel>(
116 m_last_applied_force_field_id, m_pdf_field_id, lebc_bot_index,
117 lebc_top_index, omega, omega, omega_odd, omega,
shear_vel));
119 m_run_stream_collide_sweep =
120 StreamCollideSweepVisitor(
blocks, m_lees_edwards_callbacks);
121 m_lees_edwards_pdf_interpol_sweep =
122 std::make_shared<InterpolateAndShiftAtBoundary<_PdfField, FloatType>>(
124 shear_direction, shear_plane_normal,
125 m_lees_edwards_callbacks->get_pos_offset);
126 m_lees_edwards_vel_interpol_sweep =
127 std::make_shared<InterpolateAndShiftAtBoundary<_VectorField, FloatType>>(
129 shear_direction, shear_plane_normal,
130 m_lees_edwards_callbacks->get_pos_offset,
131 m_lees_edwards_callbacks->get_shear_velocity);
132 m_lees_edwards_last_applied_force_interpol_sweep =
133 std::make_shared<InterpolateAndShiftAtBoundary<_VectorField, FloatType>>(
134 blocks, m_last_applied_force_field_id, m_vel_tmp_field_id,
136 m_lees_edwards_callbacks->get_pos_offset);
137 setup_streaming_communicator();