Warp Units In almost all cases, Warp uses MKS units. The one notable exception is that sometimes the energy, for example top.ekin which can be used to set the initial axial kinetic energy of the beam, is in units of electron volts. There are a number of convenient multiplying factors to convert quantities to MKS units. For example, cm will convert centimeters to meters: x = 2.*cm will result in x being set to 2 cm in meters. Below is a list of conversion factors and their values. inch = 0.0254 # inches to meter nm = 1.e-9 # nm to meter um = 1.e-6 # um to meter mm = 1.e-3 # mm to meter cm = 0.01 # cm to meter ps = 1.0e-12 # picosecond to second ns = 1.0e-9 # nanosecond to second us = 1.0e-6 # microsecond to second ms = 1.0e-3 # millesecond to second kV = 1.0e3 # kV to V keV = 1.0e3 # keV to eV MV = 1.0e6 # MV to V MeV = 1.0e6 # MeV to eV mA = 1.0e-3 # mA to A uC = 1.0e-6 # micro-Coulombs to Coulombs nC = 1.0e-9 # nano-Coulombs to Coulombs deg = pi/180.0 # degrees to radians Warp also has numerous mathematical and physical constants available which can aid in setup of problem descriptions. These include: Mathematical Constants euler = 0.57721566490153386 # Euler-Masceroni constant
avogadro = 6.02214129e23 # Avogadro's Number amu = 1.66053921e-27 # Atomic Mass Unit [kg] [J/eV]
[H/m] boltzmann = 1.3806488e-23 # Boltzmann's constant [J/K] planck = 6.62606957e-34 # Planck's constant [J.s]
emit_y = 4*sqrt( <y*y><y'*y'> - <y*y'><y*y'> ) edge measure of y-y' phase-space area Warp Variables and Packages Warp has literally thousands of variables/parameters used to specify and control simulations. These include real numbers, integers, and arrays. These are organized around packages with names including: Name Function top Main control env Envelope equation solver w3d 3D PIC wxy Two dimensional transverse x-y slice PIC wrz Two dimensional axisymmetric r-z PIC (depreciated use 3D package) f3d 3D electrostatic field solver fxy 2D fieldsolver for x-y slice PIC frz 2D fieldsolver for axisymmetric r-z PIC util Utility routines fft FFT More information on these can be found in the source web pages. Fortran surce code files (".F" suffix) and associated variable description files (".v" suffix) can be found for each package. Variables are functionally grouped within each package constituting common blocks in the source code. The "top" package contains many overall simulation control parameters used by fortran routines and linked with the python interpreter interface. When obtaining documentation on specific variables like a simulation timestep top.dt, information can be obtained by (quotes are necessary): >>> doc("dt") and the value to the variable can be found by to print the present value. The doc("dt") command above returns >>> top.dt Package: top giving the package (top) and group (InGen) within the package that the variable is defined in, variable attributes and type, address info (platform dependent), and a comment describing the variable. Much information can be deduced by examining variable description file top.v used in comping Warp. The source web pages have enhanced formatting making them easier to read. |