summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-10-09 17:29:07 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-10-09 17:29:07 +0200
commitf85a7ef199c25cabc834f52ccfc1365fe2a11f1f (patch)
tree7978236aa451f532e08ee7d5d5d87d6c29a66508
parent7095c698f5c5b7e960db9f9347501b8628f94dac (diff)
downloadlibs-lbm-f85a7ef199c25cabc834f52ccfc1365fe2a11f1f.tar.gz
Thing
-rw-r--r--examples/throat_clog_2d/common.hpp1
-rw-r--r--examples/throat_clog_2d/init.hpp2
-rw-r--r--examples/throat_clog_2d/sim.cpp14
-rw-r--r--examples/throat_clog_2d/step.hpp1
4 files changed, 12 insertions, 6 deletions
diff --git a/examples/throat_clog_2d/common.hpp b/examples/throat_clog_2d/common.hpp
index 6cc41a3..15fe08a 100644
--- a/examples/throat_clog_2d/common.hpp
+++ b/examples/throat_clog_2d/common.hpp
@@ -21,6 +21,7 @@ namespace lbm {
* position at (0.16m,0.32m)
*/
+// Base resolution.
constexpr uint64_t dim_y = 64ul;
constexpr uint64_t dim_x = dim_y * 4ul;
diff --git a/examples/throat_clog_2d/init.hpp b/examples/throat_clog_2d/init.hpp
index 538e314..68b2aaa 100644
--- a/examples/throat_clog_2d/init.hpp
+++ b/examples/throat_clog_2d/init.hpp
@@ -170,7 +170,7 @@ saw::error_or<void> init(
auto& prb = p.template get<"rigid_body">();
auto& p_pos = prb.template get<"position">();
auto& p_pos_old = prb.template get<"position_old">();
- p_pos.at({{0u}}) = conv.meter_si_to_lbm({{0.18}}).handle();
+ p_pos.at({{0u}}) = conv.meter_si_to_lbm({{0.16}}).handle();
p_pos.at({{1u}}) = conv.meter_si_to_lbm({{0.25}}).handle();
p_pos_old = p_pos;
diff --git a/examples/throat_clog_2d/sim.cpp b/examples/throat_clog_2d/sim.cpp
index b3b3cef..4084353 100644
--- a/examples/throat_clog_2d/sim.cpp
+++ b/examples/throat_clog_2d/sim.cpp
@@ -93,6 +93,12 @@ saw::error_or<void> lbm_main(const saw::data<args::LbmArgs>& args){
return eov;
}
}
+ {
+ auto eov = write_vtk_file(out_dir,"initial_state_macro",0u,*lbm_macro_data_ptr);
+ if(eov.is_error()){
+ return eov;
+ }
+ }
sycl_q.wait();
saw::data<sch::ChunkStruct<T,Desc>, encode::Sycl<saw::encode::Native>> lbm_sycl_data{sycl_q};
@@ -216,11 +222,11 @@ saw::error_or<void> k_main(int argc, char** argv){
auto& an = args.template get<"args">();
auto& coupling = an.template get<"coupling">();
- auto resolution_resolve = [&]<typename Cpl>(){
- lbm_main<FloatT,DescT,Cpl,1u>(args);
+ auto resolution_resolve = [&]<typename Cpl>() -> saw::error_or<void>{
+ return lbm_main<FloatT,DescT,Cpl,1u>(args);
};
- auto coupling_resolve = [&](){
+ auto coupling_resolve = [&]() -> saw::error_or<void> {
if(coupling.stl_view() == "hlbm"){
return resolution_resolve.template operator()<method::Hlbm>();
} else if(coupling.stl_view() == "fplbm"){
@@ -230,7 +236,7 @@ saw::error_or<void> k_main(int argc, char** argv){
}
};
- coupling_resolve();
+ return coupling_resolve();
return saw::make_error<saw::err::critical>("Invalid coupling");
}
diff --git a/examples/throat_clog_2d/step.hpp b/examples/throat_clog_2d/step.hpp
index f41fca7..dab9178 100644
--- a/examples/throat_clog_2d/step.hpp
+++ b/examples/throat_clog_2d/step.hpp
@@ -118,7 +118,6 @@ saw::error_or<void> step(
q.submit([&](acpp::sycl::handler& h){
saw::data<sch::Vector<T,Desc::D>> grav;
- grav.at({{1u}}) = conv.acceleration_si_to_lbm({-9.81}).handle();
component<T,Desc,cmpt::FpLbmOneParticle,encode::Sycl<saw::encode::Native>> fplbm_one_part{grav};
h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){