11
2- struct VlasovPoisson{XD, VD, DT <: DistributionFunction{XD,VD} , PT <: Potential , RT <: AbstractVector } <: VlasovModel
2+ struct VlasovPoisson{XD, VD, DT <: DistributionFunction{XD,VD} , PT <: Potential } <: VlasovModel
33 distribution:: DT
44 potential:: PT
5- rhs:: RT
65
76 function VlasovPoisson (dist:: DistributionFunction{XD,VD} , potential) where {XD,VD}
8- rhs = zero (potential. coefficients)
9- new {XD, VD, typeof(dist), typeof(potential), typeof(rhs)} (dist, potential, rhs)
7+ new {XD, VD, typeof(dist), typeof(potential)} (dist, potential)
108 end
119end
1210
1311
1412function update_potential! (model:: VlasovPoisson )
15- projection! (model. rhs, model . potential, model. distribution)
16- PoissonSolvers. update! (model. potential, model . rhs )
13+ projection! (model. potential, model. distribution)
14+ PoissonSolvers. update! (model. potential)
1715end
1816
1917
@@ -42,8 +40,8 @@ function v_advection!(ż, t, z, params)
4240 end
4341end
4442
45- # Vector field for Lorentz force
46- function v_lorentz_force ! (ż, t, z, params)
43+ # Vector field for acceleration
44+ function v_acceleration ! (ż, t, z, params)
4745 update_potential! (params. model)
4846 for i in axes (ż, 2 )
4947 ż[1 ,i] = 0
@@ -60,7 +58,7 @@ function s_advection!(z, t, z̄, t̄, params)
6058end
6159
6260# Solution for Lorentz force
63- function s_lorentz_force ! (z, t, z̄, t̄, params)
61+ function s_acceleration ! (z, t, z̄, t̄, params)
6462 update_potential! (params. model)
6563 for i in axes (z, 2 )
6664 z[1 ,i] = z̄[1 ,i]
7270# The problem is setup such that one solution step pushes all particles.
7371# While this allows for a simple implementation, it is not well-suited
7472# for parallelisation.
75- # Have a look at the CollisionalVlasovPoisson model for an alternative approach.
7673function SplittingMethod (model:: VlasovPoisson{1, 1, <: ParticleDistribution} , tspan:: Tuple , tstep:: Real )
7774 # collect parameters
7875 params = (ϕ = model. potential, model = model)
7976
8077 # create geometric problem
8178 equ = GeometricEquations. SODEProblem (
82- (v_advection!, v_lorentz_force !),
83- (s_advection!, s_lorentz_force !),
79+ (v_advection!, v_acceleration !),
80+ (s_advection!, s_acceleration !),
8481 tspan, tstep, copy (model. distribution. particles. z);
8582 parameters = params)
8683
8784 # create integrator
88- int = Integrators . Integrator (equ, Integrators . Strang ())
85+ int = GeometricIntegrators . GeometricIntegrator (equ, GeometricIntegrators . Strang ())
8986
9087 # put together splitting method
9188 SplittingMethod (model, equ, int)
0 commit comments