diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-09-25 19:40:33 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-09-25 19:40:33 +0200 |
| commit | 95b74577fe5c75e3e8497dc16241b7e6b8d30408 (patch) | |
| tree | 444455743b3576d327295a1d4bb796948a35fab9 /examples/throat_clog_2d/init.hpp | |
| parent | 01a24574ebbe3d37feb95b94c06d573639c80704 (diff) | |
| download | libs-lbm-95b74577fe5c75e3e8497dc16241b7e6b8d30408.tar.gz | |
Vacationdev
Diffstat (limited to 'examples/throat_clog_2d/init.hpp')
| -rw-r--r-- | examples/throat_clog_2d/init.hpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/examples/throat_clog_2d/init.hpp b/examples/throat_clog_2d/init.hpp index 69225be..06ff179 100644 --- a/examples/throat_clog_2d/init.hpp +++ b/examples/throat_clog_2d/init.hpp @@ -35,19 +35,33 @@ saw::error_or<void> init( {{1u,1u}} ); + auto dims = info_f.get_dims(); + auto width = dims.at({{0u}}); + auto height = dims.at({{1u}}); + // + auto w = width.template cast_to<T>(); + auto h = height.template cast_to<T>(); + auto w2 = w * 0.5; + auto h4 = h * 0.25; + + saw::data<T> e{0.1}; + saw::data<T> c = saw::data<T>{1.0} - e; + + saw::data<T> d{0.2}; + auto b = (saw::data<T>{1.0} - d) * 0.5; + + auto p_r = (c*c + b*b) / (b*2); + auto p_i = p_r - b; + + // Circle Top + saw::data<sch::FixedArray<sch::Int64,2u>> top_pos{w2.get(),h + p_i}; + + // Circle Bot + saw::data<sch::FixedArray<sch::Int64,2u>> bot_pos{w2.get(),-p_i.get()}; + iterator<Desc::D>::apply( [&](auto& index){ - auto dims = info_f.get_dims(); - auto width = dims.at({{0u}}); - auto height = dims.at({{1u}}); - // - auto w2 = width / 2; - auto h4 = height / 4; - // Circle Top - saw::data<sch::FixedArray<sch::Int64,2u>> top_pos{{w2.get(),(height+h4).get()}}; - // Circle Bot - saw::data<sch::FixedArray<sch::Int64,2u>> bot_pos{{w2.get(),-h4.get()}}; }, {}, |
