summaryrefslogtreecommitdiff
path: root/examples/particles_gpu/particles_gpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/particles_gpu/particles_gpu.cpp')
-rw-r--r--examples/particles_gpu/particles_gpu.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/examples/particles_gpu/particles_gpu.cpp b/examples/particles_gpu/particles_gpu.cpp
index abbc192..f3edbf2 100644
--- a/examples/particles_gpu/particles_gpu.cpp
+++ b/examples/particles_gpu/particles_gpu.cpp
@@ -8,21 +8,20 @@
namespace kel{
namespace lbm {
namespace sch {
-using namespace saw::schema;
}
}
-saw::error_or<void> lbm_main(int argc, char** argv){
+kel::lbm::error_or<void> lbm_main(int argc, char** argv){
(void) argc;
(void) argv;
using namespace lbm;
using namespace acpp;
- saw::data<sch::Array<sch::Particle<sch::Float32,2u>>> particles{1024u};
+ kel::lbm::data<sch::Array<sch::Particle<sch::Float32,2u>>> particles{1024u};
- for(saw::data<sch::UInt64> i{0u}; i < saw::data<sch::UInt64>{32u}; ++i){
- for(saw::data<sch::UInt64> j{0u}; j < saw::data<sch::UInt64>{32u}; ++j){
+ for(kel::lbm::data<sch::UInt64> i{0u}; i < kel::lbm::data<sch::UInt64>{32u}; ++i){
+ for(kel::lbm::data<sch::UInt64> j{0u}; j < kel::lbm::data<sch::UInt64>{32u}; ++j){
auto& part = particles.at(i*32ul+j);
auto& body = part.template get<"rigid_body">();
@@ -42,12 +41,12 @@ saw::error_or<void> lbm_main(int argc, char** argv){
}
}
- saw::data<sch::Scalar<sch::Float32>> time_step;
+ kel::lbm::data<sch::Scalar<sch::Float32>> time_step;
time_step.at({}).set(0.05f);
- for(saw::data<sch::UInt64> dt{0u}; dt < saw::data<sch::UInt64>{32ul}; ++dt){
+ for(kel::lbm::data<sch::UInt64> dt{0u}; dt < kel::lbm::data<sch::UInt64>{32ul}; ++dt){
// Do Verlet Step
- for(saw::data<sch::UInt64> i{0u}; i < particles.size(); ++i){
+ for(kel::lbm::data<sch::UInt64> i{0u}; i < particles.size(); ++i){
auto& part_i = particles.at(i);
verlet_step_lambda<sch::Float32,2u>(part_i,time_step);
@@ -59,7 +58,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){
}
//
- for(saw::data<sch::UInt64> i{0u}; i < particles.size(); ++i){
+ for(kel::lbm::data<sch::UInt64> i{0u}; i < particles.size(); ++i){
auto& part_i = particles.at(i);
auto& body_i = part_i.template get<"rigid_body">();
auto& pos_i = body_i.template get<"position">();
@@ -67,7 +66,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){
/**
* Test against other particles
*/
- for(saw::data<sch::UInt64> j{i+1ul}; j < particles.size(); ++j){
+ for(kel::lbm::data<sch::UInt64> j{i+1ul}; j < particles.size(); ++j){
auto& part_j = particles.at(j);
auto& body_j = part_j.template get<"rigid_body">();
auto& pos_j = body_j.template get<"position">();
@@ -84,12 +83,12 @@ saw::error_or<void> lbm_main(int argc, char** argv){
auto vel_rel = vel_i - vel_j;
auto pos_rel = pos_i - pos_j;
- auto vel_pos_rel_dot = saw::math::dot(vel_rel,pos_rel);
+ auto vel_pos_rel_dot = kel::lbm::math::dot(vel_rel,pos_rel);
if(vel_pos_rel_dot.at({}).get() < 0.0){
- auto pos_rel_normed = pos_rel / saw::math::sqrt(res.second);
+ auto pos_rel_normed = pos_rel / kel::lbm::math::sqrt(res.second);
}
- // auto vel_ij = saw::math::dot(vel_i,vel_j);
+ // auto vel_ij = kel::lbm::math::dot(vel_i,vel_j);
}
}
@@ -112,7 +111,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){
std::cout<<pos.at({{0u}}).get()<<" "<<pos.at({{1u}}).get()<<std::endl;
}
- return saw::make_void();
+ return kel::lbm::make_void();
}
}