summaryrefslogtreecommitdiff
path: root/examples/throat_clog_2d
diff options
context:
space:
mode:
Diffstat (limited to 'examples/throat_clog_2d')
-rw-r--r--examples/throat_clog_2d/.nix/derivation.nix4
-rw-r--r--examples/throat_clog_2d/common.hpp4
-rw-r--r--examples/throat_clog_2d/init.hpp4
-rw-r--r--examples/throat_clog_2d/sim.cpp25
4 files changed, 23 insertions, 14 deletions
diff --git a/examples/throat_clog_2d/.nix/derivation.nix b/examples/throat_clog_2d/.nix/derivation.nix
index 4dfce2a..2f73494 100644
--- a/examples/throat_clog_2d/.nix/derivation.nix
+++ b/examples/throat_clog_2d/.nix/derivation.nix
@@ -28,8 +28,8 @@ in stdenv.mkDerivation {
forstio.codec
forstio.codec-unit
forstio.io
- forstio.remote
- forstio.remote-filesystem
+ forstio.remote
+ forstio.remote-filesystem
forstio.codec-json
adaptive-cpp
kel.lbm.core
diff --git a/examples/throat_clog_2d/common.hpp b/examples/throat_clog_2d/common.hpp
index 4a1e211..6cc41a3 100644
--- a/examples/throat_clog_2d/common.hpp
+++ b/examples/throat_clog_2d/common.hpp
@@ -22,7 +22,7 @@ namespace lbm {
*/
constexpr uint64_t dim_y = 64ul;
-constexpr uint64_t dim_x = static_cast<uint64_t>(dim_y * (256.0 / 64.0));
+constexpr uint64_t dim_x = dim_y * 4ul;
constexpr uint64_t particle_amount = 1ul;
@@ -64,7 +64,7 @@ using MacroStruct = Struct<
>;
template<typename T, typename Desc>
-using ParticleSpheroidGroup = ParticleGroup<T,Desc::D,1u,coll::Spheroid<T>>;
+using ParticleSpheroidGroup = ParticleGroup<T,Desc::D,particle_amount,coll::Spheroid<T>>;
}
}
diff --git a/examples/throat_clog_2d/init.hpp b/examples/throat_clog_2d/init.hpp
index 1fb1e32..538e314 100644
--- a/examples/throat_clog_2d/init.hpp
+++ b/examples/throat_clog_2d/init.hpp
@@ -169,11 +169,11 @@ saw::error_or<void> init(
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">();
+ auto& p_pos_old = prb.template get<"position_old">();
p_pos.at({{0u}}) = conv.meter_si_to_lbm({{0.18}}).handle();
p_pos.at({{1u}}) = conv.meter_si_to_lbm({{0.25}}).handle();
- p_posold = p_pos;
+ p_pos_old = p_pos;
}
}
diff --git a/examples/throat_clog_2d/sim.cpp b/examples/throat_clog_2d/sim.cpp
index 7fda532..b3b3cef 100644
--- a/examples/throat_clog_2d/sim.cpp
+++ b/examples/throat_clog_2d/sim.cpp
@@ -12,6 +12,7 @@ using namespace saw::schema;
using LbmArgsStruct = Struct<
Member<String, "coupling">
+ //,Member<UInt64, "refinement">
>;
using LbmArgs = Args<
@@ -80,7 +81,6 @@ saw::error_or<void> lbm_main(const saw::data<args::LbmArgs>& args){
auto& sycl_q = dev.get_handle();
- sycl_q.wait();
{
auto eov = init<T,Desc,Coll>(conv,*lbm_data_ptr,*lbm_macro_data_ptr,*lbm_particle_data_ptr);
if(eov.is_error()){
@@ -93,6 +93,7 @@ saw::error_or<void> lbm_main(const saw::data<args::LbmArgs>& args){
return eov;
}
}
+ sycl_q.wait();
saw::data<sch::ChunkStruct<T,Desc>, encode::Sycl<saw::encode::Native>> lbm_sycl_data{sycl_q};
saw::data<sch::MacroStruct<T,Desc>, encode::Sycl<saw::encode::Native>> lbm_sycl_macro_data{sycl_q};
@@ -215,13 +216,21 @@ saw::error_or<void> k_main(int argc, char** argv){
auto& an = args.template get<"args">();
auto& coupling = an.template get<"coupling">();
- if(coupling.stl_view() == "hlbm"){
- return lbm_main<FloatT,DescT,method::Hlbm,1u>(args);
- } else if(coupling.stl_view() == "fplbm"){
- return lbm_main<FloatT,DescT,method::FpLbm,1u>(args);
- } else if(coupling.stl_view() == "psm"){
- return lbm_main<FloatT,DescT,method::Psm,1u>(args);
- }
+ auto resolution_resolve = [&]<typename Cpl>(){
+ lbm_main<FloatT,DescT,Cpl,1u>(args);
+ };
+
+ auto coupling_resolve = [&](){
+ if(coupling.stl_view() == "hlbm"){
+ return resolution_resolve.template operator()<method::Hlbm>();
+ } else if(coupling.stl_view() == "fplbm"){
+ return resolution_resolve.template operator()<method::FpLbm>();
+ } else if(coupling.stl_view() == "psm"){
+ return resolution_resolve.template operator()<method::Psm>();
+ }
+ };
+
+ coupling_resolve();
return saw::make_error<saw::err::critical>("Invalid coupling");
}