From 2326d03a641182559b3304339d1a226224cccf3d Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:47:15 +0200 Subject: [PATCH 1/4] Use new v0.3 release of PointNeighbors.jl (#550) * Replace `for_particle_neighbor` * Change kwarg `particles` to `points` * Remove `create_neighborhood_search` * Fix examples and tests * Reintroduce `create_neighborhood_search` to allow `nothing` * Restrict PointNeighbors.jl version * Fix tests * Fix tests * Fix examples * Fix validation * Fix docs * Mention periodic boxes in the docs * Fix tests * Fix tests --- Project.toml | 2 +- docs/Project.toml | 2 + docs/make.jl | 2 + docs/src/general/neighborhood_search.md | 21 ++- docs/src/reference-pointneighbors.md | 9 ++ examples/dem/rectangular_tank_2d.jl | 3 +- examples/fluid/dam_break_2d.jl | 3 +- examples/fluid/periodic_channel_2d.jl | 7 +- examples/n_body/n_body_system.jl | 12 +- src/TrixiParticles.jl | 5 +- src/general/corrections.jl | 35 ++--- src/general/density_calculators.jl | 5 +- src/general/initial_condition.jl | 5 +- src/general/interpolation.jl | 6 +- src/general/neighborhood_search.jl | 28 ++-- src/general/semidiscretization.jl | 131 +++++++++--------- .../dummy_particles/dummy_particles.jl | 18 +-- src/schemes/boundary/open_boundary/system.jl | 4 +- src/schemes/boundary/rhs.jl | 5 +- .../fluid/entropically_damped_sph/rhs.jl | 6 +- src/schemes/fluid/surface_tension.jl | 6 +- .../density_diffusion.jl | 4 +- .../fluid/weakly_compressible_sph/rhs.jl | 6 +- .../solid/discrete_element_method/rhs.jl | 4 +- src/schemes/solid/total_lagrangian_sph/rhs.jl | 12 +- .../solid/total_lagrangian_sph/system.jl | 11 +- test/count_allocations.jl | 4 +- test/general/interpolation.jl | 16 +-- test/general/semidiscretization.jl | 12 +- .../dummy_particles/dummy_particles.jl | 4 +- test/schemes/boundary/dummy_particles/rhs.jl | 8 +- .../monaghan_kajtar/monaghan_kajtar.jl | 4 +- test/schemes/fluid/rhs.jl | 4 +- .../schemes/solid/total_lagrangian_sph/rhs.jl | 5 +- test/systems/solid_system.jl | 9 +- .../dam_break_2d/validation_dam_break_2d.jl | 4 +- 36 files changed, 213 insertions(+), 209 deletions(-) create mode 100644 docs/src/reference-pointneighbors.md diff --git a/Project.toml b/Project.toml index 981c36192..667a4b6c8 100644 --- a/Project.toml +++ b/Project.toml @@ -39,7 +39,7 @@ GPUArrays = "9, 10" JSON = "0.21" KernelAbstractions = "0.9" MuladdMacro = "0.2" -PointNeighbors = "0.2.3" +PointNeighbors = "0.3" Polyester = "0.7.5" RecipesBase = "1" Reexport = "1" diff --git a/docs/Project.toml b/docs/Project.toml index 7ada97297..80e978d76 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,9 +1,11 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +PointNeighbors = "1c4d5385-0a27-49de-8e2c-43b175c8985c" TrixiBase = "9a0f1c46-06d5-4909-a5a3-ce25d3fa3284" [compat] Documenter = "1" OrdinaryDiffEq = "6" +PointNeighbors = "0.3" TrixiBase = "0.1" diff --git a/docs/make.jl b/docs/make.jl index 3fcf40ece..31c314100 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,6 +1,7 @@ using Documenter using TrixiParticles using TrixiBase +using PointNeighbors # Get TrixiParticles.jl root directory trixiparticles_root_dir = dirname(@__DIR__) @@ -129,6 +130,7 @@ makedocs(sitename="TrixiParticles.jl", "Time Integration" => "time_integration.md", "Callbacks" => "callbacks.md", "TrixiBase.jl API Reference" => "reference-trixibase.md", + "PointNeighbors.jl API Reference" => "reference-pointneighbors.md", ], "Authors" => "authors.md", "Contributing" => "contributing.md", diff --git a/docs/src/general/neighborhood_search.md b/docs/src/general/neighborhood_search.md index e611f5350..cbd68147c 100644 --- a/docs/src/general/neighborhood_search.md +++ b/docs/src/general/neighborhood_search.md @@ -6,11 +6,13 @@ We provide several implementations in the package See the docs of this package for an overview and a comparison of different implementations. !!! note "Usage" - To run a simulation with a neighborhood search implementation, just pass the type - to the constructor of the [`Semidiscretization`](@ref): + To run a simulation with a neighborhood search implementation, pass a template of the + neighborhood search to the constructor of the [`Semidiscretization`](@ref). + A template is just an empty neighborhood search with search radius `0.0`. + See [`copy_neighborhood_search`](@ref) and the examples below for more details. ```jldoctest semi_example; output=false, setup = :(using TrixiParticles; trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"), sol=nothing); system1 = fluid_system; system2 = boundary_system) semi = Semidiscretization(system1, system2, - neighborhood_search=GridNeighborhoodSearch) + neighborhood_search=PrecomputedNeighborhoodSearch{2}()) # output ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -18,19 +20,16 @@ See the docs of this package for an overview and a comparison of different imple │ ══════════════════ │ │ #spatial dimensions: ………………………… 2 │ │ #systems: ……………………………………………………… 2 │ - │ neighborhood search: ………………………… GridNeighborhoodSearch │ + │ neighborhood search: ………………………… PrecomputedNeighborhoodSearch │ │ total #particles: ………………………………… 636 │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ``` - The keyword arguments `periodic_box_min_corner` and `periodic_box_max_corner` mentioned - in the PointNeighbors.jl docs can also be passed to the - [`Semidiscretization`](@ref) and will internally be forwarded to the neighborhood search. - See the docs of [`Semidiscretization`](@ref) for more details. + The keyword argument `periodic_box` in the neighborhood search constructors can be used + to define a periodic domain. See the PointNeighbors.jl docs for more details. ```jldoctest semi_example; output = false + periodic_box = PeriodicBox(min_corner=[0.0, -0.25], max_corner=[1.0, 0.75]) semi = Semidiscretization(system1, system2, - neighborhood_search=GridNeighborhoodSearch, - periodic_box_min_corner=[0.0, -0.25], - periodic_box_max_corner=[1.0, 0.75]) + neighborhood_search=GridNeighborhoodSearch{2}(; periodic_box)) # output ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ diff --git a/docs/src/reference-pointneighbors.md b/docs/src/reference-pointneighbors.md new file mode 100644 index 000000000..f8f8c5ac7 --- /dev/null +++ b/docs/src/reference-pointneighbors.md @@ -0,0 +1,9 @@ +# PointNeighbors.jl API + +```@meta +CurrentModule = PointNeighbors +``` + +```@autodocs +Modules = [PointNeighbors] +``` diff --git a/examples/dem/rectangular_tank_2d.jl b/examples/dem/rectangular_tank_2d.jl index c7daa31e2..b1fcbf398 100644 --- a/examples/dem/rectangular_tank_2d.jl +++ b/examples/dem/rectangular_tank_2d.jl @@ -30,8 +30,7 @@ boundary_system = BoundaryDEMSystem(tank.boundary, 10e7) # ========================================================================================== # ==== Simulation -semi = Semidiscretization(rock_system, boundary_system, - neighborhood_search=GridNeighborhoodSearch) +semi = Semidiscretization(rock_system, boundary_system) tspan = (0.0, 5.0) ode = semidiscretize(semi, tspan) diff --git a/examples/fluid/dam_break_2d.jl b/examples/fluid/dam_break_2d.jl index a1eeb2f38..b0fae532c 100644 --- a/examples/fluid/dam_break_2d.jl +++ b/examples/fluid/dam_break_2d.jl @@ -74,8 +74,7 @@ boundary_system = BoundarySPHSystem(tank.boundary, boundary_model, adhesion_coef # ========================================================================================== # ==== Simulation semi = Semidiscretization(fluid_system, boundary_system, - neighborhood_search=GridNeighborhoodSearch, - threaded_nhs_update=true) + neighborhood_search=GridNeighborhoodSearch{2}(threaded_update=true)) ode = semidiscretize(semi, tspan, data_type=nothing) info_callback = InfoCallback(interval=100) diff --git a/examples/fluid/periodic_channel_2d.jl b/examples/fluid/periodic_channel_2d.jl index 55899df44..3743e843d 100644 --- a/examples/fluid/periodic_channel_2d.jl +++ b/examples/fluid/periodic_channel_2d.jl @@ -56,9 +56,10 @@ boundary_system = BoundarySPHSystem(tank.boundary, boundary_model) # ========================================================================================== # ==== Simulation -semi = Semidiscretization(fluid_system, boundary_system, - periodic_box_min_corner=[0.0, -0.25], - periodic_box_max_corner=[1.0, 0.75]) +periodic_box = PeriodicBox(min_corner=[0.0, -0.25], max_corner=[1.0, 0.75]) +neighborhood_search = GridNeighborhoodSearch{2}(; periodic_box) + +semi = Semidiscretization(fluid_system, boundary_system; neighborhood_search) ode = semidiscretize(semi, tspan) info_callback = InfoCallback(interval=100) diff --git a/examples/n_body/n_body_system.jl b/examples/n_body/n_body_system.jl index 556147ed4..f996565f3 100644 --- a/examples/n_body/n_body_system.jl +++ b/examples/n_body/n_body_system.jl @@ -2,7 +2,7 @@ using TrixiParticles using LinearAlgebra # The second type parameter of `System` can't be `Nothing`, or TrixiParticles will launch -# GPU kernel for `for_particle_neighbor` loops. +# GPU kernel for `foreach_point_neighbor` loops. struct NBodySystem{NDIMS, ELTYPE <: Real} <: TrixiParticles.System{NDIMS, 0} initial_condition :: InitialCondition{ELTYPE} mass :: Array{ELTYPE, 1} # [particle] @@ -39,7 +39,7 @@ function TrixiParticles.update_nhs!(neighborhood_search, u_system, u_neighbor) TrixiParticles.PointNeighbors.update!(neighborhood_search, u_system, u_neighbor, - particles_moving=(true, true)) + points_moving=(true, true)) end function TrixiParticles.compact_support(system::NBodySystem, @@ -59,10 +59,10 @@ function TrixiParticles.interact!(dv, v_particle_system, u_particle_system, neighbor_coords = TrixiParticles.current_coordinates(u_neighbor_system, neighbor_system) # Loop over all pairs of particles and neighbors within the kernel cutoff. - TrixiParticles.for_particle_neighbor(particle_system, neighbor_system, - system_coords, neighbor_coords, - neighborhood_search) do particle, neighbor, - pos_diff, distance + TrixiParticles.foreach_point_neighbor(particle_system, neighbor_system, + system_coords, neighbor_coords, + neighborhood_search) do particle, neighbor, + pos_diff, distance # Only consider particles with a distance > 0. distance < sqrt(eps()) && return diff --git a/src/TrixiParticles.jl b/src/TrixiParticles.jl index 9fe23e3d4..facebf94c 100644 --- a/src/TrixiParticles.jl +++ b/src/TrixiParticles.jl @@ -25,8 +25,9 @@ using StrideArrays: PtrArray, StaticInt using TimerOutputs: TimerOutput, TimerOutputs, print_timer, reset_timer! using TrixiBase: trixi_include, @trixi_timeit, timer, timeit_debug_enabled, disable_debug_timings, enable_debug_timings -@reexport using PointNeighbors: TrivialNeighborhoodSearch, GridNeighborhoodSearch -using PointNeighbors: PointNeighbors, for_particle_neighbor +@reexport using PointNeighbors: TrivialNeighborhoodSearch, GridNeighborhoodSearch, + PrecomputedNeighborhoodSearch, PeriodicBox +using PointNeighbors: PointNeighbors, foreach_point_neighbor, copy_neighborhood_search using WriteVTK: vtk_grid, MeshCell, VTKCellTypes, paraview_collection, vtk_save # `util.jl` depends on the `GPUSystem` type defined in `system.jl` diff --git a/src/general/corrections.jl b/src/general/corrections.jl index ee894fec4..cb1d52df8 100644 --- a/src/general/corrections.jl +++ b/src/general/corrections.jl @@ -193,10 +193,10 @@ function compute_shepard_coeff!(system, system_coords, v_ode, u_ode, semi, neighborhood_search = get_neighborhood_search(system, neighbor_system, semi) # Loop over all pairs of particles and neighbors within the kernel cutoff - for_particle_neighbor(system, neighbor_system, system_coords, - neighbor_coords, neighborhood_search, - particles=eachparticle(system)) do particle, neighbor, - pos_diff, distance + foreach_point_neighbor(system, neighbor_system, system_coords, + neighbor_coords, neighborhood_search, + points=eachparticle(system)) do particle, neighbor, + pos_diff, distance rho_b = particle_density(v_neighbor_system, neighbor_system, neighbor) m_b = hydrodynamic_mass(neighbor_system, neighbor) volume = m_b / rho_b @@ -255,11 +255,10 @@ function compute_correction_values!(system, neighborhood_search = get_neighborhood_search(system, neighbor_system, semi) # Loop over all pairs of particles and neighbors within the kernel cutoff - for_particle_neighbor(system, neighbor_system, system_coords, - neighbor_coords, - neighborhood_search, - particles=eachparticle(system)) do particle, neighbor, - pos_diff, distance + foreach_point_neighbor(system, neighbor_system, system_coords, + neighbor_coords, neighborhood_search, + points=eachparticle(system)) do particle, neighbor, + pos_diff, distance rho_b = particle_density(v_neighbor_system, neighbor_system, neighbor) m_b = hydrodynamic_mass(neighbor_system, neighbor) volume = m_b / rho_b @@ -361,11 +360,9 @@ function compute_gradient_correction_matrix!(corr_matrix, neighborhood_search, set_zero!(corr_matrix) # Loop over all pairs of particles and neighbors within the kernel cutoff. - for_particle_neighbor(system, system, - coordinates, coordinates, - neighborhood_search; - particles=eachparticle(system)) do particle, neighbor, - pos_diff, distance + foreach_point_neighbor(system, system, coordinates, coordinates, neighborhood_search; + points=eachparticle(system)) do particle, neighbor, + pos_diff, distance volume = mass[neighbor] / density_fun(neighbor) grad_kernel = smoothing_kernel_grad(system, pos_diff, distance) @@ -397,12 +394,10 @@ function compute_gradient_correction_matrix!(corr_matrix::AbstractArray, system, neighbor_coords = current_coordinates(u_neighbor_system, neighbor_system) neighborhood_search = get_neighborhood_search(system, neighbor_system, semi) - for_particle_neighbor(system, neighbor_system, coordinates, neighbor_coords, - neighborhood_search; - particles=eachparticle(system)) do particle, - neighbor, - pos_diff, - distance + foreach_point_neighbor(system, neighbor_system, coordinates, neighbor_coords, + neighborhood_search; + points=eachparticle(system)) do particle, neighbor, + pos_diff, distance volume = hydrodynamic_mass(neighbor_system, neighbor) / particle_density(v_neighbor_system, neighbor_system, neighbor) diff --git a/src/general/density_calculators.jl b/src/general/density_calculators.jl index 7244253b0..74a5f616d 100644 --- a/src/general/density_calculators.jl +++ b/src/general/density_calculators.jl @@ -62,8 +62,9 @@ function summation_density!(system, semi, u, u_ode, density; nhs = get_neighborhood_search(system, neighbor_system, semi) # Loop over all pairs of particles and neighbors within the kernel cutoff. - for_particle_neighbor(system, neighbor_system, system_coords, neighbor_coords, nhs, - particles=particles) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(system, neighbor_system, system_coords, neighbor_coords, nhs, + points=particles) do particle, neighbor, + pos_diff, distance mass = hydrodynamic_mass(neighbor_system, neighbor) density[particle] += mass * smoothing_kernel(system, distance) end diff --git a/src/general/initial_condition.jl b/src/general/initial_condition.jl index 8e94b1615..ab7521a7e 100644 --- a/src/general/initial_condition.jl +++ b/src/general/initial_condition.jl @@ -290,11 +290,12 @@ function find_too_close_particles(coords1, coords2, max_distance) NDIMS = size(coords1, 1) result = Int[] - nhs = GridNeighborhoodSearch{NDIMS}(max_distance, size(coords2, 2)) + nhs = GridNeighborhoodSearch{NDIMS}(search_radius=max_distance, + n_points=size(coords2, 2)) PointNeighbors.initialize!(nhs, coords1, coords2) # We are modifying the vector `result`, so this cannot be parallel - for_particle_neighbor(coords1, coords2, nhs, parallel=false) do particle, _, _, _ + foreach_point_neighbor(coords1, coords2, nhs, parallel=false) do particle, _, _, _ if !(particle in result) append!(result, particle) end diff --git a/src/general/interpolation.jl b/src/general/interpolation.jl index 80116a605..a3b00e28a 100644 --- a/src/general/interpolation.jl +++ b/src/general/interpolation.jl @@ -495,7 +495,9 @@ function process_neighborhood_searches(semi, u_ode, ref_system, smoothing_length system_coords = current_coordinates(u, system) old_nhs = get_neighborhood_search(ref_system, system, semi) nhs = PointNeighbors.copy_neighborhood_search(old_nhs, search_radius, - system_coords, system_coords) + nparticles(system)) + PointNeighbors.initialize!(nhs, system_coords, system_coords) + return nhs end end @@ -534,7 +536,7 @@ end system_coords = current_coordinates(u, system) - # This is basically `for_particle_neighbor` unrolled + # This is basically `foreach_point_neighbor` unrolled for particle in PointNeighbors.eachneighbor(point_coords, nhs) coords = extract_svector(system_coords, Val(ndims(system)), particle) diff --git a/src/general/neighborhood_search.jl b/src/general/neighborhood_search.jl index afcd2c9b3..8ac6d09bd 100644 --- a/src/general/neighborhood_search.jl +++ b/src/general/neighborhood_search.jl @@ -1,22 +1,22 @@ # Loop over all pairs of particles and neighbors within the kernel cutoff. # `f(particle, neighbor, pos_diff, distance)` is called for every particle-neighbor pair. # By default, loop over `each_moving_particle(system)`. -function PointNeighbors.for_particle_neighbor(f, system, neighbor_system, - system_coords, neighbor_coords, - neighborhood_search; - particles=each_moving_particle(system), - parallel=true) - for_particle_neighbor(f, system_coords, neighbor_coords, neighborhood_search, - particles=particles, parallel=parallel) +function PointNeighbors.foreach_point_neighbor(f, system, neighbor_system, + system_coords, neighbor_coords, + neighborhood_search; + points=each_moving_particle(system), + parallel=true) + foreach_point_neighbor(f, system_coords, neighbor_coords, neighborhood_search; + points, parallel) end -function PointNeighbors.for_particle_neighbor(f, system::GPUSystem, neighbor_system, - system_coords, neighbor_coords, - neighborhood_search; - particles=each_moving_particle(system), - parallel=true) - @threaded system for particle in particles +function PointNeighbors.foreach_point_neighbor(f, system::GPUSystem, neighbor_system, + system_coords, neighbor_coords, + neighborhood_search; + points=each_moving_particle(system), + parallel=true) + @threaded system for point in points PointNeighbors.foreach_neighbor(f, system_coords, neighbor_coords, - neighborhood_search, particle) + neighborhood_search, point) end end diff --git a/src/general/semidiscretization.jl b/src/general/semidiscretization.jl index 7f6c791db..f46ca3cea 100644 --- a/src/general/semidiscretization.jl +++ b/src/general/semidiscretization.jl @@ -1,27 +1,20 @@ """ - Semidiscretization(systems...; neighborhood_search=GridNeighborhoodSearch, - periodic_box_min_corner=nothing, periodic_box_max_corner=nothing, - threaded_nhs_update=true) + Semidiscretization(systems...; neighborhood_search=GridNeighborhoodSearch{NDIMS}()) The semidiscretization couples the passed systems to one simulation. -The type of neighborhood search to be used in the simulation can be specified with -the keyword argument `neighborhood_search`. A value of `nothing` means no neighborhood search. - # Arguments - `systems`: Systems to be coupled in this semidiscretization # Keywords -- `neighborhood_search`: The type of neighborhood search to be used in the simulation. - By default, the `GridNeighborhoodSearch` is used. - Use `TrivialNeighborhoodSearch` or `nothing` to loop - over all particles (no neighborhood search). -- `periodic_box_min_corner`: In order to use a (rectangular) periodic domain, pass the - coordinates of the domain corner in negative coordinate - directions. -- `periodic_box_max_corner`: In order to use a (rectangular) periodic domain, pass the - coordinates of the domain corner in positive coordinate - directions. +- `neighborhood_search`: The neighborhood search to be used in the simulation. + By default, the [`GridNeighborhoodSearch`](@ref) is used. + Use `nothing` to loop over all particles (no neighborhood search). + To use other neighborhood search implementations, pass a template + of a neighborhood search. See [`copy_neighborhood_search`](@ref) + and the examples below for more details. + To use a periodic domain, pass a [`PeriodicBox`](@ref) to the + neighborhood search. - `threaded_nhs_update=true`: Can be used to deactivate thread parallelization in the neighborhood search update. This can be one of the largest sources of variations between simulations with different thread numbers due to particle ordering changes. @@ -31,7 +24,17 @@ the keyword argument `neighborhood_search`. A value of `nothing` means no neighb semi = Semidiscretization(fluid_system, boundary_system) semi = Semidiscretization(fluid_system, boundary_system, - neighborhood_search=TrivialNeighborhoodSearch) + neighborhood_search=GridNeighborhoodSearch{2}(threaded_update=false)) + +periodic_box = PeriodicBox(min_corner = [0.0, 0.0], max_corner = [1.0, 1.0]) +semi = Semidiscretization(fluid_system, boundary_system, + neighborhood_search=GridNeighborhoodSearch{2}(; periodic_box)) + +semi = Semidiscretization(fluid_system, boundary_system, + neighborhood_search=PrecomputedNeighborhoodSearch{2}()) + +semi = Semidiscretization(fluid_system, boundary_system, + neighborhood_search=nothing) # output ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -62,9 +65,8 @@ end GPUSemidiscretization = Semidiscretization{<:NTuple{<:Any, GPUSystem}} -function Semidiscretization(systems...; neighborhood_search=GridNeighborhoodSearch, - periodic_box_min_corner=nothing, - periodic_box_max_corner=nothing, threaded_nhs_update=true) +function Semidiscretization(systems...; + neighborhood_search=GridNeighborhoodSearch{ndims(first(systems))}()) systems = filter(system -> !isnothing(system), systems) # Check e.g. that the boundary systems are using a state equation if EDAC is not used. @@ -80,13 +82,10 @@ function Semidiscretization(systems...; neighborhood_search=GridNeighborhoodSear ranges_v = Tuple((sum(sizes_v[1:(i - 1)]) + 1):sum(sizes_v[1:i]) for i in eachindex(sizes_v)) - # Create (and initialize) a tuple of n neighborhood searches for each of the n systems + # Create a tuple of n neighborhood searches for each of the n systems. # We will need one neighborhood search for each pair of systems. - searches = Tuple(Tuple(create_neighborhood_search(system, neighbor, - Val(neighborhood_search), - periodic_box_min_corner, - periodic_box_max_corner, - threaded_nhs_update) + searches = Tuple(Tuple(create_neighborhood_search(neighborhood_search, + system, neighbor) for neighbor in systems) for system in systems) @@ -123,29 +122,15 @@ function Base.show(io::IO, ::MIME"text/plain", semi::Semidiscretization) end end -function create_neighborhood_search(system, neighbor, - ::Union{Val{nothing}, Val{TrivialNeighborhoodSearch}}, - periodic_box_min_corner, periodic_box_max_corner, - threaded_nhs_update) - radius = compact_support(system, neighbor) - TrivialNeighborhoodSearch{ndims(system)}(radius, eachparticle(neighbor), - periodic_box_min_corner=periodic_box_min_corner, - periodic_box_max_corner=periodic_box_max_corner) -end +function create_neighborhood_search(::Nothing, system, neighbor) + nhs = TrivialNeighborhoodSearch{ndims(system)}() -function create_neighborhood_search(system, neighbor, ::Val{GridNeighborhoodSearch}, - periodic_box_min_corner, periodic_box_max_corner, - threaded_nhs_update) - radius = compact_support(system, neighbor) - search = GridNeighborhoodSearch{ndims(system)}(radius, nparticles(neighbor), - periodic_box_min_corner=periodic_box_min_corner, - periodic_box_max_corner=periodic_box_max_corner, - threaded_nhs_update=threaded_nhs_update) - # Initialize neighborhood search - PointNeighbors.initialize!(search, initial_coordinates(system), - initial_coordinates(neighbor)) + return create_neighborhood_search(nhs, system, neighbor) +end - return search +function create_neighborhood_search(neighborhood_search, system, neighbor) + return copy_neighborhood_search(neighborhood_search, compact_support(system, neighbor), + nparticles(neighbor)) end @inline function compact_support(system, neighbor) @@ -285,18 +270,18 @@ function semidiscretize(semi, tspan; reset_threads=true, data_type=nothing) Polyester.reset_threads!() end + initialize_neighborhood_searches!(semi) + # Initialize all particle systems - @trixi_timeit timer() "initialize particle systems" begin - foreach_system(semi) do system - # Get the neighborhood search for this system - neighborhood_search = get_neighborhood_search(system, semi) + foreach_system(semi) do system + # Get the neighborhood search for this system + neighborhood_search = get_neighborhood_search(system, semi) - # Initialize this system - initialize!(system, neighborhood_search) + # Initialize this system + initialize!(system, neighborhood_search) - # Only for systems requiring a mandatory callback - reset_callback_flag!(system) - end + # Only for systems requiring a mandatory callback + reset_callback_flag!(system) end sizes_u = (u_nvariables(system) * n_moving_particles(system) for system in systems) @@ -353,6 +338,8 @@ function restart_with!(semi, sol; reset_threads=true) Polyester.reset_threads!() end + initialize_neighborhood_searches!(semi) + foreach_system(semi) do system v = wrap_v(sol.u[end].x[1], system, semi) u = wrap_u(sol.u[end].x[2], system, semi) @@ -366,6 +353,18 @@ function restart_with!(semi, sol; reset_threads=true) return semi end +function initialize_neighborhood_searches!(semi) + foreach_system(semi) do system + foreach_system(semi) do neighbor + PointNeighbors.initialize!(get_neighborhood_search(system, neighbor, semi), + initial_coordinates(system), + initial_coordinates(neighbor)) + end + end + + return semi +end + # We have to pass `system` here for type stability, # since the type of `system` determines the return type. @inline function wrap_v(v_ode, system, semi) @@ -648,7 +647,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(true, true)) + points_moving=(true, true)) end function update_nhs!(neighborhood_search, @@ -658,7 +657,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(true, neighbor.ismoving[])) + points_moving=(true, neighbor.ismoving[])) end function update_nhs!(neighborhood_search, @@ -671,7 +670,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(true, true)) + points_moving=(true, true)) end function update_nhs!(neighborhood_search, @@ -684,7 +683,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(true, true)) + points_moving=(true, true)) end function update_nhs!(neighborhood_search, @@ -694,7 +693,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(true, true)) + points_moving=(true, true)) end function update_nhs!(neighborhood_search, @@ -712,7 +711,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(true, neighbor.ismoving[])) + points_moving=(true, neighbor.ismoving[])) end function update_nhs!(neighborhood_search, @@ -738,7 +737,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(system.ismoving[], true)) + points_moving=(system.ismoving[], true)) end function update_nhs!(neighborhood_search, @@ -750,7 +749,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(system.ismoving[], neighbor.ismoving[])) + points_moving=(system.ismoving[], neighbor.ismoving[])) end function update_nhs!(neighborhood_search, @@ -760,7 +759,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(true, true)) + points_moving=(true, true)) end function update_nhs!(neighborhood_search, @@ -770,7 +769,7 @@ function update_nhs!(neighborhood_search, PointNeighbors.update!(neighborhood_search, current_coordinates(u_system, system), current_coordinates(u_neighbor, neighbor), - particles_moving=(true, false)) + points_moving=(true, false)) end function update_nhs!(neighborhood_search, diff --git a/src/schemes/boundary/dummy_particles/dummy_particles.jl b/src/schemes/boundary/dummy_particles/dummy_particles.jl index 3e3abcbd9..cd09fb50a 100644 --- a/src/schemes/boundary/dummy_particles/dummy_particles.jl +++ b/src/schemes/boundary/dummy_particles/dummy_particles.jl @@ -393,12 +393,9 @@ end neighborhood_search) (; pressure, cache, viscosity) = boundary_model - for_particle_neighbor(neighbor_system, system, - neighbor_coords, system_coords, - neighborhood_search; - particles=eachparticle(neighbor_system), - parallel=false) do neighbor, particle, - pos_diff, distance + foreach_point_neighbor(neighbor_system, system, neighbor_coords, system_coords, + neighborhood_search; points=eachparticle(neighbor_system), + parallel=false) do neighbor, particle, pos_diff, distance # Since neighbor and particle are switched pos_diff = -pos_diff adami_pressure_inner!(boundary_model, system, neighbor_system::FluidSystem, @@ -422,11 +419,10 @@ end (; pressure, cache, viscosity) = boundary_model # Loop over all pairs of particles and neighbors within the kernel cutoff. - for_particle_neighbor(system, neighbor_system, - system_coords, neighbor_coords, - neighborhood_search; - particles=eachparticle(system)) do particle, neighbor, - pos_diff, distance + foreach_point_neighbor(system, neighbor_system, system_coords, neighbor_coords, + neighborhood_search; + points=eachparticle(system)) do particle, neighbor, + pos_diff, distance adami_pressure_inner!(boundary_model, system, neighbor_system, v_neighbor_system, particle, neighbor, pos_diff, distance, viscosity, cache, pressure) diff --git a/src/schemes/boundary/open_boundary/system.jl b/src/schemes/boundary/open_boundary/system.jl index 8c580cf44..9499fae1b 100644 --- a/src/schemes/boundary/open_boundary/system.jl +++ b/src/schemes/boundary/open_boundary/system.jl @@ -281,8 +281,8 @@ function evaluate_characteristics!(system, neighbor_system::FluidSystem, neighbor_coords = current_coordinates(u_neighbor_system, neighbor_system) # Loop over all fluid neighbors within the kernel cutoff - for_particle_neighbor(system, neighbor_system, system_coords, neighbor_coords, - nhs) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(system, neighbor_system, system_coords, neighbor_coords, + nhs) do particle, neighbor, pos_diff, distance neighbor_position = current_coords(u_neighbor_system, neighbor_system, neighbor) # Determine current and prescribed quantities diff --git a/src/schemes/boundary/rhs.jl b/src/schemes/boundary/rhs.jl index d9cfb1779..59f634092 100644 --- a/src/schemes/boundary/rhs.jl +++ b/src/schemes/boundary/rhs.jl @@ -19,9 +19,8 @@ function interact!(dv, v_particle_system, u_particle_system, neighbor_coords = current_coordinates(u_neighbor_system, neighbor_system) # Loop over all pairs of particles and neighbors within the kernel cutoff. - for_particle_neighbor(particle_system, neighbor_system, - system_coords, neighbor_coords, - neighborhood_search) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(particle_system, neighbor_system, system_coords, neighbor_coords, + neighborhood_search) do particle, neighbor, pos_diff, distance m_b = hydrodynamic_mass(neighbor_system, neighbor) rho_a = particle_density(v_particle_system, particle_system, particle) diff --git a/src/schemes/fluid/entropically_damped_sph/rhs.jl b/src/schemes/fluid/entropically_damped_sph/rhs.jl index 16ca94ec0..69525671e 100644 --- a/src/schemes/fluid/entropically_damped_sph/rhs.jl +++ b/src/schemes/fluid/entropically_damped_sph/rhs.jl @@ -9,9 +9,9 @@ function interact!(dv, v_particle_system, u_particle_system, neighbor_coords = current_coordinates(u_neighbor_system, neighbor_system) # Loop over all pairs of particles and neighbors within the kernel cutoff. - for_particle_neighbor(particle_system, neighbor_system, - system_coords, neighbor_coords, - neighborhood_search) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(particle_system, neighbor_system, + system_coords, neighbor_coords, + neighborhood_search) do particle, neighbor, pos_diff, distance # Only consider particles with a distance > 0. distance < sqrt(eps()) && return diff --git a/src/schemes/fluid/surface_tension.jl b/src/schemes/fluid/surface_tension.jl index 69e468cd7..fc699e506 100644 --- a/src/schemes/fluid/surface_tension.jl +++ b/src/schemes/fluid/surface_tension.jl @@ -113,9 +113,9 @@ function calc_normal_akinci!(system, neighbor_system::FluidSystem, system_coords = current_coordinates(u_system, system) neighbor_system_coords = current_coordinates(u_neighbor_system, neighbor_system) - for_particle_neighbor(system, neighbor_system, - system_coords, neighbor_system_coords, - neighborhood_search) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(system, neighbor_system, + system_coords, neighbor_system_coords, + neighborhood_search) do particle, neighbor, pos_diff, distance m_b = hydrodynamic_mass(neighbor_system, neighbor) density_neighbor = particle_density(v_neighbor_system, neighbor_system, neighbor) diff --git a/src/schemes/fluid/weakly_compressible_sph/density_diffusion.jl b/src/schemes/fluid/weakly_compressible_sph/density_diffusion.jl index 716245be8..c589d34e9 100644 --- a/src/schemes/fluid/weakly_compressible_sph/density_diffusion.jl +++ b/src/schemes/fluid/weakly_compressible_sph/density_diffusion.jl @@ -201,8 +201,8 @@ function update!(density_diffusion::DensityDiffusionAntuono, neighborhood_search # Compute normalized density gradient set_zero!(normalized_density_gradient) - for_particle_neighbor(system, system, system_coords, system_coords, - neighborhood_search) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(system, system, system_coords, system_coords, + neighborhood_search) do particle, neighbor, pos_diff, distance # Only consider particles with a distance > 0 distance < sqrt(eps()) && return diff --git a/src/schemes/fluid/weakly_compressible_sph/rhs.jl b/src/schemes/fluid/weakly_compressible_sph/rhs.jl index 5f1c41912..a7c8d05ca 100644 --- a/src/schemes/fluid/weakly_compressible_sph/rhs.jl +++ b/src/schemes/fluid/weakly_compressible_sph/rhs.jl @@ -20,9 +20,9 @@ function interact!(dv, v_particle_system, u_particle_system, # debug_array = zeros(ndims(particle_system), nparticles(particle_system)) # Loop over all pairs of particles and neighbors within the kernel cutoff. - for_particle_neighbor(particle_system, neighbor_system, - system_coords, neighbor_system_coords, - neighborhood_search) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(particle_system, neighbor_system, + system_coords, neighbor_system_coords, + neighborhood_search) do particle, neighbor, pos_diff, distance rho_a = particle_density(v_particle_system, particle_system, particle) rho_b = particle_density(v_neighbor_system, neighbor_system, neighbor) rho_mean = 0.5 * (rho_a + rho_b) diff --git a/src/schemes/solid/discrete_element_method/rhs.jl b/src/schemes/solid/discrete_element_method/rhs.jl index 0362c3a04..2d1ed2daf 100644 --- a/src/schemes/solid/discrete_element_method/rhs.jl +++ b/src/schemes/solid/discrete_element_method/rhs.jl @@ -16,8 +16,8 @@ function interact!(dv, v_particle_system, u_particle_system, v_neighbor_system, system_coords = current_coordinates(u_particle_system, particle_system) neighbor_coords = current_coordinates(u_neighbor_system, neighbor_system) - for_particle_neighbor(particle_system, neighbor_system, system_coords, neighbor_coords, - neighborhood_search) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(particle_system, neighbor_system, system_coords, neighbor_coords, + neighborhood_search) do particle, neighbor, pos_diff, distance m_a = particle_system.mass[particle] r_a = particle_system.radius[particle] diff --git a/src/schemes/solid/total_lagrangian_sph/rhs.jl b/src/schemes/solid/total_lagrangian_sph/rhs.jl index 36c8fd286..a44668415 100644 --- a/src/schemes/solid/total_lagrangian_sph/rhs.jl +++ b/src/schemes/solid/total_lagrangian_sph/rhs.jl @@ -22,10 +22,9 @@ end # Loop over all pairs of particles and neighbors within the kernel cutoff. # For solid-solid interaction, this has to happen in the initial coordinates. - for_particle_neighbor(particle_system, neighbor_system, - system_coords, neighbor_coords, - neighborhood_search) do particle, neighbor, initial_pos_diff, - initial_distance + foreach_point_neighbor(particle_system, neighbor_system, system_coords, neighbor_coords, + neighborhood_search) do particle, neighbor, initial_pos_diff, + initial_distance # Only consider particles with a distance > 0. initial_distance < sqrt(eps()) && return @@ -68,9 +67,8 @@ function interact!(dv, v_particle_system, u_particle_system, neighbor_coords = current_coordinates(u_neighbor_system, neighbor_system) # Loop over all pairs of particles and neighbors within the kernel cutoff. - for_particle_neighbor(particle_system, neighbor_system, - system_coords, neighbor_coords, - neighborhood_search) do particle, neighbor, pos_diff, distance + foreach_point_neighbor(particle_system, neighbor_system, system_coords, neighbor_coords, + neighborhood_search) do particle, neighbor, pos_diff, distance # Only consider particles with a distance > 0. distance < sqrt(eps()) && return diff --git a/src/schemes/solid/total_lagrangian_sph/system.jl b/src/schemes/solid/total_lagrangian_sph/system.jl index 125bb5507..5f86c67a1 100644 --- a/src/schemes/solid/total_lagrangian_sph/system.jl +++ b/src/schemes/solid/total_lagrangian_sph/system.jl @@ -274,12 +274,11 @@ end # Loop over all pairs of particles and neighbors within the kernel cutoff. initial_coords = initial_coordinates(system) - for_particle_neighbor(system, system, - initial_coords, initial_coords, - neighborhood_search; - particles=eachparticle(system)) do particle, neighbor, - initial_pos_diff, - initial_distance + foreach_point_neighbor(system, system, initial_coords, initial_coords, + neighborhood_search; + points=eachparticle(system)) do particle, neighbor, + initial_pos_diff, + initial_distance # Only consider particles with a distance > 0. initial_distance < sqrt(eps()) && return diff --git a/test/count_allocations.jl b/test/count_allocations.jl index 5957bc67a..b8c3849a7 100644 --- a/test/count_allocations.jl +++ b/test/count_allocations.jl @@ -1,4 +1,4 @@ -# Wrapper for any neighborhood search that forwards `for_particle_neighbor` to the wrapped +# Wrapper for any neighborhood search that forwards `foreach_point_neighbor` to the wrapped # neighborhood search, but doesn't do anything in the update step. # This is used in the example tests to test for zero allocations in the `kick!` function. struct NoUpdateNeighborhoodSearch{NHS} @@ -30,7 +30,7 @@ end # No update @inline function TrixiParticles.PointNeighbors.update!(search::NoUpdateNeighborhoodSearch, x, y; - particles_moving=(true, true)) + points_moving=(true, true)) return search end diff --git a/test/general/interpolation.jl b/test/general/interpolation.jl index 899e60528..44ecf23db 100644 --- a/test/general/interpolation.jl +++ b/test/general/interpolation.jl @@ -121,10 +121,10 @@ v_bnd = vcat(v_bnd_velocity, v_bnd_density') - semi_no_boundary = Semidiscretization(fluid_system, - neighborhood_search=GridNeighborhoodSearch) - semi_boundary = Semidiscretization(fluid_system, boundary_system, - neighborhood_search=GridNeighborhoodSearch) + semi_no_boundary = Semidiscretization(fluid_system) + TrixiParticles.initialize_neighborhood_searches!(semi_no_boundary) + semi_boundary = Semidiscretization(fluid_system, boundary_system) + TrixiParticles.initialize_neighborhood_searches!(semi_boundary) # some simple results expected_zero(y) = (density=NaN, neighbor_count=0, coord=[0.0, y], @@ -827,10 +827,10 @@ v_bnd = vcat(v_bnd_velocity, v_bnd_density') - semi_no_boundary = Semidiscretization(fluid_system, - neighborhood_search=GridNeighborhoodSearch) - semi_boundary = Semidiscretization(fluid_system, boundary_system, - neighborhood_search=GridNeighborhoodSearch) + semi_no_boundary = Semidiscretization(fluid_system) + TrixiParticles.initialize_neighborhood_searches!(semi_no_boundary) + semi_boundary = Semidiscretization(fluid_system, boundary_system) + TrixiParticles.initialize_neighborhood_searches!(semi_boundary) # some simple results expected_zero(y) = (density=NaN, neighbor_count=0, coord=[0.0, y, 0.0], diff --git a/test/general/semidiscretization.jl b/test/general/semidiscretization.jl index 457b5b84d..bdcba9d92 100644 --- a/test/general/semidiscretization.jl +++ b/test/general/semidiscretization.jl @@ -32,10 +32,14 @@ @test semi.ranges_u == (1:6, 7:18) @test semi.ranges_v == (1:6, 7:12) - nhs = ((TrixiParticles.TrivialNeighborhoodSearch{3}(0.2, Base.OneTo(2)), - TrixiParticles.TrivialNeighborhoodSearch{3}(0.2, Base.OneTo(3))), - (TrixiParticles.TrivialNeighborhoodSearch{3}(0.2, Base.OneTo(2)), - TrixiParticles.TrivialNeighborhoodSearch{3}(0.2, Base.OneTo(3)))) + nhs = ((TrixiParticles.TrivialNeighborhoodSearch{3}(search_radius=0.2, + eachpoint=1:2), + TrixiParticles.TrivialNeighborhoodSearch{3}(search_radius=0.2, + eachpoint=1:3)), + (TrixiParticles.TrivialNeighborhoodSearch{3}(search_radius=0.2, + eachpoint=1:2), + TrixiParticles.TrivialNeighborhoodSearch{3}(search_radius=0.2, + eachpoint=1:3))) @test semi.neighborhood_searches == nhs end diff --git a/test/schemes/boundary/dummy_particles/dummy_particles.jl b/test/schemes/boundary/dummy_particles/dummy_particles.jl index 5dbd7c0a3..27caa0293 100644 --- a/test/schemes/boundary/dummy_particles/dummy_particles.jl +++ b/test/schemes/boundary/dummy_particles/dummy_particles.jl @@ -43,8 +43,8 @@ state_equation, smoothing_kernel, smoothing_length) - neighborhood_search = TrixiParticles.TrivialNeighborhoodSearch{2}(1.0, - TrixiParticles.eachparticle(fluid_system)) + neighborhood_search = TrixiParticles.TrivialNeighborhoodSearch{2}(search_radius=1.0, + eachpoint=TrixiParticles.eachparticle(fluid_system)) velocities = [[0; -1], [1; 1], [-1; 0], [0.7; 0.2], [0.3; 0.8]] diff --git a/test/schemes/boundary/dummy_particles/rhs.jl b/test/schemes/boundary/dummy_particles/rhs.jl index b3eb0d365..ca5d15856 100644 --- a/test/schemes/boundary/dummy_particles/rhs.jl +++ b/test/schemes/boundary/dummy_particles/rhs.jl @@ -170,15 +170,15 @@ state_equation, smoothing_kernel, smoothing_length) - nhs = TrixiParticles.TrivialNeighborhoodSearch{2}(search_radius, - TrixiParticles.eachparticle(fluid_system)) + nhs = TrixiParticles.TrivialNeighborhoodSearch{2}(; search_radius, + eachpoint=TrixiParticles.eachparticle(fluid_system)) @testset "$key" for key in keys(systems) neighbor_system = systems[key] v_neighbor, u_neighbor = vu[key] - nhs2 = TrixiParticles.TrivialNeighborhoodSearch{2}(search_radius, - TrixiParticles.eachparticle(neighbor_system)) + nhs2 = TrixiParticles.TrivialNeighborhoodSearch{2}(; search_radius, + eachpoint=TrixiParticles.eachparticle(neighbor_system)) # Compute interactions dv = zero(v) diff --git a/test/schemes/boundary/monaghan_kajtar/monaghan_kajtar.jl b/test/schemes/boundary/monaghan_kajtar/monaghan_kajtar.jl index c3783af8b..c16972717 100644 --- a/test/schemes/boundary/monaghan_kajtar/monaghan_kajtar.jl +++ b/test/schemes/boundary/monaghan_kajtar/monaghan_kajtar.jl @@ -44,8 +44,8 @@ v_neighbor = zeros(0, TrixiParticles.nparticles(boundary_system)) u_neighbor = boundary.coordinates - nhs = TrixiParticles.TrivialNeighborhoodSearch{2}(search_radius, - TrixiParticles.eachparticle(boundary_system)) + nhs = TrixiParticles.TrivialNeighborhoodSearch{2}(; search_radius, + eachpoint=TrixiParticles.eachparticle(boundary_system)) # Result dv = zero(fluid.velocity) diff --git a/test/schemes/fluid/rhs.jl b/test/schemes/fluid/rhs.jl index 805d22c66..2133b9c7c 100644 --- a/test/schemes/fluid/rhs.jl +++ b/test/schemes/fluid/rhs.jl @@ -151,8 +151,8 @@ end end - nhs = TrixiParticles.TrivialNeighborhoodSearch{2}(search_radius, - TrixiParticles.eachparticle(system)) + nhs = TrixiParticles.TrivialNeighborhoodSearch{2}(; search_radius, + eachpoint=TrixiParticles.eachparticle(system)) # Result dv = zero(v) diff --git a/test/schemes/solid/total_lagrangian_sph/rhs.jl b/test/schemes/solid/total_lagrangian_sph/rhs.jl index b64fb6c97..e03b43206 100644 --- a/test/schemes/solid/total_lagrangian_sph/rhs.jl +++ b/test/schemes/solid/total_lagrangian_sph/rhs.jl @@ -98,11 +98,10 @@ # Mock the neighborhood search nhs = Val{:nhs}() TrixiParticles.PointNeighbors.eachneighbor(_, ::Val{:nhs}) = eachneighbor + TrixiParticles.PointNeighbors.search_radius(::Val{:nhs}) = 100.0 function Base.getproperty(::Val{:nhs}, f::Symbol) - if f === :search_radius - return 100.0 - elseif f === :periodic_box_size + if f === :periodic_box return nothing end diff --git a/test/systems/solid_system.jl b/test/systems/solid_system.jl index 369022273..2ee78c523 100644 --- a/test/systems/solid_system.jl +++ b/test/systems/solid_system.jl @@ -154,11 +154,10 @@ end TrixiParticles.PointNeighbors.eachneighbor(_, ::Val{:nhs}) = neighbors + TrixiParticles.PointNeighbors.search_radius(::Val{:nhs}) = Inf function Base.getproperty(::Val{:nhs}, f::Symbol) - if f === :search_radius - return Inf - elseif f === :periodic_box_size + if f === :periodic_box return nothing end @@ -216,8 +215,8 @@ initial_condition = InitialCondition(; coordinates, mass, density) system = TotalLagrangianSPHSystem(initial_condition, smoothing_kernel, smoothing_length, 1.0, 1.0) - nhs = TrixiParticles.TrivialNeighborhoodSearch{2}(1.0, - TrixiParticles.eachparticle(system)) + nhs = TrixiParticles.TrivialNeighborhoodSearch{2}(search_radius=1.0, + eachpoint=TrixiParticles.eachparticle(system)) TrixiParticles.initialize!(system, nhs) diff --git a/validation/dam_break_2d/validation_dam_break_2d.jl b/validation/dam_break_2d/validation_dam_break_2d.jl index bfe216fde..0bf776514 100644 --- a/validation/dam_break_2d/validation_dam_break_2d.jl +++ b/validation/dam_break_2d/validation_dam_break_2d.jl @@ -105,7 +105,7 @@ trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "dam_break_2d.jl"), solution_prefix="validation_" * method * "_" * formatted_string, extra_callback=postprocessing_cb, tspan=tspan, fluid_system=fluid_system_edac, tank=tank_edac, - threaded_nhs_update=false) # To get the same results with different thread numbers + threaded_update=false) # To get the same results with different thread numbers reference_file_edac_name = joinpath(validation_dir(), "dam_break_2d", "validation_reference_edac_$formatted_string.json") @@ -140,7 +140,7 @@ trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "dam_break_2d.jl"), boundary_layers=4, solution_prefix="validation_" * method * "_" * formatted_string, extra_callback=postprocessing_cb, tspan=tspan, - threaded_nhs_update=false) # To get the same results with different thread numbers + threaded_update=false) # To get the same results with different thread numbers reference_file_wcsph_name = joinpath(validation_dir(), "dam_break_2d", "validation_reference_wcsph_$formatted_string.json") From dbc07c35b0d4affcb2bc25515a74c86059749cc1 Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Thu, 27 Jun 2024 13:49:00 +0200 Subject: [PATCH 2/4] Prepare Release 0.2 (#557) * Prepare Release 0.2 * Set Version Number * Change wording * Change formatting * Review comment Co-authored-by: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> * Formatting --------- Co-authored-by: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> --- NEWS.md | 30 ++++++++++++++++-------------- Project.toml | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5d7a295d8..3d9f99059 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ TrixiParticles.jl follows the interpretation of [semantic versioning (semver)](h used in the Julia ecosystem. Notable changes will be documented in this file for human readability. We aim at 3 to 4 month between major release versions and about 2 weeks between minor versions. -## Version 0.2.x +## Version 0.3.x ### Highlights @@ -14,32 +14,34 @@ We aim at 3 to 4 month between major release versions and about 2 weeks between ### Deprecated -## Version 0.1.3 +## Version 0.2.0 -### Added -Open boundaries using the method of characteristics based on the work of Lastiwka et al., "Permeable and non-reflecting boundary conditions in SPH" (2009) were added for WCSPH and EDAC. - -## Version 0.1.2 +### Removed +- Use of the internal neighborhood search has been removed and replaced with PointNeighbors.jl. -### Added -A surface tension and adhesion model based on the work by Akinci et al., "Versatile Surface Tension and Adhesion for SPH Fluids" (2013) was added to WCSPH. -## Version 0.1.1 +## Development Cycle 0.1 ### Highlights #### Discrete Element Method A basic implementation of the discrete element method was added. -# Pre Initial Release (v0.1.0) +#### Surface Tension and Adhesion Model +A surface tension and adhesion model based on the work by Akinci et al., "Versatile Surface Tension and Adhesion for SPH Fluids" (2013) was added to WCSPH. + +#### Support for Open Boundaries +Open boundaries using the method of characteristics based on the work of Lastiwka et al., "Permeable and non-reflecting boundary conditions in SPH" (2009) were added for WCSPH and EDAC. + +## Pre Initial Release (v0.1.0) This section summarizes the initial features that TrixiParticles.jl was released with. -## Highlights -### EDAC +### Highlights +#### EDAC An implementation of EDAC (Entropically Damped Artificial Compressibility) was added, which allows for more stable simulations compared to basic WCSPH and reduces spurious pressure oscillations. -### WCSPH +#### WCSPH An implementation of WCSPH (Weakly Compressible Smoothed Particle Hydrodynamics), which is the classical SPH approach. Features: @@ -51,5 +53,5 @@ Features: - Density diffusion based on the models by Molteni & Colagrossi (2009), Ferrari et al. (2009) and Antuono et al. (2010). -### TLSPH +#### TLSPH An implementation of TLSPH (Total Lagrangian Smoothed Particle Hydrodynamics) for solid bodies enabling FSI (Fluid Structure Interactions). diff --git a/Project.toml b/Project.toml index 667a4b6c8..fd65693b0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TrixiParticles" uuid = "66699cd8-9c01-4e9d-a059-b96c86d16b3a" authors = ["erik.faulhaber <44124897+efaulhaber@users.noreply.github.com>"] -version = "0.1.4-dev" +version = "0.2.0" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" From 5e4ccb4d4d53d582e3f7d1ea15f2c56f0185e866 Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:38:00 +0200 Subject: [PATCH 3/4] Use new v0.4 release of PointNeighbors.jl (#562) * Use PointNeighbors v0.4 * Apply new changes * Fix docs * Update validation files The new version of PointNeighbors.jl changed the particles ordering in the neighborhood search. * Why did this file change again? * Update WCSPH validation files due to viscosity reformulation * Update validation files on a single thread * Increase tolerances for Julia 1.9 --- Project.toml | 2 +- docs/Project.toml | 2 +- examples/fluid/dam_break_2d.jl | 4 +- src/TrixiParticles.jl | 3 +- src/general/semidiscretization.jl | 2 +- test/validation/validation.jl | 4 +- .../dam_break_2d/validation_dam_break_2d.jl | 4 +- .../validation_reference_edac_0001875.json | 510 ++++++++--------- .../validation_reference_edac_00075.json | 464 +++++++-------- .../validation_reference_edac_0015.json | 412 +++++++------- .../validation_reference_wcsph_0001875.json | 526 +++++++++--------- .../validation_reference_wcsph_00075.json | 478 ++++++++-------- .../validation_reference_wcsph_0015.json | 426 +++++++------- 13 files changed, 1420 insertions(+), 1417 deletions(-) diff --git a/Project.toml b/Project.toml index fd65693b0..8c35140b3 100644 --- a/Project.toml +++ b/Project.toml @@ -39,7 +39,7 @@ GPUArrays = "9, 10" JSON = "0.21" KernelAbstractions = "0.9" MuladdMacro = "0.2" -PointNeighbors = "0.3" +PointNeighbors = "0.4" Polyester = "0.7.5" RecipesBase = "1" Reexport = "1" diff --git a/docs/Project.toml b/docs/Project.toml index 80e978d76..dd77843a1 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -7,5 +7,5 @@ TrixiBase = "9a0f1c46-06d5-4909-a5a3-ce25d3fa3284" [compat] Documenter = "1" OrdinaryDiffEq = "6" -PointNeighbors = "0.3" +PointNeighbors = "0.4" TrixiBase = "0.1" diff --git a/examples/fluid/dam_break_2d.jl b/examples/fluid/dam_break_2d.jl index 782bdd372..117dde772 100644 --- a/examples/fluid/dam_break_2d.jl +++ b/examples/fluid/dam_break_2d.jl @@ -76,8 +76,10 @@ boundary_system = BoundarySPHSystem(tank.boundary, boundary_model, adhesion_coef # ========================================================================================== # ==== Simulation +# `nothing` will automatically choose the best update strategy. This is only to be able +# to change this with `trixi_include`. semi = Semidiscretization(fluid_system, boundary_system, - neighborhood_search=GridNeighborhoodSearch{2}(threaded_update=true)) + neighborhood_search=GridNeighborhoodSearch{2}(update_strategy=nothing)) ode = semidiscretize(semi, tspan, data_type=nothing) info_callback = InfoCallback(interval=100) diff --git a/src/TrixiParticles.jl b/src/TrixiParticles.jl index 4a3f64144..e7e016a0b 100644 --- a/src/TrixiParticles.jl +++ b/src/TrixiParticles.jl @@ -26,7 +26,8 @@ using TimerOutputs: TimerOutput, TimerOutputs, print_timer, reset_timer! using TrixiBase: trixi_include, @trixi_timeit, timer, timeit_debug_enabled, disable_debug_timings, enable_debug_timings @reexport using PointNeighbors: TrivialNeighborhoodSearch, GridNeighborhoodSearch, - PrecomputedNeighborhoodSearch, PeriodicBox + PrecomputedNeighborhoodSearch, PeriodicBox, + ParallelUpdate, SemiParallelUpdate, SerialUpdate using PointNeighbors: PointNeighbors, foreach_point_neighbor, copy_neighborhood_search using WriteVTK: vtk_grid, MeshCell, VTKCellTypes, paraview_collection, vtk_save diff --git a/src/general/semidiscretization.jl b/src/general/semidiscretization.jl index f46ca3cea..ff17cc401 100644 --- a/src/general/semidiscretization.jl +++ b/src/general/semidiscretization.jl @@ -24,7 +24,7 @@ The semidiscretization couples the passed systems to one simulation. semi = Semidiscretization(fluid_system, boundary_system) semi = Semidiscretization(fluid_system, boundary_system, - neighborhood_search=GridNeighborhoodSearch{2}(threaded_update=false)) + neighborhood_search=GridNeighborhoodSearch{2}(update_strategy=SerialUpdate())) periodic_box = PeriodicBox(min_corner = [0.0, 0.0], max_corner = [1.0, 1.0]) semi = Semidiscretization(fluid_system, boundary_system, diff --git a/test/validation/validation.jl b/test/validation/validation.jl index c5aa9bed1..1ee36f1bd 100644 --- a/test/validation/validation.jl +++ b/test/validation/validation.jl @@ -56,8 +56,8 @@ # 1.9 causes a large difference in the solution @test isapprox(error_edac_P1, 0, atol=4e-9) @test isapprox(error_edac_P2, 0, atol=3e-11) - @test isapprox(error_wcsph_P1, 0, atol=5.1) - @test isapprox(error_wcsph_P2, 0, atol=6e-4) + @test isapprox(error_wcsph_P1, 0, atol=26.3) + @test isapprox(error_wcsph_P2, 0, atol=8.2e-3) end # Ignore method redefinitions from duplicate `include("../validation_util.jl")` diff --git a/validation/dam_break_2d/validation_dam_break_2d.jl b/validation/dam_break_2d/validation_dam_break_2d.jl index 0bf776514..781b2e235 100644 --- a/validation/dam_break_2d/validation_dam_break_2d.jl +++ b/validation/dam_break_2d/validation_dam_break_2d.jl @@ -105,7 +105,7 @@ trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "dam_break_2d.jl"), solution_prefix="validation_" * method * "_" * formatted_string, extra_callback=postprocessing_cb, tspan=tspan, fluid_system=fluid_system_edac, tank=tank_edac, - threaded_update=false) # To get the same results with different thread numbers + update_strategy=SerialUpdate()) # To get the same results with different thread numbers reference_file_edac_name = joinpath(validation_dir(), "dam_break_2d", "validation_reference_edac_$formatted_string.json") @@ -140,7 +140,7 @@ trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "dam_break_2d.jl"), boundary_layers=4, solution_prefix="validation_" * method * "_" * formatted_string, extra_callback=postprocessing_cb, tspan=tspan, - threaded_update=false) # To get the same results with different thread numbers + update_strategy=SerialUpdate()) # To get the same results with different thread numbers reference_file_wcsph_name = joinpath(validation_dir(), "dam_break_2d", "validation_reference_wcsph_$formatted_string.json") diff --git a/validation/dam_break_2d/validation_reference_edac_0001875.json b/validation/dam_break_2d/validation_reference_edac_0001875.json index c0bd126da..41a8bf7ea 100644 --- a/validation/dam_break_2d/validation_reference_edac_0001875.json +++ b/validation/dam_break_2d/validation_reference_edac_0001875.json @@ -136,82 +136,82 @@ 0.0, 0.0, 0.0, - 12.7359793055971, - 28.5145237236281, - 121.18168891145856, - 316.403957811798, - 672.8347524740096, - 975.7435164971901, - 1234.7711524201573, - 1267.680802913088, - 1325.9539878370165, - 1369.2759819671567, - 1350.4045030210407, - 1486.383129259401, - 1533.1394246949553, - 1660.155468017621, - 1743.1540612366239, - 1883.4808330153646, - 1968.8761154337378, - 2055.5802596756357, - 2272.252411907779, - 2325.017625624002, - 2344.031120910614, - 2339.1747220108127, - 2554.788413947325, - 2558.8206401087564, - 2561.4739343811502, - 2673.201703494265, - 2687.0498811013213, - 2665.652476816712, - 2796.719586397012, - 2690.6854597061447, - 2823.976655280274, - 2773.888397659288, - 2770.7246352561287, - 2733.8073822998463, - 2791.441447325751, - 2758.279567000115, - 2775.3420612807868, - 2754.1897112804113, - 2780.4439704978495, - 2832.8226883106045, - 2832.207096183353, - 2919.172692602965, - 2978.1005453219236, - 3055.533747183998, - 3115.2877143793003, - 3304.5758576941566, - 3716.945192978689, - 4139.041856711153, - 5089.9979516091435, - 6784.711878272115, - 5398.159733462215, - 5383.433219097706, - 5694.021068009453, - 5567.551168262456, - 5700.433087898954, - 6512.9993263423485, - 6921.981388579496, - 2126.342769759701, - 4818.481846720581, - 2147.0886483178983, - 2035.776595240432, - 3286.8706549891367, - 0.0, - 183.40990436617943, - 0.0, - 240.28213505770492, - 23.58938714055236, - 8.693169047793514, - 45.131256074044394 + 12.736840085421914, + 28.628100485652606, + 122.71865172068017, + 324.27254166847194, + 685.5542054581504, + 1133.3787741518424, + 1272.9196223841059, + 1205.6606366511057, + 1282.8657317481886, + 1405.362784590534, + 1396.5283780873165, + 1488.1316296753364, + 1536.1579676620856, + 1670.3583863982553, + 1728.632083147789, + 1855.2384199353032, + 1989.4814937740816, + 2054.0238355238357, + 2183.9111378957914, + 2381.765348706054, + 2355.8146450225713, + 2386.2140165667206, + 2481.631523082117, + 2599.6111347484234, + 2623.7290783937888, + 2754.78453934731, + 2649.035483033186, + 2725.2473662758557, + 2790.437131872496, + 2681.887960780906, + 2750.812320584928, + 2754.703961387948, + 2773.612959151713, + 2776.7306825346695, + 2751.339559192257, + 2785.1560839453305, + 2778.021140300848, + 2771.755429087722, + 2829.0579640012393, + 2850.9449438983365, + 2844.9097325808707, + 2887.2017549313596, + 2956.6521229610985, + 3014.3267471763784, + 3105.8349209876287, + 3298.7094758247176, + 3735.51074623829, + 4162.421408493722, + 5009.413775997748, + 6809.442956700383, + 5392.803555946759, + 5527.88459219727, + 5741.4939886871425, + 5609.980114950942, + 5748.8867953290355, + 6471.826741585565, + 6225.391721185074, + 886.0445555451977, + 5551.908731983118, + 4438.260748317018, + 878.6935713725804, + 0.0, + 0.0, + 0.0, + 0.0, + 5.061955287755948, + 4.785640067713782, + 31.418815161718168, + 65.68332044650239 ], "datatype": "Float64", "type": "series" }, "meta": { - "julia_version": "1.10.2", - "solver_version": "98fe4b85-dirty", + "julia_version": "1.10.4", + "solver_version": "v0.1.3-10-g2f325806-dirty", "solver_name": "TrixiParticles.jl" }, "pressure_P2_fluid_1": { @@ -355,57 +355,57 @@ 0.0, 0.0, 0.0, - 21.472697885978445, - 10.036855178405164, - 17.953156099725824, - 11.193310410622063, - 15.83130169456302, - 28.300612730060152, - 23.415266211843004, - 7.8618294949455905, - 19.77745609502992, - 6.78805576189078, - 16.60577689715863, - 15.765413654803334, - 9.60572951183119, - 38.139007072131825, - 31.696665025734763, - 77.87194738026172, - 163.8658377974792, - 180.69274449627062, - 222.54545096994465, - 267.3263578713369, - 286.5018951603133, - 384.4746403145662, - 445.98342590607035, - 575.2469414095979, - 596.268916294803, - 753.3967517055345, - 846.4516642336127, - 905.705056613858, - 1027.3067437018638, - 1133.7076645333389, - 1261.3890568617142, - 1368.9933149540043, - 1451.027232035189, - 1534.1833594826799, - 1613.4690245827069, - 1676.8665162894079, - 1697.3325324590646, - 1748.1514300345352, - 1747.3641613490236, - 1857.658956085584, - 1431.5179859919629, - 345.7287754717464, - 22.280850379549335, - 13.04647104615773, - 19.835843255318192, - 7.334800977648827, - 2.2899246175283445, - 5.707395070400249, + 21.472996681628498, + 10.193260753130115, + 17.865007630804282, + 11.229837551749172, + 14.490520145031502, + 19.20542552285194, + 19.99389349817493, + 9.259228271354575, + 7.626072569034855, + 6.736695573099856, + 12.232675399537833, + 12.263597665426058, + 17.345917766943142, + 46.55077692749975, + 61.29609771133215, + 91.57521135750143, + 100.10234671719411, + 164.28420984642503, + 193.49098258524631, + 259.2646609623567, + 334.4183192865687, + 356.8829026836604, + 460.0385788810519, + 547.464398189432, + 633.4421368885535, + 707.0875419284241, + 825.3368112353385, + 931.8129697133588, + 1048.663926593065, + 1156.1864892791793, + 1294.0666237046003, + 1386.6666086524551, + 1464.4060717572097, + 1551.3916924787084, + 1604.553555466358, + 1646.7606306716232, + 1687.6678764297853, + 1718.3763110224002, + 1743.6418841230268, + 1779.129682129691, + 1415.3088902319982, + 345.74757029098924, + 10.878755871768012, + 11.209408212993342, + 25.704687839007317, + 6.453412241122686, + 2.039154044216059, + 6.235238244413134, 0.0, 0.0, - 7.462732625470549, + 7.815597291626832, 0.0, 0.0, 0.0, @@ -536,100 +536,100 @@ 1.2530386861909606, 1.288380049164496, 1.3296514917312396, - 1.3761229671532695, - 1.4273044663017989, - 1.4827926673621, - 1.5422127863194253, - 1.6052157918941716, - 1.6714596553470806, - 1.7406580805572875, - 1.812374269690358, - 1.8864315942123377, - 1.9627470006302623, - 2.041216921028526, - 2.121617826397508, - 2.203751516733095, - 2.2876038129918603, - 2.373149729066263, - 2.46009044721456, - 2.547933146106392, - 2.636834633661893, - 2.7269083994450263, - 2.8180682120678515, - 2.910233637533954, - 3.003343213189532, - 3.0971895719847193, - 3.1915593646002023, - 3.2196902197292787, - 3.219119439082579, - 3.219160083870915, - 3.2188337175742134, - 3.2188660956650565, - 3.2188456697301047, - 3.218791604574891, - 3.218819504101484, - 3.2188097432071134, - 3.2188700523552267, - 3.2187898253144627, - 3.2188181722874565, - 3.2188315383940687, - 3.2188099963666703, - 3.218788914955046, - 3.2188087786969635, - 3.218788151059705, - 3.218818465460849, - 3.2188210252066938, - 3.218820071146196, - 3.2187641750692, - 3.2187894758955875, - 3.21878178722089, - 3.218787156513524, - 3.2187741708911304, - 3.2187372524939875, - 3.218723777155505, - 3.218801110338959, - 3.2187595553187642, - 3.218794551698227, - 3.2189359364973846, - 3.2189754134306097, - 3.2187959457458852, - 3.2187582476135965, - 3.2187811787494365, - 3.2187738977564107, - 3.2187371959054767, - 3.2187617001374567, - 3.218770150918383, - 3.2188413372559417, - 3.2187391407868957, - 3.2189228917502835, - 3.2187628973469233, - 3.218748622087054, - 3.2187667204087425, - 3.2188150192510254, - 3.2187066040729677, - 3.2187422551705183, - 3.2188285350292256, - 3.2187540013873512, - 3.218817745001026, - 3.218753323146198, - 3.2190417019977278, - 3.218902290859742, - 3.21917334895788, - 3.219890659836416, - 3.220026541071697, - 3.2193949673980007, - 3.2198247605564982, - 3.220694585297862, - 3.22067370122762, - 3.2206288665574703, - 3.2205844767554037, - 3.2209111988932424, - 3.219942974737926, - 3.219950820221985, - 3.221179717942062, - 3.220626177302738, - 3.2206076584431527, - 3.2206012236298225 + 1.376122967153269, + 1.4273044663018002, + 1.482792667362109, + 1.5422127863198878, + 1.605215791899164, + 1.6714596554137855, + 1.740658080441373, + 1.8123742706772032, + 1.8864315957737785, + 1.9627470033613021, + 2.041216924749359, + 2.1216178319577215, + 2.2037515245136214, + 2.2876038228148943, + 2.373149741360043, + 2.4600904624538766, + 2.5479331656764623, + 2.6368346572398815, + 2.7269084263293846, + 2.8180682438686153, + 2.9102336739138517, + 3.0033432545645584, + 3.0971896192888826, + 3.191559418407556, + 3.2196902232574534, + 3.2191194407773596, + 3.2191600741206168, + 3.218833715372932, + 3.2188247463062916, + 3.2188019062369135, + 3.2188029335609207, + 3.218836262911391, + 3.2188373125955096, + 3.218794593684065, + 3.2188253926066497, + 3.2187673616406656, + 3.2188164089109885, + 3.21880516010999, + 3.218796931559093, + 3.2187902160639554, + 3.218777139954213, + 3.218793806077406, + 3.21883209771284, + 3.2187931473061666, + 3.218806636275195, + 3.2187785973158407, + 3.218813228545181, + 3.2188006321803617, + 3.218785551540423, + 3.2187786281618367, + 3.21878864206566, + 3.2187909181560936, + 3.2187688598429185, + 3.2187690781879685, + 3.218828909656524, + 3.2187744475670566, + 3.218760711658757, + 3.2188419290134695, + 3.218840079747839, + 3.218782412529111, + 3.218785327128231, + 3.2187954210873073, + 3.218803804495506, + 3.21877089262953, + 3.2188473357083334, + 3.2187938941049423, + 3.218764603464544, + 3.2187569010727204, + 3.218730415532159, + 3.2187180316951576, + 3.2189128415910697, + 3.2187877008088503, + 3.218851483806225, + 3.2188426069408487, + 3.218800783042699, + 3.218766506852298, + 3.2190021288817077, + 3.218813005478208, + 3.2191630576242956, + 3.2200746587945472, + 3.2196802721699096, + 3.219662146582543, + 3.2200885801712897, + 3.2196983033988698, + 3.2198395430646447, + 3.2199484279128305, + 3.2202976032589956, + 3.2207897680286726, + 3.2202494502814876, + 3.220216924786361, + 3.2204071011417432, + 3.2193246490183727, + 3.2203761221883593, + 3.221163537216438 ], "datatype": "Float64", "type": "series" @@ -779,48 +779,48 @@ 0.0, 0.0, 0.0, - 15.529277655179897, - 12.81309061156936, - 11.495076082392263, - 16.74388970629975, - 9.60944005771834, - 5.502557441697027, - 3.2002845914885194, - 19.107397293757252, - 3.4181356258315487, - 12.434467294945737, - 4.8763962142257125, - 2.960353563187964, - 4.528842104467208, - 4.19743959199365, - 4.3593462737199555, - 1.9808774326465148, - 2.2930486613951038, - 1.2802765276810233, - 0.8553600802283693, - 1.2013864991905048, - 0.9812959138648975, - 2.9223327935557912, - 3.6221245567188896, - 10.69892561088472, - 5.184896692900523, - 3.7350019298198482, - 8.366625185809166, - 3.8411397481336578, - 4.372304023877084, - 13.618701695211328, - 22.034252504158683, - 9.524242299283609, - 11.640219137102804, - 8.59664828444686, - 5.184157038067201, - 2.8799668253121937, - 13.032063157575939, - 4.933994270495964, - 9.780250778572684, + 15.53180056349388, + 12.801509067654118, + 11.440237884293461, + 16.75388524663429, + 9.717274273376237, + 5.314297510299265, + 3.0412495815803107, + 12.61094638220037, + 8.22288872998799, + 8.775090218224483, + 5.977308021022248, + 3.3364670973984474, + 14.221575922269016, + 1.9283772912979533, + 5.265746898232598, + 1.8108980841593856, + 0.9472551623259955, + 1.577846917338141, + 0.9834544405583706, + 2.678754615099688, + 2.183360084927968, + 2.033568971650244, + 1.24278196703669, + 4.7039929993760214, + 5.484626791739943, + 11.379469100431715, + 8.207779098162892, + 4.316392419386327, + 4.9296238983790435, + 5.774006193061955, + 16.977119985722066, + 12.291440638773913, + 17.31037267331225, + 12.49579543298579, + 3.589962983996761, + 2.871178686846765, + 13.195044180154884, + 4.986975815769471, + 9.63669814863762, 0.0, 0.0, - 0.406470135144525, + 0.47078873086421397, 0.0, 0.0, 0.0, @@ -844,4 +844,4 @@ "datatype": "Float64", "type": "series" } -} \ No newline at end of file +} diff --git a/validation/dam_break_2d/validation_reference_edac_00075.json b/validation/dam_break_2d/validation_reference_edac_00075.json index e4855ef6a..4b7f812b4 100644 --- a/validation/dam_break_2d/validation_reference_edac_00075.json +++ b/validation/dam_break_2d/validation_reference_edac_00075.json @@ -137,81 +137,81 @@ 0.0, 0.0, 0.0, - 63.829505651630846, - 220.30826119648836, - 356.39160841531566, - 535.516077453837, - 963.5802099739906, - 881.3573623650755, - 1324.980773435947, - 1333.3272539220463, - 1299.4073738291438, - 1333.2914543308548, - 1453.4742215160632, - 1644.1466295611085, - 1786.0017052646526, - 1781.3058297672237, - 1898.829394763771, - 1908.5607738029503, - 2043.1272321029107, - 2299.9805783396173, - 2397.2803813327737, - 2194.9681883855856, - 2490.947559662288, - 2464.2354854843725, - 2567.5142907053973, - 2509.8512859444154, - 2802.7113346478886, - 2601.3616867718347, - 2725.748923436639, - 2716.6396869340956, - 2725.0700332563947, - 2604.6917694756244, - 2863.1584278286573, - 2766.133568172541, - 2778.5781481461536, - 2682.5791033620744, - 2785.9028160596604, - 2795.2322853133, - 2764.726744940796, - 2717.46050450239, - 2831.3719415971464, - 2925.490108702938, - 2979.583547611059, - 3105.2850856824093, - 3244.3856460898687, - 3294.1171515493043, - 3785.2292794318246, - 3913.511788275557, - 4531.301263579918, - 5761.126046753425, - 7519.351325972794, - 4153.756277506261, - 3279.8000230800862, - 5688.623347209816, - 5433.102770408339, - 7597.346718048364, - 5052.317899702394, - 3116.5428328888825, - 2349.516037719813, - 1213.8474417759014, - 650.7827228183571, - 1865.2307953276857, - 446.83827900878543, - 1327.092311634857, - 529.5215672655502, - 1309.9510132813543, - 861.8276663220553, - 1527.4281446551856, - 1394.2536482885102, - 2036.0762266565296 + 63.82950565357313, + 220.3082611983047, + 356.3916084250854, + 535.516076957146, + 963.5802113969414, + 881.3573625499278, + 1324.9807722662413, + 1333.3272529826213, + 1299.4073694049612, + 1333.2914613555058, + 1453.4742260423022, + 1644.1466264013611, + 1786.001704967289, + 1781.305833490235, + 1898.8293799400883, + 1908.5607731454406, + 2043.1272216824632, + 2299.9806273221952, + 2397.2803531868303, + 2194.96814418116, + 2490.947608610872, + 2464.2354489365493, + 2567.514066752224, + 2509.8513679190874, + 2802.711796184915, + 2601.361659426123, + 2725.752566052764, + 2716.639730918633, + 2725.0703734894423, + 2604.6925208392454, + 2863.157944910265, + 2766.1291855632517, + 2778.58057964899, + 2682.582414439336, + 2785.89719792034, + 2795.230185428544, + 2764.7274736406894, + 2717.4530083743857, + 2831.373007578644, + 2925.5032838610273, + 2979.5640125636646, + 3105.2739016963574, + 3244.394892752824, + 3294.136135087182, + 3785.2330800410755, + 3913.5021796289248, + 4531.291691584197, + 5761.180720452001, + 7519.352630101326, + 4153.630925261648, + 3279.4658645657473, + 5688.378454154359, + 5433.260841248858, + 7596.418052804123, + 5049.240516153834, + 3114.7463405946132, + 2350.347632340085, + 1216.0565693097644, + 650.7228396211555, + 1862.8176684491314, + 449.0064066308929, + 1325.2219485937387, + 532.1721583888125, + 1315.066132088642, + 859.5902593210027, + 1473.6258164578308, + 1461.3804048091483, + 1905.3634422863074 ], "datatype": "Float64", "type": "series" }, "meta": { - "julia_version": "1.10.2", - "solver_version": "v0.1.0-41-ga05975e-dirty", + "julia_version": "1.10.4", + "solver_version": "v0.1.3-13-gba229583-dirty", "solver_name": "TrixiParticles.jl" }, "pressure_P2_fluid_1": { @@ -356,47 +356,47 @@ 0.0, 0.0, 0.0, - 5.0282935721918545, - 41.66902559762977, - 16.195175000569556, - 9.772190471505196, - 56.784903933109135, - 23.006398092933928, - 13.765969200139901, - 12.598747857884188, - 11.712832468476293, - 13.966219219297994, - 14.100333535764658, - 39.437277554825684, - 43.5423194791, - 16.231952571132442, - 96.81208250744115, - 128.9850320577453, - 152.71711006265843, - 170.3856803346461, - 238.89851359304885, - 305.98841083043874, - 371.02145365540594, - 461.8754645655811, - 525.3023700444741, - 677.4712733719313, - 767.479320282582, - 861.0047206691031, - 991.6954099442231, - 1090.8555925376113, - 1128.8356302289744, - 1445.7568270904444, - 1479.4249349982256, - 1475.1956396616933, - 1584.4783609712804, - 1639.2918017908673, - 1726.2818799954275, - 1792.8565787121727, - 1900.00143514012, - 1940.0073845390475, - 1665.5954705697288, - 1631.7514029572583, - 694.5720280501272, + 5.0282935718066755, + 41.66902559683442, + 16.195174995979322, + 9.772190454092817, + 56.78490392457839, + 23.00639795608557, + 13.765968882456642, + 12.598747756608677, + 11.712832667270932, + 13.966218638609664, + 14.100334314704702, + 39.43728154066748, + 43.54231170054521, + 16.23194570939517, + 96.8120781393159, + 128.98501023807893, + 152.71714351636325, + 170.3856900148707, + 238.89854542147654, + 305.98827308985926, + 371.0213337719913, + 461.87551085547204, + 525.3033225785305, + 677.4718858000068, + 767.480402951441, + 861.0070801746703, + 991.6915157143121, + 1090.8585746142396, + 1128.834011676893, + 1445.7573032999544, + 1479.4265181865007, + 1475.1964559395985, + 1584.4770849437991, + 1639.2879167727242, + 1726.27322000149, + 1792.8796530853692, + 1899.9818840274488, + 1939.9761993673978, + 1665.5830010392226, + 1631.776281675184, + 694.5726141940753, 0.0, 0.0, 0.0, @@ -538,98 +538,98 @@ 1.3174944089678398, 1.363773913458999, 1.4147586979970606, - 1.4698590397345028, - 1.5286639090988325, - 1.590883005387329, - 1.656242684041159, - 1.7244429453366437, - 1.7952163157185361, - 1.8683754102276249, - 1.9437962223600003, - 2.021336588700605, - 2.100786406989409, - 2.1820406570528568, - 2.2648743393364077, - 2.3489210372982403, - 2.434103799766087, - 2.5205804045738502, + 1.4698590397345026, + 1.5286639090988323, + 1.5908830053873289, + 1.6562426840411582, + 1.7244429453366428, + 1.795216315718534, + 1.8683754102276215, + 1.9437962223599974, + 2.0213365887006036, + 2.1007864069894064, + 2.182040657052853, + 2.264874339336405, + 2.3489210372982376, + 2.434103799766085, + 2.52058040457385, 2.6082968893405742, - 2.6971417538554188, - 2.7866789792173656, - 2.876522591465255, - 2.9667925003714157, - 3.0577166572369734, - 3.1494195562105856, - 3.2172367424978736, - 3.217731452032734, - 3.2176100586254948, - 3.2178700938455798, - 3.2174898133893666, - 3.217267185894823, - 3.2172536924069224, - 3.217178702109812, - 3.2169691406849776, - 3.2168368639030445, - 3.2167343156157084, - 3.216642708903159, - 3.2165359705888847, - 3.216420106135052, - 3.216315087121993, - 3.216190326215446, - 3.216086124722576, - 3.2160385803340965, - 3.216050053818234, - 3.2160337820246196, - 3.2159943819220134, - 3.2159347008094636, - 3.2159127074293994, - 3.2161083211358203, - 3.2162808850626914, - 3.2164244345505755, - 3.2165585437378996, - 3.216654795235872, - 3.2167269365074875, - 3.216754375138281, - 3.2167515055859415, - 3.2167113688123066, - 3.2168153500403998, - 3.2168712431681596, - 3.2168536846066127, - 3.2168026454487033, - 3.2167299797134388, - 3.2166043221498684, - 3.216397049710712, - 3.216081168666742, - 3.2157922944378425, - 3.2156285236165765, - 3.2154261368640507, - 3.2153412042296288, - 3.215305319578891, - 3.2152944492058126, - 3.215288739691573, - 3.2157531909289943, - 3.2152702645965245, - 3.2152575344380456, - 3.2163065921762928, - 3.2164701917963145, - 3.215482938016915, - 3.215197010284924, - 3.217028337267962, - 3.215886930265487, - 3.21745500028446, - 3.2194509283015993, - 3.2209682870062513, - 3.2196219325073554, - 3.21698451537636, - 3.215699412041782, - 3.216737459567915, - 3.217914844950135, - 3.218091583913962, - 3.218082833508435, - 3.218072479714611, - 3.2180687378422013, - 3.2180571470855797, - 3.2180340698377394 + 2.69714175385542, + 2.786678979217367, + 2.8765225914652564, + 2.966792500371417, + 3.057716657236976, + 3.1494195562105904, + 3.2172367424978745, + 3.217731452032732, + 3.2176100586254917, + 3.2178700938455935, + 3.21748981338938, + 3.2172671858948227, + 3.2172536924069806, + 3.217178702109825, + 3.216969140684969, + 3.2168368639030427, + 3.2167343156157076, + 3.2166427089031546, + 3.216535970588879, + 3.216420106135043, + 3.2163150871219828, + 3.2161903262154374, + 3.2160861247225587, + 3.216038580334906, + 3.216050053818886, + 3.2160337820251073, + 3.2159943819223256, + 3.2159347008095995, + 3.2159127074292457, + 3.2161083211356565, + 3.216280885062519, + 3.216424434550392, + 3.216558543737701, + 3.21665479523566, + 3.216726936507259, + 3.2167543751380414, + 3.2167515055856857, + 3.21671136880544, + 3.2168153500332872, + 3.216871243160758, + 3.2168536845988847, + 3.216802645441915, + 3.2167299797068063, + 3.2166043221433043, + 3.2163970497068157, + 3.216081168700031, + 3.215792294437583, + 3.21562852361633, + 3.215426136863805, + 3.2153412107637283, + 3.2153053195789076, + 3.2152944492059103, + 3.215288739691686, + 3.2157532679730787, + 3.215270264596643, + 3.2152575344381047, + 3.216306505706314, + 3.216470503476421, + 3.215484103069275, + 3.2151970102848346, + 3.217026634507999, + 3.2158813775686115, + 3.2174545791856555, + 3.2194477699621773, + 3.2209645433666516, + 3.219613259369428, + 3.216984576742623, + 3.2157135708037607, + 3.2167211853386792, + 3.2179151592848894, + 3.218091594192425, + 3.2180830758372685, + 3.2180718529531105, + 3.218068771934865, + 3.2180564304122754, + 3.21803404977048 ], "datatype": "Float64", "type": "series" @@ -781,38 +781,38 @@ 0.0, 0.0, 0.0, - 14.324062948361998, + 14.324062948133886, 0.0, - 11.556323366686689, - 19.897416547062722, - 14.549414170009893, - 37.376587539311515, - 23.679461389760764, - 26.23284934504549, - 9.843110841979625, - 15.047834587442887, - 11.679194179286295, - 10.421649034630363, - 8.53145201559001, - 8.231779655818643, - 7.4710115038618525, - 7.89190390537256, - 7.4076574494687915, - 7.094814898306931, - 6.551896878368265, - 5.657355192996434, - 8.354870819924713, - 6.5641582916196395, - 11.620899941621703, - 10.246057034822284, - 47.32516861754617, - 9.59894792866611, - 9.923660936595967, - 12.807942681526749, - 9.741126570754219, + 11.556323369370372, + 19.89741654859891, + 14.549414161612344, + 37.3765875204203, + 23.67946138385185, + 26.23284932015256, + 9.843110852417272, + 15.047834694959032, + 11.679194214219555, + 10.421649027717553, + 8.531452044931786, + 8.231779714800416, + 7.471011090614515, + 7.891902861273138, + 7.407659065917284, + 7.09481535900075, + 6.551895507600468, + 5.657355067409998, + 8.354879266276047, + 6.564162025151933, + 11.620894758216041, + 10.246057093065293, + 47.32516881783714, + 9.598947814553666, + 9.923660942691846, + 12.807942682856758, + 9.74112657655171, 0.0, 0.0, - 35.099437812161575, + 35.09943783973138, 0.0, 0.0, 0.0, @@ -844,4 +844,4 @@ "datatype": "Float64", "type": "series" } -} \ No newline at end of file +} diff --git a/validation/dam_break_2d/validation_reference_edac_0015.json b/validation/dam_break_2d/validation_reference_edac_0015.json index fb8ead957..843ef7ffa 100644 --- a/validation/dam_break_2d/validation_reference_edac_0015.json +++ b/validation/dam_break_2d/validation_reference_edac_0015.json @@ -139,79 +139,79 @@ 0.0, 0.0, 0.0, - 604.3957582210057, - 854.3064249701162, - 806.7433554645238, - 863.2834525323564, - 1172.7188760362817, - 1185.7354823957364, - 1029.8194599051196, - 1220.8424591289627, - 1129.1130583250354, - 1681.2917027821925, - 1541.84704989596, - 1941.681744886013, - 1703.342852837277, - 1820.7752456709127, - 2273.6190702267386, - 2059.549528549632, - 2492.42657872154, - 2431.891435051085, - 2341.412705521953, - 2380.5056651594596, - 2476.6304064185897, - 2377.215248491543, - 2407.6934046918395, - 2621.6411290967458, - 2604.698214284965, - 2546.399443630783, - 2689.6843234734833, - 2654.639435738155, - 2815.3615123943055, - 2642.321187463903, - 2862.2882422981534, - 2811.523774221353, - 2800.9092531867764, - 2952.9564218334053, - 2844.26385035426, - 2874.3035321104517, - 2947.9713669965477, - 2981.736356294694, - 3022.7152925706846, - 3095.8959107824994, - 3223.283421806281, - 3438.1549422956728, - 3461.615757497162, - 3889.532826771071, - 4764.8350876461145, - 6691.330618320588, - 5937.57389697787, - 6470.044184482702, - 5114.121178496523, - 3634.978964640017, - 3802.0393876762696, - 2751.9597721194446, - 2027.8908055573243, - 1718.7065075201758, - 1535.5875986343772, - 1382.352588739524, - 1479.4637838388012, - 1636.543321007025, - 1580.840904760441, - 1362.2790951007676, - 1307.4981559335906, - 1483.0941976925808, - 1582.6084515968898, - 3052.2514672201683, - 34536.29685017654, - 37.65095815197997 + 604.3957582217542, + 854.3064249689903, + 806.7433554667048, + 863.2834525353044, + 1172.7188760415015, + 1185.7354824136248, + 1029.8194599305887, + 1220.8424591851178, + 1129.1130583178463, + 1681.2917028035415, + 1541.8470499136367, + 1941.681744881495, + 1703.34285285322, + 1820.7752456402407, + 2273.6190701485234, + 2059.5495280251544, + 2492.426579180664, + 2431.8914361138136, + 2341.4127031317485, + 2380.505663314783, + 2476.6304127970825, + 2377.2152399406323, + 2407.6934022851774, + 2621.6411323608654, + 2604.69821615302, + 2546.399445139777, + 2689.6843227818736, + 2654.639431333963, + 2815.3615103209736, + 2642.3211879945993, + 2862.288242569267, + 2811.523774058284, + 2800.9092533119374, + 2952.956416436221, + 2844.2638473403003, + 2874.3035301234477, + 2947.9713666883163, + 2981.736356224572, + 3022.715294713754, + 3095.8959150752744, + 3223.283418881802, + 3438.1549411923284, + 3461.6157572399707, + 3889.53281728565, + 4764.835083513683, + 6691.330625680412, + 5937.573910416992, + 6470.0441855496065, + 5114.121157943108, + 3634.9789872886854, + 3802.039380325749, + 2751.959787462676, + 2027.890807994078, + 1718.7065277233407, + 1535.5876279154686, + 1382.3526228733922, + 1479.4637846171665, + 1636.5433046045282, + 1580.8409135207003, + 1362.2791019133902, + 1307.498181018935, + 1483.0941526956017, + 1582.6084125926625, + 3052.251514770191, + 34536.296963146, + 37.650723145869094 ], "datatype": "Float64", "type": "series" }, "meta": { - "julia_version": "1.10.2", - "solver_version": "v0.1.0-22-g4d428a23-dirty", + "julia_version": "1.10.4", + "solver_version": "v0.1.3-14-g54ab29d7-dirty", "solver_name": "TrixiParticles.jl" }, "pressure_P2_fluid_1": { @@ -360,43 +360,43 @@ 0.0, 0.0, 0.0, - 1.4586145071541898, - 35.23970220674639, - 37.545723914493706, - 13.731385167730085, - 18.84645797568068, - 19.822484197824288, - 16.23077067519315, - 56.87642077158365, - 37.33671454346889, - 78.42964734337639, - 75.04969120367215, - 166.6148408881951, - 162.73529547483014, - 281.72822678093445, - 314.5217962647108, - 297.23412415145486, - 357.6400963258884, - 448.65581898807187, - 465.0729072685026, - 612.2400999708409, - 751.9411576661471, - 889.945132047711, - 1033.4736519596122, - 1058.2021923062105, - 1247.2730353264728, - 1414.0754183693182, - 1588.3865333590663, - 1665.7825902521158, - 1545.8294821241884, - 1673.9628180445059, - 1683.2228111190875, - 1629.4962936654842, - 1359.6993745648126, - 887.9118718296219, - 1629.9983551561381, - 1234.4717618954708, - 2004.325882177016, + 1.458614507134111, + 35.239702206751794, + 37.545723914308574, + 13.731385168125914, + 18.84645797557061, + 19.822484197604172, + 16.230770674103212, + 56.876420773247574, + 37.33671454454701, + 78.42964735982102, + 75.0496911949664, + 166.6148408864529, + 162.7352955639437, + 281.72822675184, + 314.5217951688887, + 297.23412708372086, + 357.6400929342205, + 448.6558201416848, + 465.0729095711398, + 612.2401008165527, + 751.9411582089144, + 889.9451298648294, + 1033.4736499046853, + 1058.2022017674508, + 1247.2730279156447, + 1414.0754234183892, + 1588.3865343360246, + 1665.7825979831214, + 1545.8294719048179, + 1673.9628083251253, + 1683.2228214717754, + 1629.4962978224762, + 1359.6993719491961, + 887.9118722058907, + 1629.998356167824, + 1234.4717664648788, + 2004.3258858980364, 0.0, 0.0, 0.0, @@ -538,98 +538,98 @@ 1.302960573952499, 1.3475843440024642, 1.3976361698571822, - 1.452219981156139, - 1.5105209474752668, - 1.572142938860141, - 1.6367982265986325, - 1.7042518338466686, - 1.774293799870995, - 1.8467352027968729, - 1.9213758913869938, - 1.9980351614993215, - 2.0765445792095147, - 2.1566383641391074, - 2.238003134643122, - 2.3206381687170166, - 2.404491939404275, - 2.4895406309022796, - 2.575727348830502, - 2.662752245491369, - 2.7501950551381618, - 2.837835825711919, - 2.925713154425575, - 3.0138975572145523, - 3.102445768668486, - 3.191484721683206, - 3.2105882666919006, - 3.210602566477464, - 3.2104070754233653, - 3.2102742072774215, - 3.210140068534911, - 3.210439644793008, - 3.211288433609166, - 3.21212082548689, - 3.2125141820856595, - 3.212599029590776, - 3.211945134461789, - 3.210893702477077, - 3.2095320951690947, - 3.2088660426953854, - 3.2087134506109494, - 3.20857376087247, + 1.4522199811561387, + 1.5105209474752666, + 1.5721429388601407, + 1.6367982265986323, + 1.7042518338466683, + 1.7742937998709947, + 1.8467352027968722, + 1.9213758913869932, + 1.9980351614993208, + 2.0765445792095143, + 2.156638364139107, + 2.2380031346431215, + 2.320638168717016, + 2.404491939404274, + 2.4895406309022783, + 2.5757273488305006, + 2.6627522454913684, + 2.7501950551381626, + 2.837835825711921, + 2.9257131544255777, + 3.013897557214555, + 3.102445768668488, + 3.1914847216832074, + 3.2105882666919, + 3.2106025664774673, + 3.210407075423366, + 3.2102742072774224, + 3.210140068534912, + 3.2104396447929937, + 3.21128843360915, + 3.212120825486885, + 3.2125141820856324, + 3.212599029590735, + 3.2119451344617413, + 3.210893702477024, + 3.209532095169044, + 3.208866042695384, + 3.208713450610947, + 3.2085737608724685, 3.2083568996870397, - 3.2083890435617195, + 3.20838904356121, 3.2080318779499213, - 3.2079261547153983, - 3.207855507756003, - 3.2077741195888656, - 3.2077060027314293, - 3.207670669165742, - 3.2076288978754195, - 3.2075941374177193, - 3.2075586504257148, - 3.207536831952301, - 3.2075265213627917, - 3.2102187933610122, - 3.2126950751999495, - 3.21196641463669, - 3.2074630303747598, - 3.207445287458887, - 3.2074252902484464, - 3.2074042323917, - 3.2073895391869978, - 3.207376753579594, - 3.2073732467888774, - 3.2073483132064147, - 3.207664818066874, - 3.20731546185251, - 3.207854005492601, - 3.208580052098399, - 3.2072818774036804, - 3.207267975766838, - 3.2072489587527926, - 3.2072243341066873, - 3.207219589202814, - 3.207207135145238, - 3.207191617668057, - 3.207167720999116, - 3.2071482230764086, - 3.2071253085042755, - 3.2071076627464006, - 3.207079688551678, - 3.2070631437453248, - 3.207023980424338, - 3.2070022030549534, - 3.2069578815542865, - 3.206882240708722, - 3.206818992733722, - 3.206722841165657, - 3.206641258674049, - 3.20651704330811, - 3.2063950957148926, - 3.206329455325389, - 3.206229289248844, - 3.2061593054711004 + 3.2079261547153988, + 3.207855507756004, + 3.2077741195888674, + 3.207706002731431, + 3.2076706691657435, + 3.2076288978754204, + 3.20759413741772, + 3.207558650425716, + 3.2075368319523023, + 3.207526521362793, + 3.210218793363157, + 3.2126950752038237, + 3.211966414644046, + 3.207463030374761, + 3.207445287458888, + 3.2074252902484477, + 3.2074042323917014, + 3.207389539186999, + 3.207376753579595, + 3.2073732467888787, + 3.207348313206416, + 3.207664818092248, + 3.2073154618525113, + 3.2078540055118956, + 3.2085800520982386, + 3.2072818774036818, + 3.207267975766839, + 3.2072489587527944, + 3.207224334106689, + 3.2072195892028157, + 3.20720713514524, + 3.2071916176680593, + 3.2071677209991187, + 3.2071482230764103, + 3.2071253085042786, + 3.2071076627464037, + 3.2070796885516817, + 3.2070631437453283, + 3.2070239804243412, + 3.207002203054957, + 3.2069578815542883, + 3.206882240708724, + 3.2068189927337247, + 3.2067228411656616, + 3.206641258674055, + 3.2065170433081125, + 3.2063950957148966, + 3.2063294553253914, + 3.2062292892488458, + 3.206159305471103 ], "datatype": "Float64", "type": "series" @@ -792,16 +792,16 @@ 0.0, 0.0, 0.0, - 3.9648485713534356, - 5.688115787337868, - 5.021169068061549, - 3.4690420744982595, - 3.5587374771061193, - 3.1571728370072245, - 3.002903045034488, - 4.056831537710453, - 6.550226835881946, - 4.570655703611319, + 3.9648485713585933, + 5.688115787453901, + 5.021169068236998, + 3.46904207384665, + 3.558737479106347, + 3.1571728397825796, + 3.0029030383318096, + 4.056831533940541, + 6.550226834580317, + 4.570655704401352, 0.0, 0.0, 0.0, @@ -809,7 +809,7 @@ 0.0, 0.0, 0.0, - 13.98887227719292, + 13.988872277204237, 0.0, 0.0, 0.0, diff --git a/validation/dam_break_2d/validation_reference_wcsph_0001875.json b/validation/dam_break_2d/validation_reference_wcsph_0001875.json index 70ae2b556..f260670ca 100644 --- a/validation/dam_break_2d/validation_reference_wcsph_0001875.json +++ b/validation/dam_break_2d/validation_reference_wcsph_0001875.json @@ -136,82 +136,82 @@ 0.0, 0.0, 0.0, - 45.795417909753986, - 30.986970334726653, - 88.05948840868432, - 552.7825716933128, - 920.3939791879527, - 843.9803228418943, - 1198.4306383314438, - 1307.4218650259777, - 1551.1614335277905, - 820.9324305229308, - 1618.2777784691862, - 1118.7361526076513, - 1340.3279552181161, - 1819.3970368003422, - 2130.606457954829, - 2169.4926936753154, - 2270.277029561626, - 2182.734498203901, - 2027.1358420234967, - 2204.198718226254, - 1968.7434281115009, - 2492.7425782632013, - 2804.8952931647045, - 2286.915020570262, - 2713.028093827061, - 2557.8946262705217, - 2676.7335881591903, - 2630.692946854259, - 2780.879159625962, - 2566.0554325798157, - 2876.339978484625, - 2687.078292376781, - 2534.9905689398897, - 2805.2451019180644, - 2921.735789046199, - 2609.9054081748445, - 2837.1289059887367, - 2875.3167107168706, - 2833.6939092357015, - 2947.6543723563022, - 2905.713496985916, - 2831.391646895673, - 2942.5289706903586, - 3146.56291085397, - 3186.9261233249576, - 3459.6124426849046, - 3653.2887908885605, - 4297.702961121691, - 5057.085382681299, - 6790.01681537226, - 5714.950602336447, - 5164.43699821667, - 5308.423404900976, - 4797.701901717602, - 4208.150962724796, - 5096.441180151019, - 4805.670702674106, - 3275.206200205639, - 1509.8437133185737, - 8196.388479597907, - 1389.9556140209475, - 48.06627062092718, - 142.2684567691535, - 426.8228505863073, - 0.0, - 706.4392919333849, - 0.0, - 150.25642381312346, - 2277.737279445718 + 45.78820491697043, + 29.637057781309103, + 79.24368440780117, + 660.9778676962227, + 1050.5279249314017, + 743.1454292022047, + 1082.1169340866577, + 1323.1828306939858, + 1558.0463019901536, + 850.0420359723555, + 1641.7921137533747, + 1359.7845255261698, + 1303.455476131774, + 1716.7145306882085, + 2020.8472398198567, + 2206.6527469192724, + 2416.1099432412257, + 2251.8666059418683, + 2001.5791360236012, + 2250.9732396731606, + 2055.036675389806, + 2476.3900122617874, + 2510.4483535712466, + 2402.188881417441, + 2852.894596977366, + 2481.754011171052, + 2872.0608285347753, + 2631.4362991621283, + 2923.3397583293063, + 2489.5824333644327, + 2898.972431453728, + 2696.7261580894574, + 2526.1413529734245, + 2739.3907821075345, + 2832.4898485681324, + 2650.0175189504444, + 2808.3256194091273, + 2829.4703792449664, + 2952.027672646931, + 3098.1495346973697, + 2885.2353748728983, + 2936.5030389998974, + 3043.7463509603303, + 3041.641376211404, + 3163.455205347797, + 3281.916828972951, + 3529.4503077437826, + 4181.5465014207975, + 5201.281456281654, + 6570.899503737537, + 5683.864007359124, + 5029.004926079247, + 5362.6896488338525, + 4694.899723879829, + 4119.380372278524, + 5241.11778918648, + 4747.473064327021, + 2201.9342096097475, + 981.0849781422052, + 2.937516039524973, + 1586.1516558712906, + 304.0552697859976, + 10848.749638579513, + 0.0, + 76.5726931505592, + 177.90358511064804, + 273.0188977674977, + 41.445168547714886, + 95.08204280135247 ], "datatype": "Float64", "type": "series" }, "meta": { - "julia_version": "1.10.2", - "solver_version": "v0.1.0-42-gaa74848-dirty", + "julia_version": "1.10.4", + "solver_version": "v0.1.3-13-gba229583-dirty", "solver_name": "TrixiParticles.jl" }, "pressure_P2_fluid_1": { @@ -355,58 +355,58 @@ 0.0, 0.0, 0.0, - 8.137474398356465, - 16.498859955926168, - 15.164345238697965, - 14.497070409731915, - 13.701694162443477, - 17.05819796035522, - 6.862768172486139, - 10.157578690994551, - 14.182020846567593, - 5.092217430219432, - 12.946287418688897, - 19.32316444599005, - 12.839915675024358, - 20.61520320591055, - 132.38172851891431, - 5.79592905224373, - 160.595377745003, - 177.26580283234026, - 243.60522337506455, - 245.64844112230676, - 269.2781916856497, - 421.4220230166705, - 483.7230593494285, - 493.7749362856113, - 502.5221739311165, - 688.2620827693952, - 845.0400854295897, - 994.7161645496323, - 952.950100203993, - 1109.283301027545, - 1256.4344362923243, - 1357.2722316672923, - 1448.776623129004, - 1471.2694024093191, - 1580.8239356843492, - 1641.1726001586471, - 1708.2631397018104, - 1663.758529848884, - 1673.1654103072156, - 1749.8037198896054, - 1348.0922719246669, - 330.25013871710183, - 19.35958286745482, - 3.5368803531079336, - 16.0725928821717, - 16.254801945806612, - 6.1359971374734155, - 8.86353007399404, - 12.474117547442278, - 15.358144333910502, + 8.135693906956764, + 17.21093431816423, + 14.435478322881172, + 16.929033418479086, + 17.13101213556298, + 15.240738094350442, + 37.2796540059997, + 13.053619354307596, + 7.204420433628681, + 25.096486023763106, + 10.872131677587518, + 25.685830428951135, + 52.8653049517074, + 61.761709254977745, + 83.62348277992, + 13.363525525594174, + 80.52348951412873, + 125.95986629795429, + 158.24274962022147, + 224.70148176511734, + 186.5580638551931, + 465.35670360322877, + 559.8014374211014, + 547.3255689549203, + 600.1237131727996, + 702.6858128424753, + 846.7081511115761, + 934.9039076711075, + 892.5250926396369, + 1148.6141960531554, + 1283.97977227516, + 1407.3828526850884, + 1421.603399148167, + 1480.7031331959738, + 1534.4909694634264, + 1662.8097422423598, + 1625.2634634239544, + 1691.4427201057479, + 1715.2555851861973, + 1781.6591670503567, + 1408.5097233099345, + 387.18934770683956, + 10.463312865892709, + 33.99226045329281, + 9.912956208032158, + 21.611298649409967, + 4.393113649145721, + 7.531464196342917, + 5.1984647062612055, + 0.0, + 12.280866161824358, 0.0, - 4.2698150843165505, 0.0, 0.0, 0.0, @@ -531,105 +531,105 @@ "system_name": "fluid", "values": [ 1.1990625, - 1.2062912188622061, - 1.2251427920923226, - 1.2533926435243588, - 1.288732724929557, - 1.329885067321398, - 1.3762353875886937, - 1.427309866209793, - 1.4826998207878175, - 1.5420431133540629, - 1.6049044398646288, - 1.6709129699718779, - 1.7398473740274438, - 1.8114203023159112, - 1.885401818785752, - 1.9616117463289056, - 2.039881740936874, - 2.120061262605599, - 2.2020224091098526, - 2.285594356802947, - 2.370625789283306, - 2.4569731710870077, - 2.5445971236586034, - 2.6335059297158616, - 2.723686446668211, - 2.8147879426926212, - 2.9069856023019787, - 3.000343813002061, - 3.093872107791237, - 3.188083599333948, - 3.219445770962338, - 3.2194928565875323, - 3.218972833025382, - 3.2188364287840585, - 3.2188952464474996, - 3.2188298138468485, - 3.218820009743553, - 3.2188110597955935, - 3.218828763867503, - 3.2188012953477307, - 3.2188133906357725, - 3.2188211972434915, - 3.2187981546861844, - 3.2188060852462024, - 3.21879698019165, - 3.2188088732280495, - 3.2187737495331152, - 3.218903917738651, - 3.218776459547487, - 3.218803714669472, - 3.2187503464220484, - 3.218795721437317, - 3.218754308375021, - 3.2187822988310626, - 3.2187739284318457, - 3.218770122015697, - 3.2187997574578473, - 3.2188318342355196, - 3.2187869809645915, - 3.2187639760733786, - 3.218824288376943, - 3.2190519021135025, - 3.219306541647642, - 3.2195250599738605, - 3.219725399128985, - 3.219909992321128, - 3.220088762580422, - 3.2201018271885893, - 3.2196238979222653, - 3.2193897456983307, - 3.21911564460507, - 3.2190502512824275, - 3.2189232478583474, - 3.2189093636634465, - 3.2188940148358705, - 3.218767637296241, - 3.21888873879008, - 3.2189397605124817, - 3.2188137685882583, - 3.218731381174506, - 3.2188955184409904, - 3.2190142324249567, - 3.218810411312744, - 3.218722729217857, - 3.2190287832726505, - 3.219089215940388, - 3.220891772767404, - 3.220891947678954, - 3.221120116652444, - 3.2206949160717904, - 3.220227866018156, - 3.2199378138478973, - 3.2203023876287897, - 3.2202986314807363, - 3.219811690478277, - 3.219840248409694, - 3.2199399387860748, - 3.220772411716257, - 3.219926013023057, - 3.221087670404958 + 1.206291218862206, + 1.2251427920923224, + 1.2533926435243585, + 1.2887327249295568, + 1.3298850673213956, + 1.376235387588686, + 1.4273098662097663, + 1.4826998207878381, + 1.54204311335405, + 1.604904439865116, + 1.6709129699730199, + 1.7398473740282796, + 1.8114203023176925, + 1.885401818787756, + 1.9616117463314409, + 2.0398817409390335, + 2.1200612626125053, + 2.2020224091238334, + 2.2855943568093626, + 2.3706257892737326, + 2.4569731710792193, + 2.5445971236626677, + 2.6335059297452474, + 2.7236864467381436, + 2.81478794272564, + 2.906985602306776, + 3.0003438131290103, + 3.0938721079255296, + 3.1880835994232317, + 3.2194457708229938, + 3.2194928564235257, + 3.2189728504932535, + 3.218843434281245, + 3.2188048994859533, + 3.218813844855788, + 3.218803683771324, + 3.2187948270358504, + 3.2187872171206484, + 3.218797755058924, + 3.218800414388659, + 3.2188037963045897, + 3.2187877676215875, + 3.2187933362296706, + 3.2187785424961017, + 3.218763576812954, + 3.218815313813089, + 3.218777153995023, + 3.2187498389203495, + 3.218769106525292, + 3.218787215983555, + 3.2187560962387116, + 3.218772517682249, + 3.2187643661039385, + 3.218774462758222, + 3.2187425469373068, + 3.218783300986616, + 3.2187538873666433, + 3.2187655909395803, + 3.218758035202753, + 3.218772163378972, + 3.2190513375282133, + 3.2193056901923516, + 3.2195238489274227, + 3.2197236630101616, + 3.219907645008337, + 3.220085539707394, + 3.2200994739115485, + 3.2196187436506785, + 3.219385003320817, + 3.219433159728891, + 3.219470111714643, + 3.2193389936084285, + 3.2191189889882916, + 3.2188647870769227, + 3.2187925433575457, + 3.2189063173175048, + 3.218743323708403, + 3.218931376477214, + 3.2189060706046786, + 3.2191025158504756, + 3.218828480764635, + 3.2189324144559923, + 3.218878628553174, + 3.2189553669100244, + 3.2188370008850793, + 3.2194132595592238, + 3.219308213627831, + 3.220300834660544, + 3.2200213643146, + 3.2207946393896494, + 3.220790045839977, + 3.221169609514063, + 3.2214568179844663, + 3.2214582288711067, + 3.2202953050525602, + 3.220227963974207, + 3.2202106508259893, + 3.221071374655871, + 3.2201786274745374 ], "datatype": "Float64", "type": "series" @@ -779,48 +779,48 @@ 0.0, 0.0, 0.0, - 30.954596433372068, - 22.918495883508655, - 18.68653875959768, - 6.342328285895448, - 6.010974893248376, - 6.921352268527839, - 12.641287660360078, - 5.324096059467818, - 12.299384992232632, - 5.960799532361503, - 1.692622915372987, - 10.229972006718947, - 17.865220878093922, - 2.140105801547046, - 0.18424376218570795, - 14.127723695934293, - 2.3026452180996864, - 3.316254942849902, - 0.08793564479420095, - 0.07533401695691826, - 4.278889300902068, - 7.602004560117197, - 1.4544293901714205, - 2.772638097843874, - 7.52195746562243, - 4.427164942111693, - 1.3496900702494476, - 8.31428790635449, - 4.5454298608070935, - 5.9366427200282414, - 11.463972179316809, - 11.14697704435911, - 9.130044979184483, - 9.767051289777724, - 27.602126502373164, - 3.778250708541731, - 26.35607071767321, - 6.775108546420978, - 11.369481071601523, - 14.612697591736914, - 20.49504646337744, - 1.1996206222897805, + 30.948758430991386, + 22.926025530935743, + 16.901828910874976, + 6.830642175616783, + 7.40509682423442, + 4.374627550294365, + 22.85169832373999, + 17.830668978399398, + 2.5932192255890634, + 3.716974399752046, + 0.3699558494042164, + 21.153238604580146, + 14.471697042297569, + 7.002233255851349, + 1.7364260627960522, + 6.2404677345347155, + 0.12168088505278045, + 3.6896228890553973, + 0.006705147289133173, + 23.319692424484085, + 2.862156146659623, + 0.5704740179433738, + 0.32648264892063167, + 4.799481905757335, + 5.661474675441977, + 2.062070395698698, + 8.96635561714715, + 12.929859556376993, + 22.930005428119347, + 2.260882928705833, + 2.6509604962172273, + 3.177339305044356, + 11.782485626134905, + 23.421553016121685, + 4.579251274807521, + 13.922197659537812, + 17.223208092215835, + 20.165304055881215, + 10.490118203133473, + 9.699725589616044, + 0.0, + 10.03621932420592, 0.0, 0.0, 0.0, diff --git a/validation/dam_break_2d/validation_reference_wcsph_00075.json b/validation/dam_break_2d/validation_reference_wcsph_00075.json index 0763d5b02..a073e6cb2 100644 --- a/validation/dam_break_2d/validation_reference_wcsph_00075.json +++ b/validation/dam_break_2d/validation_reference_wcsph_00075.json @@ -137,81 +137,81 @@ 0.0, 0.0, 0.0, - 58.3449915737484, - 138.30798197205348, - 422.4454327143758, - 916.8379084200394, - 419.0542820835238, - 1347.4169383327599, - 2349.6352553794636, - 1064.518846925364, - 27.284751508188627, - 101.4027110447832, - 781.269929694757, - 1397.375595899754, - 1380.062438593228, - 1194.5290438249299, - 577.3446597874912, - 837.9255914093883, - 3081.1744294335917, - 3318.4600872182405, - 840.9522826551704, - 2892.2815052491255, - 3032.9001716109915, - 1260.6934944658822, - 3817.379408690888, - 1635.6748520209878, - 3229.882576401444, - 3186.2844071491168, - 986.1747562380727, - 4559.229103674002, - 2323.662542906834, - 869.9397283308729, - 3913.8661202543517, - 4345.322714334653, - 1727.691083770075, - 318.1022245457738, - 2137.4034881964117, - 4477.132376971367, - 5280.620479827444, - 4348.915605753067, - 2548.152118233453, - 1166.5958655127329, - 733.7269976054581, - 449.6293773957523, - 528.8475316972172, - 433.4970917379593, - 420.1311022195725, - 1286.81821996594, - 3764.7503687159733, - 7145.96986424888, - 7066.063851401108, - 7353.562854052298, - 6472.864968549782, - 4306.347988855297, - 6918.947963743149, - 3843.2505962682435, - 1933.8221271593907, - 1179.7008451321374, - 4632.996937909627, - 3317.094937208304, - 1656.3251394624062, - 388.08068284496295, - 1879.016655252052, - 1609.0588975679866, - 542.3340923494694, - 2371.0119086155237, - 1156.028036930474, - 3685.0239743888806, - 1009.9810839922333, - 1979.0594313323793 + 58.34499157580893, + 138.30798197307462, + 422.4454320069167, + 916.8379082712958, + 419.0542860536613, + 1347.4169363490403, + 2349.6352552133403, + 1064.5188535647756, + 27.284762954095733, + 101.40270121802446, + 781.2698760297001, + 1397.3756062896516, + 1380.0626831769282, + 1194.5300563640587, + 577.3465116088151, + 837.9282657731085, + 3081.17010490001, + 3318.472397297449, + 840.9313390343028, + 2892.170329270791, + 3033.0136483062283, + 1259.9188585301463, + 3817.2524586596387, + 1635.5155859308884, + 3229.805649248581, + 3186.5876516717203, + 986.0342809546313, + 4559.372473650205, + 2323.431273505833, + 870.0013937984211, + 3913.983103179214, + 4345.250178728977, + 1727.4968957559572, + 316.7663179955008, + 2136.556272234043, + 4477.973034216754, + 5281.622824291803, + 4350.961581329424, + 2546.3847198230355, + 1164.8892718552688, + 734.6801083604666, + 461.5063513800404, + 513.791844681144, + 400.9480475828874, + 443.2488563387531, + 1323.9151105073292, + 3786.1528906730064, + 7098.328089749295, + 7009.250103625575, + 7351.8539571585225, + 6490.324849224897, + 4344.057576248288, + 6901.645270617466, + 3409.499947326386, + 2035.4785912190637, + 1272.05991510375, + 4903.925205894056, + 4096.801586473807, + 1925.0634334182541, + 903.1282332479692, + 1976.0379489555598, + 1722.079895400316, + 428.66568715976547, + 3065.1764543960953, + 958.6684188322754, + 1989.1853548505364, + 2428.177731398007, + 1996.5741975113772 ], "datatype": "Float64", "type": "series" }, "meta": { - "julia_version": "1.10.2", - "solver_version": "v0.1.0-41-ga05975e-dirty", + "julia_version": "1.10.4", + "solver_version": "v0.1.3-13-gba229583-dirty", "solver_name": "TrixiParticles.jl" }, "pressure_P2_fluid_1": { @@ -357,52 +357,52 @@ 0.0, 0.0, 0.0, - 20.31323264129541, - 45.50619772878511, - 6.167987914971771, - 23.88731586293732, - 4.430147325868489, - 8.768109090756356, - 8.968266092741535, - 40.8056081128188, - 13.266289074276875, - 7.21976446106391, - 35.837578093058696, - 21.219114696929093, - 3.49673027837686, - 85.22260579192265, - 198.6594657678087, - 84.42527669302487, - 222.28302368858368, - 255.70201681023167, - 287.17352794962125, - 390.1368774908667, - 461.6354219207832, - 479.2956919031473, - 668.131582134366, - 708.6708868363967, - 645.0338221375232, - 1006.9495976769247, - 1022.5991860047172, - 1088.542578329139, - 974.647785952737, - 1302.905562870689, - 1559.2866782248348, - 1896.6993512365123, - 1934.924534902601, - 1663.477452114545, - 1419.3260734938583, - 1576.7967846720799, - 1467.524148572022, - 1574.549493950828, - 1358.3707085870317, - 626.3587223898397, - 170.68459310977235, - 16.588120937902353, + 20.3132326366937, + 45.506197598910425, + 6.167987923733813, + 23.887314831202918, + 4.430148075916101, + 8.76811001532418, + 8.968259703514502, + 40.80559476021091, + 13.26629746261045, + 7.219758272337951, + 35.83726016448203, + 21.218463663423346, + 3.4966654526399, + 85.23512420399115, + 198.65416895319578, + 84.48974635705306, + 222.29155467756635, + 255.43125147083902, + 287.23391178734335, + 390.1696795497561, + 461.91162870655955, + 479.11323144921516, + 667.8426718144549, + 708.7344247376486, + 644.8857046785624, + 1006.8132925405816, + 1022.7354684490043, + 1088.342001916656, + 974.7707867811401, + 1302.050029525441, + 1560.079556021026, + 1896.125503607862, + 1935.2967822571986, + 1663.5308377302845, + 1418.3101432145959, + 1573.5077500876025, + 1467.4256647079364, + 1575.1532758659146, + 1357.7375756382328, + 628.5301668632553, + 171.29654252780685, + 16.584949455032774, 0.0, 0.0, 0.0, - 6.927951997943524, + 6.927951989900288, 0.0, 0.0, 0.0, @@ -531,105 +531,105 @@ "system_name": "fluid", "values": [ 1.19625, - 1.2023151894699518, - 1.2178047411946762, - 1.243157491913713, - 1.2770869973245222, - 1.3179282960365564, + 1.202315189469952, + 1.2178047411946766, + 1.2431574919137134, + 1.2770869973245225, + 1.3179282960365566, 1.364441291682277, 1.415616412333505, 1.470830679860593, 1.5296724290345078, - 1.5918075373727552, - 1.6569645052768507, - 1.7248666483318587, - 1.7952375999021644, - 1.8679490290611684, - 1.9429100148561393, - 2.020048436924589, - 2.0991787194449283, - 2.179974297251634, - 2.2620672646721722, - 2.345291120304705, - 2.4297138720834495, + 1.5918075373727554, + 1.6569645052768502, + 1.7248666483318584, + 1.7952375999021646, + 1.8679490290611678, + 1.9429100148561405, + 2.020048436924594, + 2.0991787194449363, + 2.1799742972516363, + 2.2620672646721696, + 2.3452911203047044, + 2.429713872083448, 2.5153615122050486, - 2.602293896796195, - 2.690621438124939, - 2.780398787100872, - 2.8713710350520953, - 2.963162401302029, - 3.055739609626199, - 3.1480995749182057, - 3.217883381034535, - 3.218252199192597, - 3.2190358988544663, - 3.2196639730256824, - 3.2192588413420857, - 3.218391850339578, - 3.2182383945174027, - 3.2182173493351147, - 3.218213527639729, - 3.2182331098537924, - 3.218212354866577, - 3.2182351451319797, - 3.2181860314410864, - 3.2181826027767317, - 3.2182616091503014, - 3.2182900394924134, - 3.2181013332171955, - 3.218180707465579, - 3.2182413760911537, - 3.2182366042723656, - 3.218190838368207, - 3.218206894438811, - 3.2181922164947707, - 3.2182183047852124, - 3.218209781429125, - 3.2182014695396095, - 3.2181983905210876, - 3.218217781625702, - 3.2182083303459947, - 3.2182141488580243, - 3.2181940144865617, - 3.21819491946819, - 3.218204747678986, - 3.2181938551073994, - 3.2181978426903326, - 3.21820542694873, - 3.2182070153294915, - 3.218334642143193, - 3.218585647166958, - 3.2188866053900216, - 3.21920207104197, - 3.219574419965984, - 3.2195825814614847, - 3.218935747756291, - 3.218199845786071, - 3.21819638894806, - 3.2181940755753295, - 3.2182116677167216, - 3.2182091551294025, - 3.218208689192445, - 3.2182110246884483, - 3.2182138808799365, - 3.218194754804018, - 3.2194851978366095, - 3.218192847601363, - 3.218212526157722, - 3.218208556745474, - 3.2182025076371104, - 3.2181962807514766, - 3.218224806925123, - 3.218198412662153, - 3.2182146801528235, - 3.21819542100968, - 3.2189620377926227, - 3.218968460252789, - 3.2189665397479192, - 3.2189697305224594, - 3.2189438274647815, - 3.218954688518879, - 3.2189532497664337 + 2.6022938967962066, + 2.690621438124972, + 2.780398787100924, + 2.8713710350521526, + 2.963162401302092, + 3.055739609626265, + 3.1480995749181715, + 3.217883381034528, + 3.218252199192589, + 3.2190358988545382, + 3.219663973025803, + 3.219258841342288, + 3.2183918503397946, + 3.2182383945173734, + 3.2182173493351236, + 3.2182135276396933, + 3.2182331098538572, + 3.2182123548666928, + 3.218235145131995, + 3.2181860314411197, + 3.2181826027769658, + 3.2182616091502703, + 3.218290039492076, + 3.2181013332170925, + 3.218180707465802, + 3.2182413760910786, + 3.2182366042722617, + 3.2181908383686157, + 3.2182068944393105, + 3.218192216494622, + 3.21821830478572, + 3.218209781430261, + 3.218201469538561, + 3.218198390520528, + 3.218217781624621, + 3.218208330344668, + 3.218214148857508, + 3.218194014486565, + 3.2181949194686568, + 3.218204747677704, + 3.218193855107256, + 3.218197842689399, + 3.2182054269496088, + 3.2182070153301927, + 3.218334642136327, + 3.2185856471588514, + 3.2188866053793577, + 3.219202071025817, + 3.2195744199487057, + 3.219582581480567, + 3.218935747801575, + 3.218199845785662, + 3.2181963889482237, + 3.2181940755753287, + 3.21821166771662, + 3.2182091551292666, + 3.2182086891923993, + 3.218211024688416, + 3.218213880879892, + 3.2181947548038403, + 3.2193810940071197, + 3.2181928476012893, + 3.2182125261570063, + 3.218208556744524, + 3.218202507638138, + 3.218196280751973, + 3.2182248069263264, + 3.2181984126643544, + 3.2197571667480624, + 3.2223076571447766, + 3.2233333443176866, + 3.2233103539275065, + 3.223426882197497, + 3.223015675647925, + 3.2212832518719234, + 3.2198507996538672, + 3.2185453526154637 ], "datatype": "Float64", "type": "series" @@ -782,42 +782,42 @@ 0.0, 0.0, 0.0, - 48.777455403164595, - 10.358164544007067, - 15.04960832545812, - 8.912918411774163, - 3.1038547518232447, - 9.080093791795168, - 11.001861768010636, - 4.389149228051656, - 9.327505518523214, - 8.079456786928928, - 8.873355574751367, - 11.709335633413499, - 9.772263422141894, - 10.115246645209131, - 7.9532840524051505, - 3.9255626813013116, - 7.572786369647373, - 8.644475585297913, - 8.179980736326566, - 4.026316518597092, - 3.9816360448056907, - 3.2242512880165095, - 13.986955872502259, - 2.3506997098606854, - 9.465894897841721, - 15.270226515067424, - 4.803273021482147, - 17.17178281543346, - 16.48196895654314, - 35.117449625443314, + 48.7774554134991, + 10.35816454333565, + 15.049608315718615, + 8.912918391919748, + 3.103854748608593, + 9.0800939918202, + 11.001863233473113, + 4.389148180766781, + 9.327478627251026, + 8.079284370849852, + 8.873249154234701, + 11.709585905585026, + 9.77520724597802, + 10.127454324753987, + 7.952132382719142, + 3.914384862285151, + 7.584703944457982, + 8.636013029316294, + 8.179595049092772, + 4.021512848202964, + 3.9832592764567734, + 3.2242797741970515, + 13.985545386185837, + 2.3507923732967093, + 9.465944977386606, + 15.270268976152158, + 4.803282386315496, + 17.17178938083105, + 16.48196852380488, + 35.11745109684933, 0.0, 0.0, 0.0, 0.0, 0.0, - 6.527361132717613, + 6.527361124875505, 0.0, 0.0, 0.0, @@ -844,4 +844,4 @@ "datatype": "Float64", "type": "series" } -} \ No newline at end of file +} diff --git a/validation/dam_break_2d/validation_reference_wcsph_0015.json b/validation/dam_break_2d/validation_reference_wcsph_0015.json index 56662a459..da3aa8d77 100644 --- a/validation/dam_break_2d/validation_reference_wcsph_0015.json +++ b/validation/dam_break_2d/validation_reference_wcsph_0015.json @@ -139,79 +139,79 @@ 0.0, 0.0, 0.0, - 741.9939895034533, - 1074.823477526557, - 780.1667978278533, - 750.2646818625105, - 1867.0876195480973, - 2289.223377185172, - 1854.778592795079, - 1898.4536965337563, - 1467.7442181784463, - 1634.0625814441341, - 1051.0175421397894, - 1792.9924986054696, - 2224.44957136399, - 2072.497448511862, - 1759.7941823838978, - 2213.446718347899, - 2195.8823765248344, - 2296.936996796624, - 2110.26221033083, - 2199.2841631050296, - 2970.3732277673735, - 2306.9379075970605, - 2708.5489780064477, - 3000.1787276966415, - 2269.7922168984032, - 2084.462803522515, - 2584.892959415741, - 2922.9579331489513, - 2700.96048467049, - 2912.959472927148, - 2333.0945761449198, - 2272.699760539699, - 2482.927145390145, - 2818.1481398849137, - 2995.431879484659, - 2909.3787969527793, - 3100.770191742455, - 3025.9650728686365, - 3235.200330338881, - 3257.7536083922405, - 2988.768529824477, - 3115.2219953824097, - 3505.964207981934, - 3713.9020435212456, - 4590.047833488942, - 4356.981088994886, - 6158.5534685202465, - 6758.256849320384, - 5924.747293352886, - 3779.601511593646, - 853.4159363416477, - 1654.7441086189888, - 1292.725609178739, - 5035.3022616347025, - 2519.4325603311504, - 2200.0503609676116, - 677.4791455662695, - 1260.2892839989977, - 632.0785128025252, - 1342.5190787770055, - 2015.993021332793, - 1480.8010982207184, - 1092.6724464916224, - 1240.7416518698235, - 3695.038480349523, - 790.4034873096698 + 741.9939894941161, + 1074.8234775419064, + 780.1667977983495, + 750.2646817965242, + 1867.08762030672, + 2289.2233759912247, + 1854.7785998767006, + 1898.453697473415, + 1467.7442157903656, + 1634.062574729558, + 1051.0175454493262, + 1792.9925481127138, + 2224.449558613032, + 2072.497465141353, + 1759.794069817981, + 2213.446972826469, + 2195.882145401453, + 2296.9376171096033, + 2110.2625422401406, + 2199.284417957469, + 2970.3729886217925, + 2306.9379961030972, + 2708.54854143124, + 3000.178961110748, + 2269.7914825883727, + 2084.46326687383, + 2584.893756955662, + 2922.957602862567, + 2700.958413393041, + 2912.9576723846003, + 2333.09770001446, + 2272.6994286696568, + 2482.928489088778, + 2818.1500608575225, + 2995.4296021134114, + 2909.384818957345, + 3100.768682842804, + 3025.965626089036, + 3235.1937887075883, + 3257.7694969252993, + 2988.7165897907526, + 3115.2475969675297, + 3506.0055442620483, + 3713.9557644738297, + 4590.039485983636, + 4357.68160831519, + 6158.70817750291, + 6758.312480580455, + 5925.481085152471, + 3780.387391552663, + 853.6451757823148, + 1655.2390838713739, + 1292.5050751537487, + 5034.356481652622, + 2519.643630683563, + 2203.5472240351637, + 680.5241278250141, + 1256.9462867653692, + 630.2038014875667, + 1340.265468672852, + 2019.2329252977863, + 1484.0226816893737, + 1093.41633133606, + 1239.0068342704003, + 3683.605062288783, + 773.8228549605686 ], "datatype": "Float64", "type": "series" }, "meta": { - "julia_version": "1.10.2", - "solver_version": "v0.1.0-40-gafc1aaf", + "julia_version": "1.10.4", + "solver_version": "v0.1.3-14-g54ab29d7-dirty", "solver_name": "TrixiParticles.jl" }, "pressure_P2_fluid_1": { @@ -360,41 +360,41 @@ 0.0, 0.0, 0.0, - 47.779426335028596, - 44.3755113096053, - 30.47391316492869, - 8.476970547767014, - 33.57949084782525, - 1.86325295891417, - 22.444830543469468, - 5.2297499045038816, - 12.452369473099422, - 113.28030365232425, - 16.872542628935967, - 183.53132403395512, - 124.91982103570506, - 119.72063152487195, - 157.1866385869409, - 274.41221818832616, - 366.9284030230333, - 436.7981563485061, - 656.8644583863837, - 693.680435675162, - 709.8626787029332, - 940.2768525263258, - 713.5965127260125, - 1152.7101065183833, - 1175.085784491902, - 1117.0751123518626, - 1473.3121783676756, - 1398.3778231249435, - 1426.7193716891154, - 1724.669726207463, - 1689.5768339343053, - 1716.4132703616517, - 2313.2808326123604, - 1548.3843452879687, - 872.6651774696463, + 47.77942634369649, + 44.375511313221345, + 30.473913163356734, + 8.476970510079521, + 33.579491133590324, + 1.8632529098355597, + 22.444829684654433, + 5.229750079850122, + 12.452370834324002, + 113.28027957495551, + 16.872562738228645, + 183.5315245289665, + 124.91984602042135, + 119.72104154525792, + 157.1864160311265, + 274.41219156990917, + 366.92847165932085, + 436.79794883741, + 656.8640507679853, + 693.6802133948, + 709.862909706101, + 940.278121121881, + 713.5971627109215, + 1152.7070981848638, + 1175.0855781815612, + 1117.076899252823, + 1473.3128533231097, + 1398.3755239396, + 1426.719439477286, + 1724.6731572208005, + 1689.562585593239, + 1716.4116210075088, + 2313.3027454703406, + 1548.5116301666328, + 872.4679137189785, 0.0, 0.0, 0.0, @@ -535,101 +535,101 @@ 1.2114046382489772, 1.2336420690085277, 1.2644066208331137, - 1.3028362471750405, - 1.3476751813676169, - 1.39792651618743, - 1.452682209212999, - 1.5111470319630955, - 1.5729272010563116, - 1.6376619970447719, - 1.7050782695517805, + 1.3028362471750408, + 1.347675181367617, + 1.3979265161874306, + 1.4526822092129996, + 1.511147031963096, + 1.572927201056312, + 1.637661997044772, + 1.7050782695517808, 1.7749222353523975, 1.847038101770687, - 1.9214486425691792, - 1.997711487763412, - 2.075603680636451, - 2.154884538478037, + 1.9214486425691788, + 1.9977114877634115, + 2.07560368063645, + 2.1548845384780364, 2.235402446374902, - 2.317146330306622, - 2.400082966455745, - 2.4841380843809278, - 2.569322713974655, - 2.6555845619869305, - 2.742628218729764, - 2.8301077178490366, - 2.917793645723982, - 3.00557811931334, - 3.093465691067416, - 3.181955310695781, - 3.210824766446009, - 3.2113869376507593, - 3.2114127336130904, - 3.211416086243699, - 3.211389363109841, - 3.2114263696509733, - 3.211360939063853, - 3.2113423890613726, - 3.2113730636581423, - 3.211416879533602, - 3.2115410232660544, - 3.211420449020959, - 3.2113404149551292, - 3.2114367116116433, - 3.2114314964286073, - 3.2113887143331348, - 3.211430070547805, - 3.21138921418565, - 3.2113859601123305, - 3.2113923720866837, - 3.211392764090055, - 3.2113232302753256, - 3.2112382778331168, - 3.2111709478503747, - 3.2110448136299907, - 3.210961931912992, - 3.2108357753696595, - 3.210676328658437, - 3.2104947086715394, - 3.2102932553041774, - 3.2100651346283873, - 3.2097946508137327, - 3.2095209162980893, - 3.2091908718225577, - 3.2088580733865246, - 3.208540190797431, - 3.209252986094329, - 3.2109615902106654, - 3.2087142100000996, - 3.207877151637441, - 3.209981078282075, - 3.2099475145370917, - 3.2059177379649135, - 3.2055004729811776, - 3.206091143678486, - 3.2055193197002003, - 3.2060219413836486, - 3.208390543508341, - 3.209639183492156, - 3.2099090780661865, - 3.2091035797982252, - 3.2060994879120677, - 3.204667302726753, - 3.2049293269676054, - 3.2055243749588707, - 3.205489593713636, - 3.2070488215164983, - 3.2059831350068317, - 3.2056723103164897, - 3.2056894526500916, - 3.2056003904638524, - 3.2054279890859227, - 3.2056363154541985, - 3.2081676171369784, - 3.2106976756102723, - 3.210581134988433, - 3.209557542221741, - 3.208689628218864, - 3.2042633909252842 + 2.3171463303066244, + 2.400082966455748, + 2.4841380843809318, + 2.5693227139746613, + 2.6555845619869367, + 2.742628218729768, + 2.830107717849038, + 2.917793645723979, + 3.0055781193133364, + 3.09346569106741, + 3.181955310695774, + 3.2108247664460063, + 3.211386937650757, + 3.2114127336130864, + 3.2114160862436933, + 3.2113893631098325, + 3.211426369650969, + 3.211360939063848, + 3.2113423890613713, + 3.2113730636581637, + 3.2114168795335085, + 3.2115410232662565, + 3.2114204490216545, + 3.2113404149550546, + 3.2114367116115448, + 3.211431496428606, + 3.2113887143331468, + 3.2114300705477894, + 3.211389214185646, + 3.2113859601123282, + 3.211392372086674, + 3.211392764090098, + 3.2113232302753105, + 3.211238277833076, + 3.2111709478503205, + 3.211044813629903, + 3.2109619319128195, + 3.21083577536939, + 3.2106763286581064, + 3.2104947086710682, + 3.210293255303667, + 3.2100651346277935, + 3.209794650813026, + 3.209520916297318, + 3.2091908718216957, + 3.20885807338562, + 3.208540190796503, + 3.209252964618359, + 3.2109615466846986, + 3.2087142012736516, + 3.2078772506798954, + 3.2099810760245466, + 3.20994747330135, + 3.2059177379642274, + 3.205500472980549, + 3.2060909696091024, + 3.205519260230836, + 3.2060264002774814, + 3.2083882184346773, + 3.2096499465165684, + 3.209893569173547, + 3.209092048678204, + 3.206118174149346, + 3.20466730349358, + 3.2049294423139787, + 3.2055244294683165, + 3.2054895907239787, + 3.2071107834089214, + 3.2059833918202854, + 3.2056723666051035, + 3.205690399676298, + 3.2056006533020684, + 3.205428201120508, + 3.2056362010514956, + 3.2081045235200265, + 3.2106595262805375, + 3.210515914506536, + 3.2094021317674626, + 3.208368177334562, + 3.2040436011282045 ], "datatype": "Float64", "type": "series" @@ -789,29 +789,29 @@ 0.0, 0.0, 0.0, - 7.495670452200194, - 4.405996201079288, - 3.863768751307385, - 5.608251391833488, - 5.873393414199472, - 8.085514751124725, - 5.478880909811544, - 4.599391660688403, - 4.499303678841139, - 4.5937747885098, - 4.183039155161291, - 1.4104749893139292, - 3.204735219197912, - 11.008687038401128, - 5.743991393979669, - 4.599470537356818, + 7.495670446908801, + 4.405996200454077, + 3.8637687674298653, + 5.60825135262144, + 5.873392682873446, + 8.085515237034553, + 5.4788822543292675, + 4.599391030430677, + 4.499302816037752, + 4.593776235423508, + 4.183048098286252, + 1.4104774994962948, + 3.2047361848951583, + 11.008689027931212, + 5.743988847708243, + 4.599476922514732, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 6.936334864959468, + 6.936334862662617, 0.0, 0.0, 0.0, @@ -844,4 +844,4 @@ "datatype": "Float64", "type": "series" } -} \ No newline at end of file +} From 964c2e96ccead04fef16eadb66ab151648d721ee Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:25:42 +0200 Subject: [PATCH 4/4] Use `@threaded` macro from PointNeighbors.jl (#573) * Use `@threaded` from PointNeighbors.jl * Remove `adapt_structure` definitions that are also in PointNeighbors.jl * Use PointNeighbors.jl v0.4.1 * Use v0.4.2 of PointNeighbors.jl --- Project.toml | 6 ++-- src/TrixiParticles.jl | 5 ++-- src/general/gpu.jl | 17 ++++------- src/util.jl | 69 ------------------------------------------- 4 files changed, 11 insertions(+), 86 deletions(-) diff --git a/Project.toml b/Project.toml index 8c35140b3..875fb55df 100644 --- a/Project.toml +++ b/Project.toml @@ -11,7 +11,7 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" FastPow = "c0e83750-1142-43a8-81cf-6c956b72b4d1" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" -GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" +GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -35,11 +35,11 @@ DataFrames = "1.6" DiffEqCallbacks = "2.25, 3" FastPow = "0.1" ForwardDiff = "0.10" -GPUArrays = "9, 10" +GPUArraysCore = "0.1" JSON = "0.21" KernelAbstractions = "0.9" MuladdMacro = "0.2" -PointNeighbors = "0.4" +PointNeighbors = "0.4.2" Polyester = "0.7.5" RecipesBase = "1" Reexport = "1" diff --git a/src/TrixiParticles.jl b/src/TrixiParticles.jl index e7e016a0b..846bfa4a0 100644 --- a/src/TrixiParticles.jl +++ b/src/TrixiParticles.jl @@ -9,7 +9,7 @@ using DataFrames: DataFrame using DiffEqCallbacks: PeriodicCallback, PeriodicCallbackAffect, PresetTimeCallback using FastPow: @fastpow using ForwardDiff: ForwardDiff -using GPUArrays: AbstractGPUArray +using GPUArraysCore: AbstractGPUArray using JSON: JSON using KernelAbstractions: KernelAbstractions, @kernel, @index using LinearAlgebra: norm, dot, I, tr, inv, pinv, det @@ -28,7 +28,8 @@ using TrixiBase: trixi_include, @trixi_timeit, timer, timeit_debug_enabled, @reexport using PointNeighbors: TrivialNeighborhoodSearch, GridNeighborhoodSearch, PrecomputedNeighborhoodSearch, PeriodicBox, ParallelUpdate, SemiParallelUpdate, SerialUpdate -using PointNeighbors: PointNeighbors, foreach_point_neighbor, copy_neighborhood_search +using PointNeighbors: PointNeighbors, foreach_point_neighbor, copy_neighborhood_search, + @threaded using WriteVTK: vtk_grid, MeshCell, VTKCellTypes, paraview_collection, vtk_save # `util.jl` depends on the `GPUSystem` type defined in `system.jl` diff --git a/src/general/gpu.jl b/src/general/gpu.jl index 8aa481cff..bef795099 100644 --- a/src/general/gpu.jl +++ b/src/general/gpu.jl @@ -22,21 +22,14 @@ function Adapt.adapt_structure(to, ic::InitialCondition) return nothing end -# `adapt(CuArray, ::SVector)::SVector`, but `adapt(Array, ::SVector)::Vector`. -# We don't want to change the type of the `SVector` here. -function Adapt.adapt_structure(to::typeof(Array), svector::SVector) - return svector -end - -# `adapt(CuArray, ::UnitRange)::UnitRange`, but `adapt(Array, ::UnitRange)::Vector`. -# We don't want to change the type of the `UnitRange` here. -function Adapt.adapt_structure(to::typeof(Array), range::UnitRange) - return range -end - KernelAbstractions.get_backend(::PtrArray) = KernelAbstractions.CPU() KernelAbstractions.get_backend(system::System) = KernelAbstractions.get_backend(system.mass) function KernelAbstractions.get_backend(system::BoundarySPHSystem) KernelAbstractions.get_backend(system.coordinates) end + +# On GPUs, execute `f` inside a GPU kernel with KernelAbstractions.jl +@inline function PointNeighbors.parallel_foreach(f, iterator, system::GPUSystem) + PointNeighbors.parallel_foreach(f, iterator, KernelAbstractions.get_backend(system)) +end diff --git a/src/util.jl b/src/util.jl index 172f0a800..f8958e8e4 100644 --- a/src/util.jl +++ b/src/util.jl @@ -26,75 +26,6 @@ function print_startup_message() println(s) end -""" - @threaded system for ... end - -Run either a threaded CPU loop or launch a kernel on the GPU, depending on the type of `system`. -Semantically the same as `Threads.@threads` when iterating over a `AbstractUnitRange` -but without guarantee that the underlying implementation uses `Threads.@threads` -or works for more general `for` loops. -The first argument must either be a particle system or an array from which can be derived -if the loop has to be run threaded on the CPU or launched as a kernel on the GPU. - -In particular, the underlying threading capabilities might be provided by other packages -such as [Polyester.jl](https://github.com/JuliaSIMD/Polyester.jl). - -!!! warn - This macro does not necessarily work for general `for` loops. For example, - it does not necessarily support general iterables such as `eachline(filename)`. -""" -macro threaded(system, expr) - # Reverse-engineer the for loop. - # `expr.args[1]` is the head of the for loop, like `i = eachindex(x)`. - # So, `expr.args[1].args[2]` is the iterator `eachindex(x)` - # and `expr.args[1].args[1]` is the loop variable `i`. - iterator = expr.args[1].args[2] - i = expr.args[1].args[1] - inner_loop = expr.args[2] - - # Assemble the for loop again as a call to `parallel_foreach`, using `$i` to use the - # same loop variable as used in the for loop. - return esc(quote - TrixiParticles.parallel_foreach($iterator, $system) do $i - $inner_loop - end - end) -end - -# Use `Polyester.@batch` for low-overhead threading -@inline function parallel_foreach(f, iterator, system) - Polyester.@batch for i in iterator - @inline f(i) - end -end - -# On GPUs, execute `f` inside a GPU kernel with KernelAbstractions.jl -@inline function parallel_foreach(f, iterator, system::Union{GPUSystem, AbstractGPUArray}) - # On the GPU, we can only loop over `1:N`. Therefore, we loop over `1:length(iterator)` - # and index with `iterator[eachindex(iterator)[i]]`. - # Note that this only works with vector-like iterators that support arbitrary indexing. - indices = eachindex(iterator) - ndrange = length(indices) - - # Skip empty loops - ndrange == 0 && return - - backend = KernelAbstractions.get_backend(system) - - # Call the generic kernel that is defined below, which only calls a function with - # the global GPU index. - generic_kernel(backend)(ndrange=ndrange) do i - @inline f(iterator[indices[i]]) - end - - KernelAbstractions.synchronize(backend) -end - -@kernel function generic_kernel(f) - i = @index(Global) - @inline f(i) -end - @doc raw""" examples_dir()