Skip to content

Commit

Permalink
Merge branch 'rectangular-patch' into bnd-rhs-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
efaulhaber committed Dec 22, 2023
2 parents 3c5c2a7 + 9ce1d53 commit 728eca5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
14 changes: 7 additions & 7 deletions test/test_util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 728eca5

Please sign in to comment.