We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ac2921 commit 12ec4f6Copy full SHA for 12ec4f6
scripts/lenard_bernstein.jl
@@ -46,7 +46,7 @@ params = (ν = model.ν, idist = model.dist, fdist = model.ent.dist, model = mod
46
47
48
f = projection(sol[:,1], dist, sdist)
49
-v = LB_rhs(collect(vgrid), params, f)
+v = VlasovMethods.LB_rhs(collect(vgrid), params, f)
50
mom = [mapreduce(p -> p[1], +, sol[:,i]) for i in 1:step:length(sol)]
51
enr = [mapreduce(p -> p[1].^2, +, sol[:,i]) for i in 1:step:length(sol)]
52
@@ -56,8 +56,8 @@ anim = @animate for i in 1:step:length(sol)
56
# compute quantities for plotting
57
f = projection(sol[:,i], dist, sdist)
58
df = Derivative(1) * f
59
- v = LB_rhs(collect(vgrid), params, f)
60
- # v = CLB_rhs(collect(vgrid), params, f)
+ v = VlasovMethods.LB_rhs(collect(vgrid), params, f)
+ # v = VlasovMethods.CLB_rhs(collect(vgrid), params, f)
61
62
plot(xlims = [-8, +8], ylims = [-0.5, +0.5], size=(1200,800))
63
scripts/cons_lenard_bernstein.jl renamed to scripts/lenard_bernstein_conservative.jl
@@ -3,7 +3,7 @@ using BSplineKit
3
using VlasovMethods
4
5
# output file
6
-h5file = "lenard_bernstein.hdf5"
+h5file = "lenard_bernstein_conservative.hdf5"
7
8
# params
9
# parameters
@@ -67,7 +67,7 @@ anim = @animate for n in 1:step:size(z,2)
67
f = projection(z[:,n], dist, sdist)
68
69
# v = LB_rhs(collect(vgrid), params, f)
70
- v = CLB_rhs(collect(vgrid), params, f)
+ v = VlasovMethods.CLB_rhs(collect(vgrid), params, f)
71
72
73
@@ -79,4 +79,4 @@ anim = @animate for n in 1:step:size(z,2)
79
end
80
81
# save animation to file
82
-gif(anim, "lenard_bernstein_anim.gif", fps=10)
+gif(anim, "lenard_bernstein_conservative_anim.gif", fps=10)
src/VlasovMethods.jl
@@ -18,7 +18,7 @@ using LinearAlgebra
18
19
import GeometricEquations
20
import GeometricEquations: ntime
21
-import GeometricIntegrators.Integrators
+import GeometricIntegrators
22
import DifferentialEquations
23
24
@@ -72,15 +72,16 @@ export GeometricIntegrator
# Vlasov models
74
75
-include("models/vlasov_poisson.jl")
+include("models/collision_operator.jl")
76
include("models/lenard_bernstein.jl")
77
-include("models/conservative_lb.jl")
+include("models/lenard_bernstein_conservative.jl")
78
+
+include("models/vlasov_model.jl")
+include("models/vlasov_poisson.jl")
export VlasovPoisson
83
export LenardBernstein
84
export ConservativeLenardBernstein
-export LB_rhs
-export CLB_rhs
85
86
# Example Problems
87
src/methods/geometric_integrator.jl
@@ -24,12 +24,12 @@ function run!(method::GeometricIntegrator, h5file)
h5z[:,1] = z₀
25
h5t[1] = t₀
26
27
- Integrators.initialize!(method.integrator)
+ GeometricIntegrators.Integrators.initialize!(method.integrator)
28
29
# loop over time steps showing progress bar
30
try
31
@showprogress 5 for n in 1:ntime(method.equation)
32
- Integrators.integrate!(method.integrator)
+ GeometricIntegrators.integrate!(method.integrator)
33
h5z[:,n+1] = method.integrator.solstep.q
34
h5t[n+1] = method.integrator.solstep.t
35
src/methods/splitting.jl
@@ -4,7 +4,7 @@ struct SplittingMethod{MT, ET, IT} <: ParticleMethod
equation::ET
integrator::IT
- function SplittingMethod(model::MT, equation::ET, integrator::IT) where {MT <: VlasovModel, ET <: GeometricEquations.GeometricProblem, IT}
+ function SplittingMethod(model::MT, equation::ET, integrator::IT) where {MT <: AbstractVlasovModel, ET <: GeometricEquations.GeometricProblem, IT}
new{MT,ET,IT}(model, equation, integrator)
10
src/models/collision_operator.jl
@@ -0,0 +1,2 @@
1
2
+abstract type CollisionOperator <: AbstractVlasovModel end
src/models/lenard_bernstein.jl
@@ -1,4 +1,4 @@
-struct LenardBernstein{XD, VD, DT <: DistributionFunction{XD,VD}, ET <: Entropy, T} <: VlasovModel
+struct LenardBernstein{XD, VD, DT <: DistributionFunction{XD,VD}, ET <: Entropy, T} <: CollisionOperator
dist::DT # distribution function
ent::ET # entropy
ν::T # collision frequency
src/models/conservative_lb.jl renamed to src/models/lenard_bernstein_conservative.jl
-struct ConservativeLenardBernstein{XD, VD, DT <: DistributionFunction{XD,VD}, ET <: Entropy, T} <: VlasovModel
+struct ConservativeLenardBernstein{XD, VD, DT <: DistributionFunction{XD,VD}, ET <: Entropy, T} <: CollisionOperator
@@ -96,8 +96,8 @@ function GeometricIntegrator(model::ConservativeLenardBernstein{1,1}, tspan::Tup
96
parameters = params)
97
98
# create integrator
99
- int = Integrators.Integrator(equ, Integrators.RK438())
100
- # int = Integrators.Integrator(equ, Integrators.CrankNicolson())
+ int = GeometricIntegrators.GeometricIntegrator(equ, GeometricIntegrators.RK438())
+ # int = GeometricIntegrators.GeometricIntegrator(equ, GeometricIntegrators.CrankNicolson())
101
102
# put together splitting method
103
GeometricIntegrator(model, equ, int)
src/models/model.jl
@@ -1,2 +1,2 @@
-abstract type VlasovModel end
+abstract type AbstractVlasovModel end
src/models/vlasov_model.jl
+abstract type VlasovModel <: AbstractVlasovModel end
0 commit comments