Parameter reference¶
There are a number of settings that can be specified in a pi file, and each of the SOFT modules
introduces its own set of options. In this section a complete list of all the options that can be
set in a pi file are given.
Contents
Global options¶
-
debug¶ - Default value: 0Example line:
debug=1Allowed values: 0 or 1If set to 1, debug output will be generated and written to
stdoutduring the run. Default value is 0.
-
domain_has_outer_wall¶ - Default value: yesExample line:
domain_has_outer_wall=noAllowed values:yesornoIf set to
no, ignores all points of the wall/separatrix outside \(R = R_m\), where \(R_m\) denotes the radial coordinate of the magnetic axis. This will allows the placement of a detector outside the device. The mid-pole will still be present to block out radiation.
-
interptimestep¶ - Default value:Example line:Allowed values:
TODO
-
magnetic_field¶ - Default value: NoneExample line:
magnetic_field=numericAllowed values:circularandnumericSpecifies the name of the magnetic field handler module to use. Either
circularornumeric.
-
maxtimestep¶ - Default value: NoneExample line:
maxtimestep=1e-11Allowed values: Any positive real valueSets the maximum allowed size of a timestep in the equation solver (whichever it may be). If the adaptive timestep becomes larger than this, it is automatically adjusted to this value. By default there is no limit on how long the timestep can be.
-
nodrifts¶ - Default value: noExample line:
nodrifts=yesAllowed values:yesornoIf set to
yes, ignores the drift terms in the first-order guiding-center equations of motion (effectively solving the zeroth-order guiding-center equations of motion). This option only influences behaviour of the code when the guiding-center equations of motion are solved. By default the value of this option isnoso that the drift terms are kept.
-
progress¶ - Default value: 0Example line:
progress=10Allowed values: Any non-negative integerSpecifies how many times during the run SOFT should print information about the current progress. Information will be printed in uniform steps as particles (defined as points in phase-space) are completed.
-
threads¶ - Default value: Number of threads suggested by OpenMPExample line:
threads=3Allowed values: Any positive integer (no upper limit)Overrides the number of threads started by each (MPI) process. By default, SOFT will start the number of threads indicated by the
OMP_NUM_THREADSenvironment variable in each process.
-
tolerance¶ - Default value: 1e-12Example line:
tolerance=4e-13Allowed values: Any positive real numberSpecifices the tolerance in the RKF45 solver. The default tolerance is set by the tool used in the run. The
orbittool defaults to a tolerance of \(10^{-7}\), while thesycameradefaults to a tolerance of \(10^{-12}\).
-
useequation¶ - Default value: NoneExample line:
useequation=guiding-center-relativisticAllowed values:guiding-center,guiding-center-relativistic,particle,particle-relativistic.Determines which set of equations of motion to solve. Note that the
sycameratool requires that the (relativistic) guiding-center equations of motion be solved. Possible values for this option areparticle,particle-relativistic,guiding-centerandguiding-center-relativistic.
-
usetool¶ - Default value: NoneExample line:
usetool=sycameraAllowed values:orbit,sycameraSets the name of the tool to use. Can either be
orbit(which traces orbits), orsycamera(which computes various synchrotron-radiation quantities for runaway electrons).
Particle settings¶
-
charge¶ - Default value: One electron charge (i.e.
-1)Example line:charge=4Allowed values:orbit,sycameraThe charge of the particle to simulate, in units of the elementary charge (\(e \approx 1.602\times 10^{-19}\,\mathrm{C}\)). The default value is -1, i.e. the electron charge.
-
cospitch¶ - Default value: NoneExample line:
cospitch=1,0.95,100Allowed values: A number \(\in [0,1]\); A number \(\in[0,1]\); any positive integerSpecifies the range of cosines of the particle’s pitch anle with which to initiate orbits. The first argument specifies the first value in the range to give to particles, while the second argument argument specifies the last value in the range. The third argument specifies the total number of values to simulate. Example:
cospitch = 0.999,0.97,10, while initiate ten particles with cosine of the pitch angle values between 0.97 and 0.999.
-
gc_position¶ - Default value: YesExample line:
gc_position=noAllowed values:yesornoIf set to
yes, assumes that the position given specifies the guiding-center position when solving the guiding-center equations of motion. If set tono, the program instead assumes that the particle position is specified and compensates accordingly when solving the guiding-center equations of motion. Has no effect when solving the full particle orbit.
-
mass¶ - Default value: One electron mass (\(0.000548579909\,\mathrm{u}\))Example line:
mass=2Allowed values: Any positive real numberThe particle mass in unified atomic mass units (u). The default value is 0.000548579909, corresponding to the electron mass.
-
p¶ - Default value: NoneExample line:
p=1e6,1.2e7,10Allowed values: Any real number; any real number; any positive integerSpecifies the range of momenta with which to initiate orbits. The first argument specifies the first momentum value to give to particles while the second argument specifies the last momentum value. The third argument specifies the total number of momentum values to simulate. Example:
p = 3e7,4e7,5.
-
pitch¶ - Default value: NoneExample line:
pitch=0.05,0.15,14Allowed values: A number \(\in [0,\pi]\); a number \(\in [0,\pi]\); any positive integerSpecifies the range of pitch angles with which to initiate orbits. The first argument specifies the first pitch angle to give to particles while the second argument specifies the last pitch angle. The third argument specifies the total number of pitch angles to simulate. Example:
pitch = 0.03,0.25,15.
-
ppar¶ - Default value: NoneExample line:
ppar=1e6,1.2e7,14Allowed values: Any real number; any real number; any positive integerSpecifies the range of parallel momenta with which to initiate orbits. The first argument specifies the first parallel momentum to give to particles while the second argument specifies the last momentum value. The third argument specifies the total number of momentum values to simulate. Example:
ppar = 3e7,4e7,5.
-
pperp¶ - Default value: NoneExample line:
pperp=1e6,1.2e7,14Allowed values: Any real number; any real number; any positive integerSpecifies the range of perpendicular momenta with which to initiate orbits. The first argument specifies the first perpendicular momentum to give to particles while the second argument specifies the last momentum value. The third argument specifies the total number of momentum values to simulate. Example:
pperp = 3e6,7e6,15.
-
r¶ - Default value: NoneExample line:
r=0.68,0.84,14Allowed values: Any real number inside device; any real number inside device; any positive integerSpecifies the range of radii with which to initiate orbits. The first argument specifies the first radius to give to particles while the second argument specifies the last radius. The third argument specifies the total number of radii to simulate. Example:
r = 0.68,0.84,80.
-
rdyn¶ - Default value: NoneExample line:
rdyn=0.84,14Allowed values: Any real number inside device; any positive integerSpecifies the outermost radius at which to initiate orbits, as well as the number of radii to drop particles on. The innermost radius is automatically set as the magnetic axis, and particles will only be dropped at a radius in the interval if their “effective magnetic axis” radial location is less than the currently simulated. The “effective magnetic axis” arises due to orbit drifts, and if it’s presence is not properly accounted for, weird bright or dark spots will show up in synchrotron image (when orbit drifts are taken into account). Example:
rdyn = 0.84,80.
-
t¶ - Default value:
0,-1Example line:t=0,1e-6Allowed values: Any real number; any real numberThe first argument of this parameter specifies the reference time. For most purposes this parameter is most conveniently set to 0. The second argument specifies the end time, at which point an orbit should be considered finished and no longer followed. If the second argument is less than the reference time (the first argument), the orbit will be followed for one full poloidal orbit, or until the simulation clock is greater than minus the end time.
Magnetic settings¶
Two different magnetic handler modules are provided with SOFT. These are the circular module,
implementing a simple analytical magnetic field with a circular cross-section and constant
safety factor, as well as the numeric module, which loads 2D numeric magnetic fields.
Performance-wise, the numeric module is somewhat slower than the circular model, due to
that the former interpolates the 2D magnetic field with a cubic spline. The difference is however
only about a factor of two.
circular¶
-
B0¶ - Default value:
1Example line:B0=5.2Allowed values: Any real numberSpecifies the magnetic field strength on the magnetic axis, i.e. on the circle \(R = R_{\mathrm{m}}, Z = 0\). In units of Tesla.
-
major_radius¶ - Default value:
1Example line:major_radius=2Allowed values: Any positive real numberSpecifies the major radius of the tokamak. In units of meter.
-
minor_radius¶ - Default value:
1Example line:minor_radius=1Allowed values: Any real numberSpecifies the minor radius of the device. In units of meter. This parameter only influences the location of the walls of the tokamak, and does not affect the magnetic field.
-
safety_factor¶ - Default value:
1Example line:B0=1Allowed values: Any real numberThe safety factor, or \(q\)-factor of the tokamak magnetic field. In this analytical model of the magnetic field, the safety factor is a constant.
numeric¶
-
axis¶ - Default value: Set in equilibrium fileExample line:
axis=0.68,-0.002Allowed values: Any positive real number; any real numberSpecifies the location of the magnetic axis in a poloidal plane. The first coordinate specifies the major radial location (\(R\)) of the axis, and the second coordinate specifies the vertical location (\(Z\)) of the axis. SOFT requires the magnetic equilibrium data file to give this value, but under some circumstances it may be desirable to override the value set in the equilibrium file, in which case this parameter can be used.
-
file¶ - Default value: NoneExample line:
file=/path/to/magnetic/equilibrium.matAllowed values: Any real numberSpecifies the name of the file containing the magnetic equilibrium data to use. The format that this file must have is described under Magnetic equilibria. The format of the file is determined by analyzing the file name extension. All file formats supported by the SOFT file interface can be used.
-
format¶ - Default value:
autoExample line:format=matAllowed values:auto,hdf5ormatOverrides the format specifier for the magnetic equilibrium data file.
autois the default, which causes SOFT to determine the file format based on the filename extension.hdf5causes SOFT to interpret the data file as an HDF5 file.matcauses SOFT to interpret the data file as a Matlab MAT file.
-
wall¶ - Default value:
anyExample line:wall=separatrixAllowed values:any,separatrix,wallSpecifies which type of wall should be used. Equilibrium data files can contain two types of “walls”, namely the actual tokamak wall cross-section or the separatrix/last closed flux surface. SOFT only requires one of these two types to be present in the data file, and with
anyset, the tokamak wall will be first be considered, but if it’s not present in the file, the separatrix will be used instead. Thewallandseparatrixoptions forces the use of either of the two types. The wall is the structure beyond which particles will be considered as lost and no longer followed.
sycout settings¶
A sycout (short for SYnchrotron Camera OUTput) is an output module that is
coupled to the sycamera tool of SOFT. Currently the following sycouts are available:
- green – Generates a Green’s function
- image – Generates a camera image
- polimage – Generates a camera image with polarization information
- polspectrometer – Generates a spectrum with polarization information
- space3d – Stores 3D information about the contributions to an image
- spectrometer – Generates a spectrum
- topview – Stores X and Y coordinates of contributions to an image. Creates a top-down “map” of contributions.
green¶
The green sycout allows you to generate Green’s functions for images, spectra or
any kind of function you can imagine. Green’s functions are sometimes also known as
weight functions and are essentially mappings from a distribution function to a quantity
such as an image, spectrum or combination thereof.
Instructions on how to use this sycout are available under :ref:`geomkern`.
-
format¶ - Default value: Auto-determined from output filename extensionExample line:
format=matAllowed values:h5,hdf5,mat,out,sdtOverrides the default setting for what file format to store the output in. If not set, the output file format is determined based on the filename extension of the output file.
h5andhdf5forces HDF5 output.matforces Matlab MAT output.outandsdtforces SOFT self-descriptive text (SDT) format output (text-based).
-
function¶ - Default value: NoneExample line:
function=r12ijAllowed values: Any (non-repeating) combination of the characters1,2,i,j,r,wSets the shape and contents of the Green’s function. A more detailed description of how this option works can be found under Geometric kernels.
-
output¶ - Default value: NoneExample line:
output=outputfile.matAllowed values: Any non-line-breaking stringSets the name of the output file. The format of the output file is determined based on the extension part of this setting unless the
formatoption has also been specified. By extension is meant everything that comes after the last dot (.).
-
pixels¶ - Default value: NoneExample line:
pixels=520Allowed values: Any positive integerSets the number of pixels of the image, i.e. the number of elements in each of the
iandjdimensions. Only required if eitheriorjappears in thefunctionoption.
-
stokesparams¶ - Default value:
noExample line:stokesparams=yesAllowed values:yesornoIf set to
yes, each of the four Stokes parameters I, U, Q and V will be stored in the Green’s function (thereby giving it an extra dimension with four elements). If set tono, only the intensity parameter is stored, which is the value commonly measured by spectrometers and cameras.
-
suboffseti¶
-
suboffsetj¶ - Default value: 0Example line:
suboffseti=20Allowed values: Any non-negative integerGreen’s functions for images tend to become quite large, and in many cases much of the Green’s function is zero and provides no interesting information. In these cases, a subset of the image can be stored so that the correct wide-angle image distortion is still present. These offset parameters specify the offsets in the i and j directions respectively from which the image that is to be stored should start.
-
subpixels¶ - Default value: Same as ``pixels``Example line:
subpixels=30Allowed values: Any positive integerSpecifies the number of pixels in each of the i and j directions of the subset image. Since the subset image must lie within the full image,
suboffseti``+``subpixelsandsuboffsetj``+``subpixelsmust both be less than or equal topixels.
image¶
The image sycout generates a camera image.
-
brightness¶ - Default value:
intensityExample line:brightness=histogramAllowed values:bw,histogram,intensitySpecifies how pixels should be colored. With
bw(for black-and-white), pixels are simply marked if they receive a contribution. Thus, if any radiation hits the pixel during the run, the pixel will contain the value 1 at the end of the run and 0 otherwise.The
histogramoption specifies that each hit in a pixel should increase the value of the pixel by 1. The radiation intensity reaching the pixel is not considered.The
intensityoption takes the emitted radiation intensity into account, including spectral effects (if enabled through other options).
-
includeseparatrix¶ - Default value:
yesExample line:includeseparatrix=noAllowed values:noandyesSpecifies whether or not to include separatrix data from the input magnetic equilibrium data file in the output. By default, it is set to
yes. If no separatrix data is available, theseparatrixvariable is omitted from the output file.
-
includewall¶ - Default value:
yesExample line:includewall=noAllowed values:noandyesSpecifies whether or not to include wall data from the input magnetic equilibrium data file in the output. By default, it is set to
yes. If no wall data is available, thewallvariable is omitted from the output file.
-
name¶ - Default value: NoneExample line:
name=output-file.matAllowed values: Any string allowed by the underlying file systemSpecifies the name of the file to which the output will be written. The output is written through the SOFT file interface which means it will be either in a HDF5 file, a Matlab MAT file or a SOFT SDT (Self-Descriptive Text) format. The file format is determined based on the filename extension. For HDF5, use either .h5 or .hdf5, for Matlab MAT use .mat, and for SDT any other extension (though .sdt is recommended).
-
pixels¶ - Default value: NoneExample line:
pixels=300Allowed values: Any positive integerSets the number of pixels in the image. Images are always square and have the same number of pixels in the x (i) direction as in the y (j) direction.
space3d¶
The space3d can be used to store 3D data about the points of space that contribute
to an image. A description about how to use it can be found in space3d.
-
output¶ - Default value: NoneExample line:
output=name-of-outputfile.matAllowed values: Any string allowed by the underlying file systemName of the file to which output should be written. The
space3dmodule uses the SOFT file interface, meaning output can be written in either HDF5, Matlab MAT or SOFT SDT (Self-Descriptive Text) format. The format of the output file is determined based on the filename extension. For HDF5 use .h5 or .hdf5, for Matlab MAT use .mat, and for SDT use any other extension (though .sdt is recommended).
-
pixels¶ - Default value: NoneExample line:
pixels=300Allowed values: Any positive integerWhen
type=pixels, sets the number of pixels in each direction of the bounding box. A value of for example 100 means that there will be a total of \(100\times 100\times 100 = 1\,000\,000\) “pixels” in the box.
-
point0¶ - Default value: NoneExample line:
point0=.40,-.75,.20Allowed values: Any real number; any real number; any real numberSpecifies one of the two defining edge points of the bounding box.
-
point1¶ - Default value: NoneExample line:
point1=.63,-.15,-.20Allowed values: Any real number; any real number; any real numberSpecifies one of the two defining edge points of the bounding box.
-
type¶ - Default value: NoneExample line:
type=pixelsAllowed values:pixels,realSpecifies the type of 3D object to store.
pixelsdivides the bounding box into a number of smaller boxes and collects the contribution in each of those (the number of boxes is determined by thepixelsoption). This 3D type is fixed in size and is represented as a simple 3D array.The
realtype stores the real location of each particle that contributes to the image. This 3D grows in size with the number of particles that hit the detector, and is stored as a sparse matrix. It’s usually very difficult to determine the final size of this 3D type, but it gives much more detailed data and can sometimes be the more space-efficient option.
spectrometer¶
The spectrometer sycout stores spectra.
-
name¶ - Default value: NoneExample line:
name=spectrum.matAllowed values: Any string allowed by the file systemName of the output file.
topview¶
The topview sycout generates a top map of the tokamak, showing where in
the xy-plane radiation comes from. Note that the image is line-integrated along
the z direction, and bright areas in the top view therefore do not necessarily
correspond to bright areas in the image.
-
brightness¶ - Default value:
intensityExample line:brightness=histogramAllowed values:bw,histogram,intensitySpecifies how pixels should be colored. With
bw(for black-and-white), pixels are simply marked if they receive a contribution. Thus, if any radiation hits the pixel during the run, the pixel will contain the value 1 at the end of the run and 0 otherwise.The
histogramoption specifies that each hit in a pixel should increase the value of the pixel by 1. The radiation intensity reaching the pixel is not considered.The
intensityoption takes the emitted radiation intensity into account, including spectral effects (if enabled through other options).
-
name¶ - Default value: NoneExample line:
name=output-file.matAllowed values: Any string allowed by the underlying file systemSpecifies the name of the file to which the output will be written. The output is written through the SOFT file interface which means it will be either in a HDF5 file, a Matlab MAT file or a SOFT SDT (Self-Descriptive Text) format. The file format is determined based on the filename extension. For HDF5, use either .h5 or .hdf5, for Matlab MAT use .mat, and for SDT any other extension (though .sdt is recommended).
-
pixels¶ - Default value: NoneExample line:
pixels=300Allowed values: Any positive integerSets the number of pixels in the topview. Topviews are always square and have the same number of pixels in the x (i) direction as in the y (j) direction.