diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-01-14 18:45:49 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-01-14 18:45:49 +0100 |
| commit | bf498dca2c333bd66775005571ef915cf27c3ee8 (patch) | |
| tree | f528892036788a3ec8f28aa842cb5cb63a6790d3 /lib/core/tests/particles.cpp | |
| parent | 0651825aca44dc09b6aa4995280a65fed859cfc4 (diff) | |
| download | libs-lbm-bf498dca2c333bd66775005571ef915cf27c3ee8.tar.gz | |
Got physics working again
Diffstat (limited to 'lib/core/tests/particles.cpp')
| -rw-r--r-- | lib/core/tests/particles.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/core/tests/particles.cpp b/lib/core/tests/particles.cpp index 366c2a2..b2581f7 100644 --- a/lib/core/tests/particles.cpp +++ b/lib/core/tests/particles.cpp @@ -22,7 +22,9 @@ SAW_TEST("Verlet step 2D - Planar"){ acc.at({{0}}).set({1.0}); - lbm::verlet_step_lambda<sch::T,2u>(particle,{0.5}); + saw::data<sch::Scalar<sch::T>> dt; + dt.at({}).set(0.5); + lbm::verlet_step_lambda<sch::T,2u>(particle,dt); SAW_EXPECT(pos.at({{0}}).get() == 0.25, std::string{"Incorrect Pos X: "} + std::to_string(pos.at({{0}}).get())); SAW_EXPECT(pos.at({{1}}).get() == 0.0, std::string{"Incorrect Pos Y: "} + std::to_string(pos.at({{1}}).get())); @@ -130,11 +132,13 @@ SAW_TEST("Moving particles 2D"){ pos_old = pos; acc.at({{0u}}) = -0.1; } - + + saw::data<sch::Scalar<sch::T>> dt; + dt.at({}).set(0.5); bool has_collided = false; for(uint64_t i = 0u; i < 32u; ++i){ - lbm::verlet_step_lambda<sch::T,2u>(part_a,{0.5}); - lbm::verlet_step_lambda<sch::T,2u>(part_b,{0.5}); + lbm::verlet_step_lambda<sch::T,2u>(part_a,dt); + lbm::verlet_step_lambda<sch::T,2u>(part_b,dt); has_collided = lbm::broadphase_collision_check<sch::T,2u>(part_a,part_b); if(has_collided){ |
