The vmf90 Program For The Numerical Resolution of The Vlasov Equation For Mean-Field Systems
The vmf90 Program For The Numerical Resolution of The Vlasov Equation For Mean-Field Systems
systems
Pierre de Buyl
Center for Nonlinear Phenomena and Complex Systems, Universite libre de Bruxelles, CP231, Campus Plaine, 1050 Brussels, Belgium
Abstract
The numerical resolution of the Vlasov equation provides complementary information with respect to analytical studies and forms
an important research tool in domains such as plasma physics. The study of mean-field models for systems with long-range
interactions is another field in which the Vlasov equation plays an important role. We present the vmf90 program that performs
numerical simulations of the Vlasov equation for this class of mean-field models with the semi-Lagrangian method.
Keywords: Vlasov equation ; Hamiltonian Mean-Field model ; Single Wave model
PROGRAM SUMMARY
Manuscript Title: The vmf90 program for the numerical resolution of
the Vlasov equation for mean-field systems
Author: Pierre de Buyl
Program Title: vmf90
Journal Reference:
Catalogue identifier:
Licensing provisions: vmf90 is available under the GNU General
Public License
Programming language: Fortran 95
Computer: Single CPU computer
Operating system: No specific operating system, the program is tested
under Linux and OS X
RAM: about 5 M bytes
Keywords: Vlasov equation, semi-Lagrangian method, Hamiltonian
Mean-Field model, Single-Wave model
Classification: 1.5 Relativity and Gravitation, 19.8 Kinetic Models,
19.13 Wave-plasma Interactions, 23 Statistical Physics and Thermodynamics.
External routines/libraries: HDF5 for the code (tested with HDF5
v1.8.8 and above). Python, NumPy, h5py and matplotlib for analysis.
Nature of problem:
Numerical resolution of the Vlasov equation for mean-field models
(Hamiltonian Mean-Field model and Single Wave model).
Solution method:
The equation is solved with the semi-Lagrangian method and cubic
spline interpolation.
Running time:
The examples provided with the program take 1m30 for the HamiltonianMean Field model and 10m for the Single Wave model, on an Intel
Core i7 CPU @ 3.33GHz. Increasing the number of grid points or the
number of time steps increases the running time.
Present address: Department of Chemistry, Katholieke Universiteit Leuven, Celestijnenlaan 200F, B-3001 Heverlee, Belgium
1. Introduction
The Vlasov equation provides an appropriate description
of collisionless plasmas, beam propagation, collisionless gravitational dynamics, among other systems of interest. Another
field of application is the study of mean-field models for longrange interactions [14] In these systems, thermodynamical
and dynamical properties can differ strongly with respect to
short-range interacting systems. The understanding of the
kinetic properties in these systems relies importantly on their
Vlasov description. Theoretical considerations and N-body
simulations form the majority of the literature but numerical
simulations of the Vlasov equation are found in a small number
of references [513]. These simulations provide a complementary point of view to N-body simulations by removing
the dependence on the number of simulated particles. The
number N of particles present in a simulation has a significant
impact on the dynamics of these long-range systems, especially on the timescale of the relaxation to equilibrium. Many
studies on long-range interacting systems are performed on
one-dimensional models. This makes the numerical resolution of the Vlasov equation by Eulerian methods, instead of
particle-in-cell methods, computationally accessible.
Numerical resolutions of the Vlasov equation are being
performed since decades, following the work of Cheng and
Knorr [14] on the time discretization of the problem. Most
of the research in this field is related to the simulation of the
Vlasov-Poisson system in plasma physics. As a consequence,
no code is available for the simulation of simpler mean-field
models. Altough existing codes for the Vlasov-Poisson system
could be easily converted for use with mean-field systems, we
propose here a code that is aimed specifically at these systems.
The vmf90 program presented in this article has already
been used to perform the numerical resolution of the Vlasov
equation for the Hamiltonian Mean-Field or free electron laser
models in the references [6] (at that time, a previous C++
March 26, 2014
2. Physical models
2.1. The Hamiltonian Mean-Field model
The Hamiltonian Mean-Field (HMF) model, introduced in
Ref. [15], consists of particles interacting via a cosine potential
in a periodic box. It is intended as a simplified description of
systems of charged or gravitational particles in which collective
behavior, caused by the all-to-all coupling of the particles, plays
an important role.
The HMF model serves as a reference model in the field of
systems with long-range interactions [3]. It exhibits peculiar
dynamical properties among which is the existence of the socalled quasi-stationary states (QSS). These states occur, starting from an out-of-equilibrium initial condition, after a O(1)
timescale but do not correspond to the equilibrium predicted by
statistical mechanics. The lifetime of the QSS increases algebraically with the number N of interacting particles in the system. In the thermodynamic limit, the dynamics remains stuck
in the QSS regime.
The Vlasov equation for the HMF model reads
+
V[ f ]()
mx [ f ]
1Z m x [ f ] cos my [ f ] sin ,
dd p f cos ,
Z
dd p f sin ,
=
=
=
f
f
+ 2(A x cos Ay sin )
,
Z
p
Ay + dd p f cos ,
Z
A x dd p f sin ,
(5)
f dV[ f ] f
=0,
d p
f
t
my [ f ]
f
t
A x
t
Ay
t
(7)
where A2x + A2y is the momentum of the wave, and the energy
U
Z
!
p2
+ 2 Ay cos + A x sin .
U(t)[ f ] =
d d p f (, p; t)
2
(8)
(1)
(3)
vmf90 is written in Fortran 90 and takes advantage of userdefined types, dynamic memory allocation and modules. Fortran 90 provides, with respect to older revisions of the Fortran programming language, many improvements for the structured coding of scientific programs. The reader is referred to
Refs. [1921] for more information on this topic. In addition to
these ideas, vmf90 takes profit of revision control with the git
software [22] and extensive in-code documentation.
(4)
The program is under revision control with the git software [22]. The information on the status of the source code
repository is included automatically during the build process
of the software and is updated at each rebuild so that the executable program always reflect this status. The programs display revision information: the commit reference (the SHA1) of
the code as well as a status that is one of the following
The grid.
DT = PTread_d(PT_variable, DT)
where DT is a double precision variable, PT variable holds
the information from the configuration file and the argument
DT indicates which variable should be looked upon in the
configuration file that is parsed. The routine PTread d is suited
for double precision variables and similar routines exist for the
other common Fortran data types. A configuration file is given
as an example in the Appendix Appendix A.
3.3. Data storage model and analysis tools
The vmf90 program stores data in the HDF5 format that
allows to store data to machine precision in structured files that
simplify the storage and analysis of the data. A derivative of the
H5MD [24, 25] file format is used for that purpose, allowing
a consistent storage of parameters and observables across the
file. Also, the version information for vmf90 described in the
previous section is part of the H5MD file.
To allow users who are not familiar with HDF5 or H5MD
to analyze the data, a small program displaying common results for the simulation is provided. It is a command-line tool
that takes as arguments the filename of the data and a command: snaps to display snapshots of phase space and plot
to display observables such as mass and energy.
type grid
integer :: Nx, Nv
double precision :: xmin, xmax, vmin, vmax
double precision :: dx, dv
double precision :: DT
double precision :: en_int, en_kin, energie, masse, momentum
logical :: is_periodic
double precision, allocatable :: f(:,:)
double precision, allocatable :: d2(:), copy(:)
double precision, allocatable :: rho(:), phi(:), force(:)
end type grid
Figure 1: The Fortran declaration of the grid UDT that serves as the building block for physical models.
1
f s+1 (x, v) = f s (x t(v + F ( x)t), v tF ( x)) ,
2
(9)
4. Algorithms
(10)
In a periodic system, x values outside of the box are evaluated at their periodic image inside the box. v values
outside the box are still evaluated to zero.
The evaluation as zero outside of the box corresponds to a zerovalue boundary condition. The box needs to be taken large
enough so that the normalization (conservation of the L1 norm)
is satisfied.
1 https://github.com/pdebuyl/vmf90
The single-wave model [16] represents an ensemble of particles in which the interaction is well represented by a single
component of the electromagnetic field. In addition to the particles, represented by the distribution function f , one needs to
consider also the field A x , Ay in the simulation as evidenced by
the coupled evolution equations (5). As isqtypical, we track the
7. Discussion
We have presented an open-source implementation of the
semi-Lagrangian algorithm for Vlasov simulations tailored for
mean-field models. This code has served as the basis for several
publications and its modular nature allows for an easy addition
of other models. The Fortran code uses modern additions to
the language that allows for structured programming. Other
technical features include the use of HDF5 for the storage of
simulation data, the inclusion of a simulation analysis program,
revision control of the source code and an extensive in code
documentation.
Acknowledgments
The author acknowledges fruitful collaboration with all of
his co-authors listed in the references. The author also acknowledges Peter H. Colberg for many useful technical discussions,
Claire Revillet and Jakub Krajniak for testing the compilation.
Appendix A. Example configuration file
1e12+1
1.59994240
0.7
mass
energy
en_int
en_kin
0.6
1.39988021
0.5
1.20004007
0.4
0.99997788
0.3
0.80002671
0.2
0.59996452
0
50
time
100
0.1
0
150
0.5
Mx
My
2
1
v
0.4
0.3
0.2
20
40
2
1
0
1
1
v
0.1
0.20
20
40
60
80
time
100
120
140
1
0
120
140
160
t =38.40
2
3 2 1
2
t =80.00
2
3 2 1
160
100
0.0
80
time
t =0.00
2
3 2 1
0.1
60
t =121.60
2
3 2 1
Figure 2: Simulations of the HMF in.resonances example file. The mass evolution is zoomed to 1 with a detail of 1012 . These figures are produced, with no
modification, by the script show vmf90.py that accompanies vmf90.
1e12+1
1.5
mass
9.00002295
7.99993405
energy
en_int
en_kin
1.0
7.00006719
0.5
5.99997829
5.00011144
0.0
4.00002254
3.00004466
0.5
2.00006678
0.99997788
20
40
60
time
80
100
1.0
0
120
0.8
2
v
0.7
0.6
40
60
time
0.3
2
v
0.2
0.1
40
60
80
100
t =60.00
3 2 1
120
time
120
t =30.00
3 2 1
4
4
20
100
3 2 1
0.4
80
t =0.00
0.5
0.0
0
20
t =90.00
4
0
3 2 1
Figure 3: Simulations of the FEL in example file. The mass evolution is zoomed to 1 with a detail of 1012 . These figures are produced, with no modification, by
the script show vmf90.py that accompanies vmf90.
model = HMF
Nx = 256
Nv = 512
vmax = 2.5
DT = 0.1
n_steps = 5
n_top = 300
n_images = 50
IC = wb_eps
width = 4.
bag = 0.72
epsilon = 0.001
Nedf = 0
!
!
!
!
!
!
!
!
!
!
!
!
!