Skip to content

Commit adc70a6

Browse files
author
LasNikas
committed
fix gpu
1 parent ed07cfb commit adc70a6

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

test/examples/gpu.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ end
911911
# simulation. The fluid domain starts at `x = 10 * particle_spacing`.
912912
n_interpolation_points = 10
913913
start_point = [0.0f0 + 10 * particle_spacing, domain_size[1] / 2]
914-
end_point = [domain_size[2] - 10 * particle_spacing, domain_size[1] / 2]
914+
end_point = [domain_size[1] - 10 * particle_spacing, domain_size[2] / 2]
915915
result_full = interpolate_line(start_point, end_point, n_interpolation_points,
916916
sol.prob.p.semi, sol.prob.p.semi.systems[1], sol,
917917
cut_off_bnd=false)
@@ -925,15 +925,12 @@ end
925925
coordinates_eltype=Float32,
926926
parallelization_backend=Main.parallelization_backend)
927927

928-
# Transfer `semi` back to CPU
929-
semi_cpu = TrixiParticles.Adapt.adapt(Array, sol.prob.p.semi)
930-
931928
iter = saving_callback.affect!.affect!.latest_saved_iter
932929
fluid_restart = joinpath("out", "fluid_1_$iter.vtu")
933930
open_boundary_restart = joinpath("out", "open_boundary_1_$iter.vtu")
934931
boundary_restart = joinpath("out", "boundary_1_$iter.vtu")
935932

936-
ode_restart = semidiscretize(semi_cpu, (0.3f0, 0.6f0);
933+
ode_restart = semidiscretize(semi, (0.3f0, 0.6f0);
937934
restart_with=(fluid_restart, open_boundary_restart,
938935
boundary_restart))
939936

@@ -946,8 +943,8 @@ end
946943
sol_restart.prob.p.semi.systems[1],
947944
sol_restart, cut_off_bnd=false)
948945

949-
@test isapprox(result_full.velocity, result_restart.velocity, rtol=8e-3)
950-
@test isapprox(result_full.density, result_restart.density, rtol=8e-4)
951-
@test isapprox(result_full.pressure, result_restart.pressure, rtol=8e-2)
946+
@test isapprox(result_full.velocity, result_restart.velocity, rtol=8f-3)
947+
@test isapprox(result_full.density, result_restart.density, rtol=8f-4)
948+
@test isapprox(result_full.pressure, result_restart.pressure, rtol=8f-2)
952949
end
953950
end

0 commit comments

Comments
 (0)