From 95b74577fe5c75e3e8497dc16241b7e6b8d30408 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 25 Sep 2026 19:40:33 +0200 Subject: Vacation --- examples/throat_clog_2d/init.hpp | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'examples/throat_clog_2d') 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 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(); + auto h = height.template cast_to(); + auto w2 = w * 0.5; + auto h4 = h * 0.25; + + saw::data e{0.1}; + saw::data c = saw::data{1.0} - e; + + saw::data d{0.2}; + auto b = (saw::data{1.0} - d) * 0.5; + + auto p_r = (c*c + b*b) / (b*2); + auto p_i = p_r - b; + + // Circle Top + saw::data> top_pos{w2.get(),h + p_i}; + + // Circle Bot + saw::data> bot_pos{w2.get(),-p_i.get()}; + iterator::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> top_pos{{w2.get(),(height+h4).get()}}; - - // Circle Bot - saw::data> bot_pos{{w2.get(),-h4.get()}}; + }, {}, -- cgit v1.3.1