summaryrefslogtreecommitdiff
path: root/examples/particles_gpu/particles_gpu.cpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-01-07 17:57:52 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-01-07 17:57:52 +0100
commit6aa27007996656da995088aabecc273abd97db4b (patch)
treebe3ed901343ffc0155a6ae438d104dba73926154 /examples/particles_gpu/particles_gpu.cpp
parent3a08432f244986363f60c91f0dfd698686a8fa31 (diff)
downloadlibs-lbm-6aa27007996656da995088aabecc273abd97db4b.tar.gz
More part collision tests
Diffstat (limited to 'examples/particles_gpu/particles_gpu.cpp')
-rw-r--r--examples/particles_gpu/particles_gpu.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/particles_gpu/particles_gpu.cpp b/examples/particles_gpu/particles_gpu.cpp
index baae5f3..2f2d691 100644
--- a/examples/particles_gpu/particles_gpu.cpp
+++ b/examples/particles_gpu/particles_gpu.cpp
@@ -33,7 +33,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){
auto& p_size = part.template get<"size">();
p_size = {0.5f};
- if(j.get() % 2u == 0) acceleration.at({{1u}}) = {-9.81};
+ if(j.get() % 2u == 0) acceleration.at({{1u}}) = {9.81};
pos.at({{0u}}) = {i.template cast_to<sch::Float32>()};
pos.at({{1u}}) = {j.template cast_to<sch::Float32>()};
@@ -42,11 +42,11 @@ saw::error_or<void> lbm_main(int argc, char** argv){
}
}
- for(saw::data<sch::UInt64> dt{0u}; dt < saw::data<sch::UInt64>{1024ul*32ul}; ++dt){
+ for(saw::data<sch::UInt64> dt{0u}; dt < saw::data<sch::UInt64>{32ul}; ++dt){
for(saw::data<sch::UInt64> i{0u}; i < particles.size(); ++i){
auto& part_i = particles.at(i);
- verlet_step_lambda<sch::Float32,2u>(part_i,{1.0f});
+ verlet_step_lambda<sch::Float32,2u>(part_i,{0.05f});
}
for(saw::data<sch::UInt64> i{0u}; i < particles.size(); ++i){
auto& part_i = particles.at(i);
@@ -59,6 +59,8 @@ saw::error_or<void> lbm_main(int argc, char** argv){
}
}
}
+ auto& pos = particles.at({0u}).template get<"rigid_body">().template get<"position">();
+ std::cout<<pos.at({{0u}}).get()<<" "<<pos.at({{1u}}).get()<<std::endl;
saw::codec<sch::Array<sch::Particle<sch::Float32,2u>>, saw::encode::Json> j_codec;
}