diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-08-14 23:50:16 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-08-14 23:50:16 +0200 |
| commit | 9fd7e4fe2e0990b8bc75115999b06fd8b540b97e (patch) | |
| tree | 42074c9e5efbd37acde82ce6c02f3e8bbfde501a /examples | |
| parent | c634aac438972b7bafb5fbbeba7962d174cc0d03 (diff) | |
| download | libs-lbm-9fd7e4fe2e0990b8bc75115999b06fd8b540b97e.tar.gz | |
Examples
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/schaefer_turek_durst_krause_rannbacher/init.hpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/examples/schaefer_turek_durst_krause_rannbacher/init.hpp b/examples/schaefer_turek_durst_krause_rannbacher/init.hpp index b0e4020..2124bcc 100644 --- a/examples/schaefer_turek_durst_krause_rannbacher/init.hpp +++ b/examples/schaefer_turek_durst_krause_rannbacher/init.hpp @@ -92,25 +92,6 @@ saw::error_or<void> init( df_f.get_dims(), {{1u,1u}} ); - - iterator<Desc::D>::apply( - [&](auto& index){ - saw::data<sch::Vector<T,Desc::D>> middle, ind_vec; - middle.at({{0u}}) = dim_x * 0.25; - middle.at({{1u}}) = dim_y * 0.5; - - ind_vec.at({{0u}}) = index.at({{0u}}).template cast_to<T>(); - ind_vec.at({{1u}}) = index.at({{1u}}).template cast_to<T>(); - - auto dist = middle - ind_vec; - auto dist_2 = saw::math::dot(dist,dist); - if(dist_2.at({}).get() < dim_y*dim_y*0.01){ - porous_f.at(index).at({}) = 0.0; - } - }, - {},// 0-index - df_f.get_dims() - ); { saw::data<sch::Scalar<T>> radius_p; @@ -118,6 +99,18 @@ saw::error_or<void> init( saw::data<sch::Scalar<T>> dense_p; dense_p.at({}).set(1); particles = create_spheroid_particle_group<T,Desc::D,1u>(radius_p, dense_p, {{16u}}); + auto& parts = particles.template get<"particles">(); + + { + auto& p = parts.at({0u}); + auto& prb = p.template get<"rigid_body">(); + auto& p_pos = prb.template get<"position">(); + auto& p_posold = prb.template get<"position_old">(); + p_pos.at({0u}) = conv.meter_si_to_lbm({{0.16}}).handle(); + p_pos.at({1u}) = conv.meter_si_to_lbm({{0.2}}).handle(); + + p_posold = p_pos; + } } return saw::make_void(); |
