summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-09-08 17:15:27 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-09-08 17:15:27 +0200
commit1f993006305952f4cafddd08267731877e808bba (patch)
treebb416a6012c058356404d1a547fec09c3d45d25d /examples
parent616b0011c3638eceaae8890c3a66037625587f1d (diff)
Dangling changes
Fixed ForcedGuo collision
Diffstat (limited to 'examples')
-rw-r--r--examples/cavity_2d_gpu.cpp16
-rw-r--r--examples/poiseulle_2d.cpp7
-rw-r--r--examples/poiseulle_channel_2d.cpp8
-rw-r--r--examples/poiseulle_particles_channel_2d.cpp9
4 files changed, 23 insertions, 17 deletions
diff --git a/examples/cavity_2d_gpu.cpp b/examples/cavity_2d_gpu.cpp
index 19563e2..b5c9b7f 100644
--- a/examples/cavity_2d_gpu.cpp
+++ b/examples/cavity_2d_gpu.cpp
@@ -189,7 +189,8 @@ void set_initial_conditions(saw::data<kel::lbm::sch::CavityFieldD2Q9>& latt){
void lbm_step(
saw::data<kel::lbm::sch::CavityFieldD2Q9>& latt,
- uint64_t time_step
+ uint64_t time_step,
+ sycl::queue& sycl_q
){
using namespace kel::lbm;
using dfi = df_info<sch::T,sch::D2Q9>;
@@ -260,8 +261,6 @@ void lbm_step(
int main(){
using namespace kel::lbm;
- saw::remote<saw::rmt::Sycl> sycl_rmt;
-
saw::data<sch::FixedArray<sch::UInt64,sch::D2Q9::D>> dim{{dim_x, dim_y}};
saw::data<sch::CavityFieldD2Q9, saw::encode::Native> lattice{dim};
@@ -273,6 +272,13 @@ int main(){
print_lbm_meta<sch::T, sch::D2Q9>(conv, {1e-3});
+ auto eo_lbm_dir = output_directory();
+ if(eo_lbm_dir.is_error()){
+ return -1;
+ }
+ auto& lbm_dir = eo_lbm_dir.get_value();
+ auto out_dir = lbm_dir / "cavity_gpu_2d";
+
//auto& df_field = lattices.at(0).template get<"dfs">();
//for(uint64_t i = 0; i < df_field.get_dim_size<0u>(); ++i){
// lattices.at(i) = {dim_x, dim_y};
@@ -288,6 +294,8 @@ int main(){
*/
set_initial_conditions(lattice);
+ sycl::queue sycl_q{sycl::default_selector_v, sycl::property::queue::in_order{}};
+
/**
* Timeloop
*/
@@ -307,7 +315,7 @@ int main(){
write_vtk_file(vtk_f_name, macros);
}
- // lbm_step(lattice, i);
+ lbm_step(lattice, i, sycl_q);
}
return 0;
}
diff --git a/examples/poiseulle_2d.cpp b/examples/poiseulle_2d.cpp
index 8e1ba94..8c31cb8 100644
--- a/examples/poiseulle_2d.cpp
+++ b/examples/poiseulle_2d.cpp
@@ -93,7 +93,7 @@ public:
return;
}
auto& dfs_old = (is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">();
- auto& dfs = (not is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">();
+ // auto& dfs = (not is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">();
/**
* Sum all known DFs
@@ -121,7 +121,7 @@ public:
auto& cell_n = field({{index.at({0u})+c_k[0u], index.at({1u})+c_k[1u]}});
auto& info_n = cell_n.template get<"info">();
auto info_n_val = info_n({0u});
- auto k_opp = dfi::opposite_index[k.get()];
+ // auto k_opp = dfi::opposite_index[k.get()];
if(info_n_val.get() > 0u){
sum_unknown_dfs += dfs_old({k}) * c_k[0u];
@@ -255,9 +255,6 @@ void lbm_step(
auto& cell = latt(index);
auto& info = cell.template get<"info">();
- auto& dfs = cell.template get<"dfs">();
- auto& dfs_old = cell.template get<"dfs_old">();
-
switch(info({0u}).get()){
case 1u: {
coll.apply(latt, index, time_step);
diff --git a/examples/poiseulle_channel_2d.cpp b/examples/poiseulle_channel_2d.cpp
index d34703a..ffc7201 100644
--- a/examples/poiseulle_channel_2d.cpp
+++ b/examples/poiseulle_channel_2d.cpp
@@ -93,7 +93,7 @@ public:
return;
}
auto& dfs_old = (is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">();
- auto& dfs = (not is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">();
+ //auto& dfs = (not is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">();
/**
* Sum all known DFs
@@ -121,7 +121,7 @@ public:
auto& cell_n = field({{index.at({0u})+c_k[0u], index.at({1u})+c_k[1u]}});
auto& info_n = cell_n.template get<"info">();
auto info_n_val = info_n({0u});
- auto k_opp = dfi::opposite_index[k.get()];
+ //auto k_opp = dfi::opposite_index[k.get()];
if(info_n_val.get() > 0u){
sum_unknown_dfs += dfs_old({k}) * c_k[0u];
@@ -294,8 +294,8 @@ void lbm_step(
auto& cell = latt(index);
auto& info = cell.template get<"info">();
- auto& dfs = cell.template get<"dfs">();
- auto& dfs_old = cell.template get<"dfs_old">();
+ //auto& dfs = cell.template get<"dfs">();
+ //auto& dfs_old = cell.template get<"dfs_old">();
switch(info({0u}).get()){
case 1u: {
diff --git a/examples/poiseulle_particles_channel_2d.cpp b/examples/poiseulle_particles_channel_2d.cpp
index fed78b2..bc5d241 100644
--- a/examples/poiseulle_particles_channel_2d.cpp
+++ b/examples/poiseulle_particles_channel_2d.cpp
@@ -24,6 +24,7 @@ using namespace saw::schema;
* Q factor
*/
using T = Float32;
+// using T = MixedPrecision<Float64, Float32>;
using D2Q5 = Descriptor<2u,5u>;
using D2Q9 = Descriptor<2u,9u>;
@@ -349,6 +350,7 @@ void couple_particles_to_lattice(
saw::data<kel::lbm::sch::T> time_step
){
using namespace kel::lbm;
+ (void) time_step;
auto meta = latt.meta();
using dfi = df_info<sch::T,sch::D2Q9>;
@@ -398,7 +400,7 @@ void couple_particles_to_lattice(
// Fluid to Particle Coupling
// Prepare force sum
- saw::data<sch::FixedArray<sch::T,2u>> forces;
+ saw::data<sch::Vector<sch::T,2u>> forces;
iterate_over([&](const saw::data<sch::FixedArray<sch::UInt64,2u>>& index){
@@ -500,8 +502,8 @@ void lbm_step(
auto& cell = latt(index);
auto& info = cell.template get<"info">();
- auto& dfs = cell.template get<"dfs">();
- auto& dfs_old = cell.template get<"dfs_old">();
+ //auto& dfs = cell.template get<"dfs">();
+ //auto& dfs_old = cell.template get<"dfs_old">();
switch(info({0u}).get()){
case 1u: {
@@ -595,7 +597,6 @@ int main(int argc, char** argv){
particle_system<sch::T, 2u> particle_sys;
add_particles(particle_sys);
-
/**
* Setup geometry
*/