Skip to content

Commit 70c9408

Browse files
committed
Fix
1 parent 0023426 commit 70c9408

2 files changed

Lines changed: 50 additions & 14 deletions

File tree

src/general/interpolation.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,9 @@ end
608608
end
609609

610610
@threaded parallelization_backend for point in axes(point_coords, 2)
611-
if other_density[point] > computed_density[point] ||
612-
computed_density[point] < eps()
611+
cut_off = computed_density[point] < eps() ||
612+
(cut_off_bnd && other_density[point] > computed_density[point])
613+
if cut_off
613614
# Return NaN values that can be filtered out in ParaView
614615
computed_density[point] = NaN
615616
neighbor_count[point] = 0

test/general/interpolation.jl

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,20 @@
475475
u_bnd; endpoint=true,
476476
cut_off_bnd)
477477

478+
result_endpoint_wall_velocity = TrixiParticles.interpolate_line([
479+
1.0,
480+
-0.05
481+
],
482+
[1.0, 1.0],
483+
5,
484+
semi_boundary,
485+
fluid_system,
486+
v_bnd,
487+
u_bnd;
488+
endpoint=true,
489+
cut_off_bnd,
490+
include_wall_velocity=true)
491+
478492
result = TrixiParticles.interpolate_line([1.0, -0.05], [1.0, 1.0], 5,
479493
semi_no_boundary, fluid_system,
480494
v_no_bnd, u_no_bnd; endpoint=false,
@@ -512,6 +526,8 @@
512526

513527
compare_interpolation_result(result, expected_res)
514528
compare_interpolation_result(result_endpoint, expected_res_end)
529+
compare_interpolation_result(result_endpoint_wall_velocity,
530+
expected_res_end)
515531

516532
else
517533
expected_res = (density=[666.0, 666.0, 666.0], neighbor_count=[2, 2, 1],
@@ -522,29 +538,48 @@
522538
pressure=[
523539
0.4527147691600855,
524540
0.9912738969258665,
525-
1.4000000000000001
541+
1.4
526542
])
527-
expected_res_end = (density=[
528-
666.0,
529-
666.0,
530-
665.9999999999999,
531-
666.0,
532-
666.0
533-
], neighbor_count=[1, 2, 2, 1, 1],
543+
expected_res_end = (density=[666.0, 666.0, 666.0, 666.0, 666.0],
544+
neighbor_count=[1, 2, 2, 1, 1],
534545
point_coords=[1.0 1.0 1.0 1.0 1.0;
535546
-0.05 0.2125 0.475 0.7375 1.0],
536-
velocity=[7.7 7.699999999999999 7.699999999999999 7.7 7.7;
537-
0.10099999999999999 0.10605429538320173 0.12465095587703465 0.14900000000000002 0.22100000000000006],
547+
velocity=[7.7 7.7 7.7 7.7 7.7;
548+
0.101 0.10605429538320173 0.12465095587703465 0.149 0.221],
538549
pressure=[
539-
0.19999999999999998,
550+
0.2,
540551
0.4527147691600855,
541552
0.9912738969258663,
542-
1.4000000000000001,
553+
1.4,
543554
2.2
544555
])
556+
expected_res_end_wall_velocity = (density=[
557+
666.0,
558+
666.0,
559+
666.0,
560+
666.0,
561+
666.0
562+
], neighbor_count=[2, 2, 2, 1, 1],
563+
point_coords=[
564+
1.0 1.0 1.0 1.0 1.0;
565+
-0.05 0.2125 0.475 0.7375 1.0
566+
],
567+
velocity=[
568+
0.7077120921221691 7.7 7.7 7.7 7.7;
569+
0.009282976792771307 0.10605429538320173 0.12465095587703465 0.149 0.221
570+
],
571+
pressure=[
572+
0.2,
573+
0.4527147691600855,
574+
0.9912738969258663,
575+
1.4,
576+
2.2
577+
])
545578

546579
compare_interpolation_result(result, expected_res)
547580
compare_interpolation_result(result_endpoint, expected_res_end)
581+
compare_interpolation_result(result_endpoint_wall_velocity,
582+
expected_res_end_wall_velocity)
548583
end
549584
end
550585
end

0 commit comments

Comments
 (0)