Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] adgd_v1_0.tar.gz(138 Kbytes)
Manuscript Title: G2DEM: a parallel two-dimensional electromagnetic PIC code for the study of electron-cyclotron instabilities of relativistic electron beams in cylindrical cavities.
Authors: G. Jost, T.M. Tran, K. Appert, S. Wuthrich
Program title: G2DEM
Catalogue identifier: ADGD_v1_0
Distribution format: tar.gz
Journal reference: Comput. Phys. Commun. 104(1997)188
Programming language: Fortran.
Computer: CRAY T3D MC 256-8.
Operating system: UNICOS.
RAM: 8M words
Word size: 64
Keywords: Plasma physics, Collisionless plasma, Gyrotron, Pic electromagnetic, Simulation, Electron-cyclotron, Instabilities, Current assignment, Open boundaries.
Classification: 19.3.

Nature of problem:
G2DEM (Gyrotron 2 Dimensions ElectroMagnetic) solves Maxwell's equations and the relativistic equations of motion for an annular electron beam in an axisymmetric cylindrical cavity (r,z) open at both ends. This program is used to determine the effects of electron-cyclotron instabilities (electrostatic and electromagnetic) on the velocity distribution of the beam. This is of practical interest, because the best gyrotron efficiency is obtained with monochromatic beams and any beam degradation, leading to a loss of monochromaticity in either energy or velocity pitch angle, lowers it [1].

Solution method:
G2DEM is a particle-in-cell (PIC) code [2,3], in which the Maxwell equations are discretized by the finite element method. The current carried by a particle is obtained from a charge conserving assignment scheme called the Virtual Particle Method [4]. Open boundaries are treated by the method of the Perfectly Matched Layer [5]. On the CRAY T3D, the particles are distributed among the processors independently of their position and velocity, the electromagnetic field is updated in parallel, using a domain decomposition of the cavity [6].

Unusual features:
The code is written in CF77, the CRAY version of FORTRAN 77 [7], and its structure conforms to the prescriptions of the OLYMPUS system [8]. We use the preprocessor to select the version (Y-MP or T3D) of the code. The T3D version uses the CRAY SHMEM [9] and the PVM message passing libraries [10]. It can, however, run with PVM routines alone if the SHMEM library is not available. The code uses some features of CF77 which violate the ANSI standard, namely type declaration with data length, DO END DO statement and names longer than 6 letters. It can be easily implemented on another single processor computer, even though it uses some specific CRAY routines; we provide most of them with the code, the others are either available from the BLAS library [11], or not vital to the code (e.g. date and time) with the exception of the Fourier transform for which a replacement has to be found. Plots are obtained with an independent graphics module, call READB. This module is included in the G2DEM package and uses the publically available graphics library Xgrafix [12]. Compiler options: T3D: with SHMEM routines cf77 -dp -DT3D -DSHMEM -I. -I/usr/include/mpp -lpvm3, without SHMEM routines cf77 -dp -DT3D -I. -I/usr/include/mpp -lpvm3; Y-MP: cf77 -dp -DYMP -Zv -I.

Running time:
The running time depends strongly on physical parameters like the length of the cavity and the beam current, which determine the number of particles and mesh points, and the saturation time, respectively. It is dominantly (~ 90% of it) affected by the number of particles, each one requiring 35 mus per step and processor, and by the number of processors. Together, these two quantities determine the fraction of time spent in communication [6]. On a 16 processor T3D configurtion, the provided test runs require less than 500 seconds wall clock time but spend most of it in communications. In contrast to this, useful production runs might need more than a day on the same computer configuration but loose 20% of the time in communication.

[1] S. Alberti et al. Physics Fluids B2 (1990) 1654.
[2] C.K. Birdsall, A.B. Langdon, "Plasma Physics via Computer Simulation", Adam Hilger, New York, 1991.
[3] R.W. Hockney, J.W. Eastwood, "Computer Simulation Using Particles", Institute of Physics Publishing, Bristol, 1988.
[4] J.W. Eastwood, Computer Physics Communications 64 (1991) 252.
[5] J.-P. Berenger, Journal of Computational Physics 114 (1994) 185.
[6] G. Jost, T.M. Tran, K. Appert and S. Wuthrich, Computer Physics Communications 100 (1997) 47.
[7] CF77 Fortran Language Reference Manual (SR-3772 6.0), Cray Research Inc., Eagan, MN., 1993.
[8] K.V. Roberts, Computer Physics Communicatins 7 (1974) 237.
[9] R. Barriuso, A. Knies, "SHMEM User's Guide for Fortran", Cray Research Inc., Eagan, MN., August 15, 1994.
[10] G.A. Geist, A.L. Beguelin, J.J. Dongarra, R.J. Mancheck and V.S. Sunderam, "PVM 3.0 User's Guide and Reference Manual", ORNL/TM-12187, 1993.
[11] C.L. Lawson, R.J. Hanson, D.R. Kincaid and F.T. Krogh, "Basic Linear Algebra Subprograms for Fortran Usage-An Extended Report", Sandia Technical Report SAND 77-0898, Sandia Laboratories, Albuquerque, NM, 1977. Code and documentation are available through http://www.netlib.org/blas/index.html.
[12] V. Vahedi, J.P. Verboncoeur and P. Mirrashidi "Xgrafix library Version 1.1" University of California, Berkeley. Code and documentation are available through http://langmuir.eecs.berkeley.edu/pub/codes/xgrafix.