mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-12-21 00:51:21 +00:00
Seperate reference and all vs
This commit is contained in:
parent
bb0e68d48d
commit
bfcc1fee3f
3 changed files with 43 additions and 22 deletions
|
@ -102,9 +102,9 @@ version = "0.10.2"
|
||||||
|
|
||||||
[[deps.CUDA]]
|
[[deps.CUDA]]
|
||||||
deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CompilerSupportLibraries_jll", "ExprTools", "GPUArrays", "GPUCompiler", "LLVM", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "SpecialFunctions", "TimerOutputs"]
|
deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CompilerSupportLibraries_jll", "ExprTools", "GPUArrays", "GPUCompiler", "LLVM", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "SpecialFunctions", "TimerOutputs"]
|
||||||
git-tree-sha1 = "e2d995efe0e223773a74778ce539e60025b09e52"
|
git-tree-sha1 = "3eb49a30d6093dfb6cd60ea66ff681a7db87178a"
|
||||||
uuid = "052768ef-5323-5732-b1bb-66c8b64840ba"
|
uuid = "052768ef-5323-5732-b1bb-66c8b64840ba"
|
||||||
version = "3.7.0"
|
version = "3.7.1"
|
||||||
|
|
||||||
[[deps.Cairo]]
|
[[deps.Cairo]]
|
||||||
deps = ["Cairo_jll", "Colors", "Glib_jll", "Graphics", "Libdl", "Pango_jll"]
|
deps = ["Cairo_jll", "Colors", "Glib_jll", "Graphics", "Libdl", "Pango_jll"]
|
||||||
|
|
|
@ -139,11 +139,13 @@ function radial_distribution(;
|
||||||
return (lower_radii, gs, particle_radius)
|
return (lower_radii, gs, particle_radius)
|
||||||
end
|
end
|
||||||
|
|
||||||
function plot_radial_distributions(
|
function plot_radial_distributions(;
|
||||||
v₀s::NTuple{N,Float64},
|
v₀s::NTuple{N,Float64},
|
||||||
lower_radii::AbstractVector{Float64},
|
lower_radii::AbstractVector{Float64},
|
||||||
gs::Vector{Vector{Float64}},
|
gs::Vector{Vector{Float64}},
|
||||||
particle_radius::Float64,
|
particle_radius::Float64,
|
||||||
|
include_comparison::Bool,
|
||||||
|
filename_addition::String="",
|
||||||
) where {N}
|
) where {N}
|
||||||
println("Plotting the radial distributions")
|
println("Plotting the radial distributions")
|
||||||
|
|
||||||
|
@ -176,33 +178,41 @@ function plot_radial_distributions(
|
||||||
)
|
)
|
||||||
|
|
||||||
for (g_ind, g) in enumerate(gs)
|
for (g_ind, g) in enumerate(gs)
|
||||||
|
v₀ = round(Int64, v₀s[g_ind])
|
||||||
scatterlines!(
|
scatterlines!(
|
||||||
ax, lower_radii, g; markersize=3, linewidth=0.5, label=L"v_0 = %$(v₀s[g_ind])"
|
ax,
|
||||||
|
lower_radii,
|
||||||
|
g;
|
||||||
|
markersize=3,
|
||||||
|
linewidth=1,
|
||||||
|
label=L"Simulation with $v_0 = %$(v₀)$",
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
comparison_curve = CSV.read(
|
if include_comparison
|
||||||
"analysis/radial_distribution_function/g_of_r_d_ratio_with_0_37_packing_ratio.csv",
|
comparison_curve = CSV.read(
|
||||||
DataFrames.DataFrame;
|
"analysis/radial_distribution_function/g_of_r_d_ratio_with_0_37_packing_ratio.csv",
|
||||||
header=3,
|
DataFrames.DataFrame;
|
||||||
)
|
header=3,
|
||||||
lines!(
|
)
|
||||||
ax,
|
lines!(
|
||||||
comparison_curve.r_d_ratio,
|
ax,
|
||||||
comparison_curve.g_of_r_d_ratio;
|
comparison_curve.r_d_ratio,
|
||||||
label="Similar system",
|
comparison_curve.g_of_r_d_ratio;
|
||||||
color=:green,
|
label=L"Reference with $v_0 = 0$",
|
||||||
)
|
color=:orange,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
axislegend(ax; position=:rt, padding=3, rowgap=-3)
|
axislegend(ax; position=:rt, padding=3, rowgap=-3)
|
||||||
|
|
||||||
save_fig("radial_distribution.pdf", fig)
|
save_fig("radial_distribution$filename_addition.pdf", fig)
|
||||||
|
|
||||||
return nothing
|
return nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
function run_radial_distribution_analysis()
|
function run_radial_distribution_analysis()
|
||||||
v₀s = (0.0, 20.0)
|
v₀s = (0.0, 40.0, 80.0)
|
||||||
|
|
||||||
n_particles = 1000
|
n_particles = 1000
|
||||||
|
|
||||||
|
@ -211,10 +221,21 @@ function run_radial_distribution_analysis()
|
||||||
)
|
)
|
||||||
|
|
||||||
lower_radii, gs, particle_radius = radial_distribution(;
|
lower_radii, gs, particle_radius = radial_distribution(;
|
||||||
sim_dirs=sim_dirs, n_radii=56, n_last_snapshots=200, n_particles=n_particles
|
sim_dirs=sim_dirs, n_radii=58, n_last_snapshots=200, n_particles=n_particles
|
||||||
)
|
)
|
||||||
|
|
||||||
plot_radial_distributions(v₀s, lower_radii, gs, particle_radius)
|
plot_radial_distributions(;
|
||||||
|
v₀s=v₀s[1:1], lower_radii, gs=gs[1:1], particle_radius, include_comparison=true
|
||||||
|
)
|
||||||
|
|
||||||
|
plot_radial_distributions(;
|
||||||
|
v₀s=v₀s[1:end],
|
||||||
|
lower_radii,
|
||||||
|
gs=gs[1:end],
|
||||||
|
particle_radius,
|
||||||
|
include_comparison=false,
|
||||||
|
filename_addition="_all_vs",
|
||||||
|
)
|
||||||
|
|
||||||
return nothing
|
return nothing
|
||||||
end
|
end
|
|
@ -69,7 +69,7 @@ function gen_sim_consts(
|
||||||
|
|
||||||
skin_r = skin_to_interaction_r_ratio * interaction_r
|
skin_r = skin_to_interaction_r_ratio * interaction_r
|
||||||
|
|
||||||
buffer = 2.2
|
buffer = 2.5
|
||||||
max_approach_after_one_integration_step = buffer * (2 * v₀ * δt)
|
max_approach_after_one_integration_step = buffer * (2 * v₀ * δt)
|
||||||
@assert skin_r >= interaction_r + max_approach_after_one_integration_step
|
@assert skin_r >= interaction_r + max_approach_after_one_integration_step
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ function gen_sim_consts(
|
||||||
Int64, (skin_r - interaction_r) / max_approach_after_one_integration_step
|
Int64, (skin_r - interaction_r) / max_approach_after_one_integration_step
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
n_steps_before_verlet_list_update = 1200
|
n_steps_before_verlet_list_update = 1000
|
||||||
end
|
end
|
||||||
|
|
||||||
grid_n = round(Int64, ceil(sqrt(n_particles)))
|
grid_n = round(Int64, ceil(sqrt(n_particles)))
|
||||||
|
|
Loading…
Reference in a new issue