From f768c3ac9543426bc3f3b03ed86610bf750912c7 Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Fri, 22 Dec 2023 13:57:36 +0100 Subject: [PATCH 1/2] Add `Random` to test dependencies --- test/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Project.toml b/test/Project.toml index 85ced8502..897dd26f0 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -4,6 +4,7 @@ OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] From 9ce1d532fdde2613b39fc5a35f6515913b70a09d Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Fri, 22 Dec 2023 14:04:51 +0100 Subject: [PATCH 2/2] Fix typo --- test/test_util.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/test_util.jl b/test/test_util.jl index 5b7f96086..c087a4dea 100644 --- a/test/test_util.jl +++ b/test/test_util.jl @@ -34,7 +34,7 @@ macro trixi_testset(name, expr) end end -function perturbate!(data, amplitude) +function perturb!(data, amplitude) for i in eachindex(data) # Perturbation in the interval (-amplitude, amplitude) data[i] += 2amplitude * rand() - amplitude @@ -53,13 +53,13 @@ function rectangular_patch(particle_spacing, size; density=1000.0, pressure=0.0, min_corner = -particle_spacing / 2 .* size ic = RectangularShape(particle_spacing, size, min_corner, density, pressure=pressure) - perturbate!(ic.mass, perturbation_factor * 0.1 * ic.mass[1]) - perturbate!(ic.density, perturbation_factor * 0.1density) - perturbate!(ic.pressure, perturbation_factor * 2000) - perturbate!(ic.velocity, perturbation_factor * 0.5particle_spacing) - perturbate!(ic.coordinates, perturbation_factor * 0.5particle_spacing) + perturb!(ic.mass, perturbation_factor * 0.1 * ic.mass[1]) + perturb!(ic.density, perturbation_factor * 0.1density) + perturb!(ic.pressure, perturbation_factor * 2000) + perturb!(ic.velocity, perturbation_factor * 0.5particle_spacing) + perturb!(ic.coordinates, perturbation_factor * 0.5particle_spacing) - # Don't perturbate center particle position + # Don't perturb center particle position center_particle = ceil(Int, prod(size) / 2) ic.coordinates[:, center_particle] .= 0.0