Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 802e61e9 authored by gsell's avatar gsell
Browse files

literal block replaced with code blocks

Using code blocks to render OPAL output seems to be better than literal
blocks. The same is true for excerpts of the OPAL input file.

Due to a bug in the asciidoc2pdf converter script the last line of a file
must be terminated with a newline. To ensure this a 'EOF' comment has been
added to all files.
parent 04bc431b
No related branches found
No related tags found
No related merge requests found
Showing with 525 additions and 492 deletions
......@@ -97,11 +97,11 @@ where
It remains to find the progress of time with respect to the position. In
_OPAL_ this is done iteratively starting with
....
----
K[i] = K[i-1] + (z[i] - z[0]) * q * V;
b[i] = sqrt(1. - 1. / ((K[i] - K[i-1]) / (2.*m*c^2) + 1)^2);
t[i] = t[0] + (z[i] - z[0]) / (c * b[i])
....
----
By doing so we assume that the kinetic energy, K, increases linearly and
proportional to the maximal voltage. With this model for the progress of
......@@ -146,12 +146,12 @@ summands.
[[sec.autophasing.example]]
==== Example
....
----
FINLB02_RAC: TravelingWave, L=2.80, VOLT=14.750*30/31,
NUMCELLS=40, FMAPFN="FINLB02-RAC.T7",
ELEMEDGE=2.67066, MODE=1/3,
FREQ=1498.956, LAG=FINLB02_RAC_lag;
....
----
For this example we find
[latexmath]
......@@ -284,3 +284,4 @@ Here we also used some trigonometric identities:
\end{aligned}
++++
// EOF
\ No newline at end of file
......@@ -15,11 +15,11 @@ endif::[]
All _OPAL_ commands working on a beam require the setting of various
quantities related to this beam. These are entered by a `BEAM` command:
....
----
label:BEAM, PARTICLE=name, MASS=real, CHARGE=real,
ENERGY=real, PC=real, GAMMA=real, BCURRENT=real,
NPART=real, BUNCHED=logical, BFREQ=real;
....
----
The `label` is optional, it defaults to `UNNAMED_BEAM`.
......@@ -110,3 +110,5 @@ NPART::
The number of macro particles for the simulations
NSLICE::
The number of slices per bunch
// EOF
\ No newline at end of file
......@@ -231,13 +231,13 @@ The starting simulation has been performed with TRACE 3D code. According
to <<sec.benchmarks.T3D_input>>, the simulated input beam is described by the
following parameters:
....
----
ER = 938.27
W = 7
FREQ = 700
BEAMI = 0.0, 4.0,0.0, 4.0, 0.0, 0.0756
EMITI = 0.730, 0.730, 7.56
....
----
Thanks to the TRACE 3D graphic interface, the input beam can immediately
be visualized in the three phase plane as shown in <<fig_Input_TRACE>>.
......@@ -257,25 +257,25 @@ Before entering the TRACE 3D sigma-matrix coefficients in TRANSPORT, a
changing in the units is required using the *card 15* in the following
way:
....
----
15. 1. 'MM' 0.1 ; //express in mm the horizontal and vertical beam size
15. 5. 'MM' 0.1 ; //express in mm the beam length
....
----
At this point, the TRANSPORT input beam is defined by *card 1*:
....
----
1.0 1.709 0.427 1.709 0.427 0.11 0.0717 0.1148 /BEAM/ ;
....
----
using exactly the same sigma-matrix coefficients of
<<fig_TRACE_z_Input>>. Other two cards must be added in order to use
exactly the TRACE 3D R-matrix formalism:
....
----
16. 3. 1863.153; //proton mass, as ratio of electron mass
22. 0.05 0.0 700 0.0 /SPAC/ ; //space charge card
....
----
[[sec.benchmarks.sbend-in-trace-3d]]
===== SBEND in TRACE 3D
......@@ -506,26 +506,26 @@ latexmath:[\beta\gamma ={0.1224}] for 7 MeV protons;
In case of the modified sigma-matrix in <<fig_TRACE_z_Input>>, the
corresponding _OPAL_ parameters for the `GAUSS` distributions are:
....
----
T3D SIGMA OPAL -T
-------------------------------------------------------
1.7088 mm SIGMAX = 1.7088/sqrt(5)e-3 m
0.4272 mrad SIGMAPX = 0.4272/sqrt(5)*0.1224e-3
1.7088 mm SIGMAY = 1.7088/sqrt(5)e-3 m
0.4272 mrad SIGMAPY = 0.4272/sqrt(5)*0.1224e-3
0.1092 mm SIGMAZ = 0.1092/sqrt(5)e-3 m
0.0717 % SIGMAPZ = (0.0717*10)/sqrt(5)*0.1224e-3
....
-------------------------------------------------------
1.7088 mm SIGMAX = 1.7088/sqrt(5)e-3 m
0.4272 mrad SIGMAPX = 0.4272/sqrt(5)*0.1224e-3
1.7088 mm SIGMAY = 1.7088/sqrt(5)e-3 m
0.4272 mrad SIGMAPY = 0.4272/sqrt(5)*0.1224e-3
0.1092 mm SIGMAZ = 0.1092/sqrt(5)e-3 m
0.0717 % SIGMAPZ = (0.0717*10)/sqrt(5)*0.1224e-3
----
At the end of this calculation, the input beam in _OPAL_ is:
....
----
D1: DISTRIBUTION, TYPE=GAUSS,
SIGMAX = 0.7642e-03, SIGMAPX= 0.0234e-03, CORRX= 0.0,
SIGMAY = 0.7642e-03, SIGMAPY= 0.0234e-03, CORRY= 0.0,
SIGMAZ = 0.0488e-03, SIGMAPZ= 0.0392e-03, CORRZ= 0.0, R61= 0.0,
INPUTMOUNITS=NONE;
....
----
[[sec.benchmarks.T3D_OPAL]]
==== Comparison TRACE 3D and _OPAL-t_
......@@ -537,7 +537,7 @@ line described in <<sec.benchmarks.T3D_TRAN>> has been simulated in _OPAL_ using
magnet features of <<tab_Bend_Trace>> and <<tab_Edge_Trace>> have been transformed
in _OPAL_ language as:
....
----
Bend: SBEND, ANGLE = 30.0 * Pi/180.0,
K1=0.0,
E1=0, E2=0,
......@@ -546,15 +546,15 @@ Bend: SBEND, ANGLE = 30.0 * Pi/180.0,
DESIGNENERGY = 7E+06, // ref energy eV
L = 0.1294,
GAP = 0.02;
....
----
* *SBEND without edge angles:*
+
....
----
// Bending magnet configuration:
K1=0.0,
E1=0, E2=0,
....
----
+
.TRACE 3D and _OPAL_ comparison: SBEND without edge angles,
image::figures/Benchmarks/SBEND_noEdge.png[scaledwidth=18cm,width=700]
......@@ -565,11 +565,11 @@ magnet for the horizontal emittance is still undergoing study and it’s
probably due to a diverse coordinate system in the two codes.
* *SBEND with edge angles:*
+
....
----
// Bending magnet configuration:
K1=0.0,
E1=10*Pi/180.0, E2=5* Pi/180.0,
....
----
+
.TRACE 3D and _OPAL_ comparison: SBEND with edge angles
image::figures/Benchmarks/SBEND_Edges.png[scaledwidth=18cm,width=700]
......@@ -605,11 +605,11 @@ _OPAL_ language has been done with the following tests:
Only the TEST 2 reports a reasonable behavior on the beam size and
emittance, as shown in <<fig_SBEND_FI>> using:
+
....
----
// Bending magnet configuration:
K1=1.5
E1=0, E2=0,
....
----
+
[#fig_SBEND_FI]
.TRACE 3D and _OPAL_ comparison: SBEND with field index and default field map
......@@ -681,7 +681,7 @@ map which defines the range of the field and the Enge coefficients is
required. If no map is provided, the code uses a default map. Here is a
dipole definition using the default map:
....
----
bend1: SBEND, ANGLE = bend_angle,
E1 = 0, E2 = 0,
FMAPFN = "1DPROFILE1-DEFAULT",
......@@ -690,7 +690,7 @@ dipole definition using the default map:
L = bend_length,
WAKEF = FS_CSR_WAKE;
....
----
Please refer to link:fieldmaps#sec.fieldmaps.1DProfile1[`1DProfile1`] for the definition of the field map
and the default map `1DPROFILE1-DEFAULT`. It defines a fringe field that
......@@ -708,13 +708,13 @@ default map for the hard edge dipole in _OPAL_.
The proposed default map for a hard edge dipole can be:
....
----
1DProfile1 0 0 2
-0.00000001 0.0 0.00000001 3
-0.00000001 0.0 0.00000001 3
-99.9
-99.9
....
----
On the first line, the two zeros following `1DProfile1` are the orders
of the Enge coefficient for the entrance and exit edge of the dipole.
......@@ -782,7 +782,7 @@ its attribute `WAKEF = FS_CSR_WAKE`. In order to calculate the CSR
effect correctly, the drift has to follow a bending magnet whose CSR
calculation is also turned on.
....
----
bend1: SBEND, ANGLE = bend_angle,
E1 = 0, E2 = 0,
FMAPFN = "1DPROFILE1-DEFAULT",
......@@ -791,13 +791,13 @@ calculation is also turned on.
L = bend_length,
WAKEF = FS_CSR_WAKE;
....
----
....
----
drift1: DRIFT, L=0.4, ELEMEDGE = drift_before_bend +
bend_length, WAKEF = FS_CSR_WAKE;
....
----
[[sec.benchmarks.benchmark]]
==== Benchmark
......@@ -896,7 +896,7 @@ latexmath:[N_{\text{p}} = 10^{5}].
[[sec.benchmarks.opal-input]]
==== _OPAL_ Input
....
----
OPTION, ECHO = FALSE, PSDUMPFREQ = 10,
STATDUMPFREQ = 10, REPARTFREQ = 1000,
PSDUMPFRAME = GLOBAL, VERSION=10600;
......@@ -934,12 +934,12 @@ TRACK, LINE = L1, BEAM = Beam1, MAXSTEPS = 1000, ZSTOP = 1.0, DT = 1.0e-10;
RUN, METHOD = "PARALLEL-T", BEAM = Beam1, FIELDSOLVER = Fs1, DISTRIBUTION = Dist1;
ENDTRACK;
STOP;
....
----
[[sec.benchmarks.impact-t-input]]
==== `Impact-t` Input
....
----
!Welcome to Impact-t input file.
!All comment lines start with "!" as the first character of the line.
! col row
......@@ -996,7 +996,7 @@ STOP;
! rotation error x, y, z
! L/m N/A N/A type location of starting edge v1 <B0><B0><B0> v23 /
1.0 0 0 0 0.0 0.5 /
....
----
[[sec.benchmarks.results]]
==== Results
......@@ -1022,3 +1022,5 @@ image::figures/Benchmarks/opal-impact-1MHz-z.png[scaledwidth=10cm]
* [[[bib.Transport_GUI]]] U. Rohrer, _PSI graphic transport framework based on a cern-slac-fermilab version by K.L. Brown et al_, tech. rep. (PSI).
* [[[bib.Tran_ex]]] U. Rohrer, http://aea.web.psi.ch/Urs_Rohrer/MyWeb/moregifs/gantryb.gif.
* [[[bib.elegant]]] M. Borland, https://www1.aps.anl.gov/icms_files/lsnotes/files/APS_1418218.pdf[_Elegant: a flexible SDDS-compliant code for accelerator simulation_], tech. rep. LS-287 (Advanced Photon Source, Sept. 2000).
// EOF
\ No newline at end of file
......@@ -21,12 +21,12 @@ endif::[]
A user who is uncertain about the attributes of a command should try the
command `HELP`, which has three formats:
....
----
HELP; // Give help on the "HELP" command
HELP,NAME=label; // List funct. and attr. types of
// "label"
HELP,label; // Shortcut for the second format
....
----
`label` is an identifier see link:format#sec.format.label[Identifiers or Labels]. If it is non-blank, _OPAL_
prints the function of the object `label` and lists its attribute types.
......@@ -34,11 +34,11 @@ Entering `HELP` alone displays help on the `HELP` command.
Examples:
....
----
HELP;
HELP,NAME=TWISS;
HELP,TWISS;
....
----
[[sec.control.show]]
==== SHOW Command
......@@ -46,11 +46,11 @@ HELP,TWISS;
The `SHOW` statement displays the current attribute values of an object.
It has three formats:
....
----
SHOW; // Give help on the "SHOW" command
SHOW,NAME=pattern; // Show names matching of "pattern"
SHOW,pattern; // Shortcut for the second format
....
----
`pattern` is an regular expression see link:format#sec.format.wildcard[Regular Expressions]. If it is
non-blank, _OPAL_ displays all object names matching the `pattern`.
......@@ -58,11 +58,11 @@ Entering `SHOW` alone displays help on the `SHOW` command.
Examples:
....
----
SHOW;
SHOW,NAME="QD.*\.L*";
SHOW,"QD.*\.L*";
....
----
[[sec.control.what]]
==== WHAT Command
......@@ -70,31 +70,31 @@ SHOW,"QD.*\.L*";
The `WHAT` statement displays all object names matching a given regular
expression. It has three formats:
....
----
WHAT; // Give help on the "WHAT" command
WHAT,NAME=label; // Show definition of "label"
WHAT,label; // Shortcut for the second format
....
----
`label` is an identifier see link:format#sec.format.label[Identifiers or Labels]. If it is non-blank, _OPAL_
displays the object `label` in a format similar to the input statement
that created the object. Entering `WHAT` alone displays help on the
`WHAT` command. Examples:
....
----
WHAT;
WHAT,NAME=QD;
WHAT,QD;
....
----
[[sec.control.stop]]
=== STOP / QUIT Statement
The statement
....
----
STOP or QUIT;
....
----
terminates execution of the _OPAL_ program, or, when the statement
occurs in a `CALL` file see_<<sec.control.call>>, returns to the calling file.
......@@ -107,13 +107,13 @@ The `OPTION` command controls global command execution and sets a few
global quantities. Starting with version 1.6.0 of _OPAL_ the option
`VERSION` is mandatory in the _OPAL_ input file. Example:
....
----
OPTION,ECHO=logical,INFO=logical,TRACE=logical,
WARN=logical,
SEED=real,PSDUMPFREQ=integer,
STATDUMPFREQ=integer, SPTDUMFREQ=integer,
REPARTFREQ=integer, REBINFREQ=integer, TELL=logical, VERSION=integer;
....
----
VERSION::
Used to indicate for which version of _OPAL_ the input file is
......@@ -298,10 +298,10 @@ MEMORYDUMP::
Examples:
....
----
OPTION,ECHO=FALSE,TELL;
OPTION,SEED=987456321
....
----
.Default Settings for Options
[cols="<,<,<,<,<,<",options="header",]
......@@ -359,15 +359,15 @@ _OPAL_ recognizes several types of variables.
[[sec.control.real-scalar-variables]]
===== Real Scalar Variables
....
----
REAL variable-name=real-expression;
....
----
For backward compatibility the program also accepts the form
....
----
REAL variable-name:=real-expression;
....
----
This statement creates a new global variable `variable-name` and
discards any old variable with the same name. Its value depends on all
......@@ -383,31 +383,31 @@ A reserved variable is the value `P0` which is used as the global
reference momentum for normalizing all magnetic field coefficients.
Example:
....
----
REAL GEV=100;
P0=GEV;
....
----
Circular definitions are not allowed:
....
----
X=X+1; // X cannot be equal to X+1
REAL A=B;
REAL B=A; // A and B are equal, but of unknown value
....
----
However, redefinitions by assignment are allowed:
....
----
X=EVAL(X+1);
....
----
[[sec.control.real-vector-variables]]
===== Real Vector Variables
....
----
REAL VECTOR variable-name=vector-expression;
....
----
In old version of _OPAL_ (before 1.6.0) the keyword `REAL` was optional,
now it is mandatory!
......@@ -422,10 +422,10 @@ for a quantity on the right-hand side.
Example:
....
----
REAL VECTOR A = TABLE(10, #);
REAL VECTOR B = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
....
----
Circular definitions are not allowed, but redefinitions by assignment
are allowed.
......@@ -433,9 +433,9 @@ are allowed.
[[sec.control.logical-variables]]
===== Logical Variables
....
----
BOOL variable-name=logical-expression;
....
----
This statement creates a new global variable `variable-name` and
discards any old variable with the same name. Its value depends on all
......@@ -447,9 +447,9 @@ right-hand side.
Example:
....
----
BOOL FLAG = X != 0;
....
----
Circular definitions are not allowed, but redefinitions by assignment
are allowed.
......@@ -461,9 +461,9 @@ _OPAL_ recognizes a few build-in built-in mathematical and physical
constants see Table link:format#tab_constant[Predefined Symbolic Constants].
Additional constants can be defined by the command
....
----
REAL CONST label:CONSTANT=<real-expression>;
....
----
which defines a constant with the name `label`. The keyword `REAL` is
optional, and `label` must be unique. An existing symbolic constant can
......@@ -473,18 +473,18 @@ constant.
Example:
....
----
CONST IN=0.0254; // conversion of inches to meters
....
----
[[sec.control.vector]]
==== Vector Values
A vector of expressions is established by a statement
....
----
REAL VECTOR vector-name=vector-expression;
....
----
The keyword `REAL` is optional. It creates a new global vector
`vector-name` and discards any old vector with the same name. Its value
......@@ -496,10 +496,10 @@ solve the equation for a quantity on the right-hand side.
Example:
....
----
VECTOR A_AMPL={2.5e-3,3.4e-2,0,4.5e-8};
VECTOR A_ON=TABLE(10,1);
....
----
Circular definitions are not allowed.
......@@ -510,9 +510,9 @@ A value is assigned to a variable or vector by using the function
`EVAL(real- expression)`. When seen, this function is immediately
evaluated and replaced by the result treated like a constant.
....
----
variable-name=EVAL(real-expression);
....
----
This statement acts like a FORTRAN or C assignment. The
`real-expression` or `vector-expression` is *evaluated*, and the result
......@@ -520,14 +520,14 @@ is assigned as a constant to the variable or vector on the left-hand
side. Finally the expression is discarded. The `EVAL` function can also
be used within an expression, e. g.:
....
----
vector-name=TABLE(range,EVAL(real-expression));
vector-name={...,EVAL(real-expression),...);
....
----
A sequence like the following is permitted:
....
----
... // some definitions
X=0; // create variable X with value
// zero
......@@ -536,36 +536,36 @@ WHILE (X <= 0.10) {
X=EVAL(X+.01); // increment variable X by 0.01
// CANNOT use: X=X+.01;
}
....
----
[[sec.control.value]]
==== VALUE: Output of Expressions
The statement
....
----
VALUE,VALUE=expression-vector;
....
----
evaluates a set of expressions using the most recent values of any
operands and prints the results on the standard error file.
Example:
....
----
REAL A=4;
VALUE,VALUE=TABLE(5,#*A);
REAL P1=5;
REAL P2=7;
VALUE,VALUE={P1,P2,P1*P2-3};
....
----
These commands give the results:
....
----
value: {0*A,1*A,2*A,3*A,4*A} = {0,4,8,12,16}
value: {P1,P2,P1*P2-3} = {5,7,32}
....
----
This commands serves mainly for printing one or more quantities which
depend on matched attributes. It also allows use of _OPAL_ as a
......@@ -579,10 +579,10 @@ programmable calculator. One may also tabulate functions.
The `ECHO` statement has two formats:
....
----
ECHO,MESSAGE=message;
ECHO,message; // shortcut
....
----
`message` is a string value see link:format#sec.format.astring[String Attributes]. It is immediately
transmitted to the `ECHO` stream.
......@@ -596,10 +596,10 @@ command, successful or not, control returns to _OPAL_. At present this
command is only available under UNIX-like OSes (including Linux and
macOS). It has two formats:
....
----
SYSTEM,CMD=string;
SYSTEM,string; // shortcut
....
----
The string see link:format#sec.format.astring[String Attributes] `string` must be a valid operating
system command.
......@@ -611,9 +611,9 @@ Most UNIX commands can be issued directly.
Example:
....
----
SYSTEM,"ls -l"
....
----
causes a listing of the current directory in long form on the terminal.
......@@ -622,11 +622,11 @@ causes a listing of the current directory in long form on the terminal.
The `TITLE` statement has three formats:
....
----
TITLE,STRING=page-header; // define new page header
TITLE,page-header; // shortcut for first format
TITLE,STRING=""; // clear page header
....
----
`page-header` is a string value see link:format#sec.format.astring[String Attributes]. It defines the
page header which will be used as a title for subsequent output pages.
......@@ -641,28 +641,28 @@ empty. It can be redefined at any time.
The `CALL` command has two formats:
....
----
CALL,FILE=file-name;
CALL,file-name;
....
----
`file-name` is a string see link:format#sec.format.astring[String Attributes]. The statement causes the
input to switch to the named file. Input continues on that file until a
`STOP` or an end of file is encountered. Example:
....
----
CALL,FILE="structure";
CALL,"structure";
....
----
[[sec.control.save]]
==== SAVE Statement
The `SAVE` command has two formats:
....
----
SAVE,FILE=file-name
....
----
`file-name` is a string see link:format#sec.format.astring[String Attributes]. The command causes all
beam element, beam line, and parameter definitions to be written on the
......@@ -670,10 +670,10 @@ named file.
Examples:
....
----
SAVE,FILE="structure";
SAVE,"structure";
....
----
[[sec.control.if]]
=== IF: Conditional Execution
......@@ -681,13 +681,13 @@ SAVE,"structure";
Conditional execution can be requested by an `IF` statement. It allows
usages similar to the C language `if` statement:
....
----
IF (logical) statement;
IF (logical) statement; ELSE statement;
IF (logical) { statement-group; }
IF (logical) { statement-group; }
ELSE { statement-group; }
....
----
Note that all statements must be terminated with semicolons (`;`), but
there is no semicolon after a closing brace. The statement or group of
......@@ -701,10 +701,10 @@ group following the `ELSE` is executed.
Repeated execution can be requested by a `WHILE` statement. It allows
usages similar to the C language `while` statement:
....
----
WHILE (logical) statement;
WHILE (logical) { statement-group; }
....
----
Note that all statements must be terminated with semicolons (`;`), but
there is no semicolon after a closing brace. The condition is
......@@ -720,10 +720,10 @@ Subroutine-like commands can be defined by a `MACRO` statement. It
allows usages similar to C language function call statements. A macro is
defined by one of the following statements:
....
----
name(formals): MACRO { token-list }
name(): MACRO { token-list }
....
----
A macro may have formal arguments, which will be replaced by actual
arguments at execution time. An empty formals list is denoted by `()`.
......@@ -733,16 +733,16 @@ numbers, delimiters etc.) and is stored unchanged in the definition.
A macro is executed by one of the statements:
....
----
name(actuals);
name();
....
----
Each actual consists of a set of tokens which replaces all occurrences
of the corresponding formal name. The actuals are separated by commas.
Example:
....
----
// macro definitions:
SHOWIT(X): MACRO {
SHOW, NAME = X;
......@@ -754,5 +754,6 @@ DOIT(): MACRO {
// macro calls:
SHOWIT(PI);
DOIT();
....
----
// EOF
\ No newline at end of file
......@@ -136,3 +136,5 @@ latexmath:[I_0= e/4\pi\epsilon_0mc^3] [A].
|latexmath:[g(\zeta)] |Form factor used in slice analysis of bunched
beams.
|=======================================================================
// EOF
......@@ -38,7 +38,7 @@ The distribution command is used to introduce particles into an _OPAL_
simulation. Like other _OPAL_ commands see Chapter link:format#chp.format[Command Format], the
distribution command is of the form:
....
----
Name:DISTRIBUTION, TYPE = DISTRIBUTION_TYPE,
ATTRIBUTE #1 =,
ATTRIBUTE #2 =,
......@@ -46,7 +46,7 @@ Name:DISTRIBUTION, TYPE = DISTRIBUTION_TYPE,
.
.
ATTRIBUTE #N =;
....
----
The distribution is given a name (which is used to reference the
distribution in the _OPAL_ input file), a distribution type, and a list
......@@ -258,19 +258,19 @@ particle coordinates.
An example of an _injected_ `FROMFILE` distribution definition is:
....
----
Name:DISTRIBUTION, TYPE = FROMFILE,
FNAME = "text file name";
....
----
an example of an _emitted_ `FROMFILE` distribution definition is:
....
----
Name:DISTRIBUTION, TYPE = FROMFILE,
FNAME = "text file name",
EMITTED = TRUE,
EMISSIONMODEL = None;
....
----
The text input file for the `FROMFILE` distribution type has slightly a
slightly different format, depending on whether the distribution is to
......@@ -414,7 +414,7 @@ In <<tab_distattrgauss>> we list the basic attributes available for a
`GAUSS` distribution. We can use these to create a very simple `GAUSS`
distribution:
....
----
Name:DISTRIBUTION, TYPE = GAUSS,
SIGMAX = 0.001,
SIGMAY = 0.003,
......@@ -429,7 +429,7 @@ Name:DISTRIBUTION, TYPE = GAUSS,
OFFSETY = -0.002,
OFFSETZ = 0.01,
OFFSETPZ = 1200.0;
....
----
This creates a Gaussian shaped distribution with zero transverse
emittance, zero energy spread, latexmath:[\sigma_{x} = {1.0} \mathrm{mm}],
......@@ -619,7 +619,7 @@ coefficient matrix be:
then the corresponding distribution command will read:
....
----
Dist:DISTRIBUTION, TYPE = GAUSS,
SIGMAX = 4.796e-03,
SIGMAPX = 231.0585,
......@@ -636,7 +636,7 @@ Dist:DISTRIBUTION, TYPE = GAUSS,
R62 = -0.042,
R51 = 0.023,
R52 = 0.385;
....
----
[[sec.distribution.flattopdisttype]]
=== `FLATTOP` Distribution Type
......@@ -741,7 +741,7 @@ example of a `FLATTOP` distribution command with an elliptical cross
section of 1 mm by 2 mm and a flat top, in time, 10 ps long with a 0.5 ps
rise and fall time as defined in <<fig_flattop>>.
....
----
Dist:DISTRIBUTION, TYPE = FLATTOP,
SIGMAX = 0.001,
SIGMAY = 0.002,
......@@ -754,7 +754,7 @@ Dist:DISTRIBUTION, TYPE = FLATTOP,
EMISSIONMODEL = ASTRA,
EKIN = 0.5,
EMITTED = TRUE;
....
----
[[transverse-distribution-from-laser-profile-under-development]]
==== Transverse Distribution from Laser Profile (Under Development)
......@@ -854,7 +854,7 @@ and defined as follows (similarly for the other dimensions):
Example:
....
----
Dist:DISTRIBUTION, TYPE = BINOMIAL,
SIGMAX = 2.15e-03,
SIGMAPX = 1E-6,
......@@ -868,7 +868,7 @@ Dist:DISTRIBUTION, TYPE = BINOMIAL,
SIGMAPT = 11.96,
CORRT = -0.5,
MT = 2.0,
....
----
[[sec.distribution.gaussmatchedtype]]
=== `GAUSSMATCHED` Matched Gauss Distribution type
......@@ -930,7 +930,7 @@ the particles would not move off the cathode, causing all of the emitted
charge to pile up at latexmath:[z = 0] in the first half time step
before the beam space charge is calculated.
....
----
Dist:DISTRIBUTION, TYPE = FLATTOP,
SIGMAX = 0.001,
SIGMAY = 0.002,
......@@ -943,7 +943,7 @@ Dist:DISTRIBUTION, TYPE = FLATTOP,
EMISSIONMODEL = NONE,
EKIN = 0.5,
EMITTED = TRUE;
....
----
One thing to note, it may be that if you are emitting your own
distribution using the `TYPE = FROMFILE` option, you may want to set
......@@ -1007,7 +1007,7 @@ clean copper.)
An example of using the `NONEQUIL` emission model is given below. This
model is relevant for metal cathodes and cathodes such as `CsTe`.
....
----
Dist:DISTRIBUTION, TYPE = GAUSS,
SIGMAX = 0.001,
SIGMAY = 0.002,
......@@ -1023,7 +1023,7 @@ Dist:DISTRIBUTION, TYPE = GAUSS,
FE = 7.0,
CATHTEMP = 325,
EMITTED = TRUE;
....
----
[[sec.distribution.distlist]]
==== Distribution List
......@@ -1035,22 +1035,22 @@ see Chapter link:track#chp.track[Tracking]. Assume we have defined several dist
distributions in a simulation, we would use the following `RUN` command
to start the simulation:
....
----
RUN, METHOD = "PARALLEL-T",
BEAM = beam_name,
FIELDSOLVER = field_solver_name,
DISTRIBUTION = DIST1;
....
----
If we want to use all the distributions at the same time, then the
command would instead be:
....
----
RUN, METHOD = "PARALLEL-T",
BEAM = beam_name,
FIELDSOLVER = field_solver_name,
DISTRIBUTION = {DIST1, DIST2, DIST3};
....
----
In this second case, the first distribution (`DIST1`) is the master
distribution. The main consequence of this is that all distributions in
......@@ -1080,4 +1080,6 @@ coordinates. (<<sec.distribution.fromfiledisttype>>).
* [[[bib.JohoDist]]] W. Joho, Representation of beam ellipses for transport calculations, PSI Internal Report TM-11-14, https://intranet.psi.ch/pub/AUTHOR_WWW/ABE/TalksDE/TM-11-14.pdf.
* [[[bib.flo97]]] K. Flöttmann, _Note on the thermal emittance of electrons emitted by Cesium Telluride photo cathodes_, tech. rep. TESLA FEL-Report (DESY, Jan. 1997).
* [[[bib.clen2000]]] J. E. Clendenin et al., _Reduction of thermal emittance of rf guns_, Nucl. Instrum. Methods Phys. Res. Sect. A 455, 198–201 (2000).
* [[[bib.dowe2009]]] D. H. Dowell and J. F. Schmerge, _Quantum efficiency and thermal emittance of metal photocathodes_, Phys. Rev. ST Accel. Beams 12, 074201 (2009).
\ No newline at end of file
* [[[bib.dowe2009]]] D. H. Dowell and J. F. Schmerge, _Quantum efficiency and thermal emittance of metal photocathodes_, Phys. Rev. ST Accel. Beams 12, 074201 (2009).
// EOF
\ No newline at end of file
This diff is collapsed.
......@@ -25,7 +25,7 @@ DUMPEMFIELDS:: write out electromagnetic field map on a 4D grid in space-time. C
The `DUMPFIELDS` statement causes _OPAL-cycl_ to write out static magnetic field data on a 3D cartesian grid. The format of field output is:
....
----
<number of rows>
1 x [m]
2 y [m]
......@@ -37,7 +37,7 @@ The `DUMPFIELDS` statement causes _OPAL-cycl_ to write out static magnetic field
<x0> <y0> <z0> <Bx0> <By0> <Bz0>
<x1> <y1> <z1> <Bx1> <By1> <Bz1>
...
....
----
The following attributes are enabled on the `DUMPFIELDS` statement:
......@@ -63,13 +63,12 @@ Z_STEPS::
Number of steps in z. It is an error if `Z_STEPS` is non-integer or less than 1.
This example makes a field map in the midplane (x-y plane) only, starting at latexmath:[(x,y) = (0,0)] m, with 101 steps in each direction and a stride of 0.1 m. z is always 0.
....
----
DUMPFIELDS, X_START=0., X_STEPS=101, DX=0.100,
Y_START=0., Y_STEPS=101, DY=0.100,
Z_START=0., Z_STEPS=1, DZ=0.100,
FILE_NAME="FieldMapXY.dat";
....
----
{nbsp} +
{nbsp} +
......@@ -84,7 +83,7 @@ The `DUMPEMFIELDS` statement causes _OPAL-cycl_ to write out electromagnetic fie
==== Cartesian Mode
In Cartesian mode the format of the field output is:
....
----
<number of rows>
1 x [m]
2 y [m]
......@@ -100,7 +99,7 @@ In Cartesian mode the format of the field output is:
<x0> <y0> <z0> <t0> <Bx0> <By0> <Bz0> <Ex0> <Ey0> <Ez0>
<x1> <y1> <z1> <t1> <Bx1> <By1> <Bz1> <Ex1> <Ey1> <Ez1>
...
....
----
The following attributes are enabled on the `DUMPEMFIELDS` statement when operating in Cartesian mode:
......@@ -138,7 +137,7 @@ T_STEPS::
==== Cylindrical Mode
In Cylindrical mode the format of the field output is:
....
----
<number of rows>
1 r [m]
2 phi [degree]
......@@ -154,7 +153,7 @@ In Cylindrical mode the format of the field output is:
<r0> <phi0> <z0> <t0> <Br0> <Bphi0> <Bz0> <Er0> <Ephi0> <Ez0>
<r1> <phi1> <z1> <t1> <Br1> <Bphi1> <Bz1> <Er1> <Ephi1> <Ez1>
...
....
----
The following attributes are enabled on the `DUMPEMFIELDS` statement when operating in Cylindrical mode:
......@@ -187,4 +186,4 @@ DT::
T_STEPS::
Number of steps in time. It is an error if `T_STEPS` is non-integer or less than 1.
// EOF
\ No newline at end of file
......@@ -36,22 +36,22 @@ two values are shown on one line then they have to be on the same line.
They should not be separated by a comment and, consequently, be on
different lines. Three examples of valid comments:
....
----
# This is valid a comment
1DMagnetoStatic 40 # This is another valid comment
-60.0 60.0 9999
# and this is also a valid comment
0.0 2.0 199
....
----
The following examples will break the parsing of the field maps:
....
----
1DMagnetoStatic # This is an invalid comment
40
-60.0 60.0 # This is another invalid comment # 9999
0.0 2.0 199
....
----
[[sec.fieldmaps.normalization]]
=== Normalization
......@@ -68,40 +68,40 @@ If _OPAL-t_ encounters an error while parsing a field map it disables
the corresponding element, outputs a warning message and continues the
simulation. The following messages may be output:
....
----
************ W A R N I N G ***********************************
THERE SEEMS TO BE SOMETHING WRONG WITH YOUR FIELD MAP file.t7.
There are only 10003 lines in the file, expecting more.
Please check the section about field maps in the user manual.
**************************************************************
....
----
In this example there is something wrong with the number of grid
spacings provided in the header of the file. Make sure that you provide
the number of grid *spacings* and not the number of grid *points*! The
two numbers always differ by 1.
....
----
************ W A R N I N G ***********************************
THERE SEEMS TO BE SOMETHING WRONG WITH YOUR FIELD MAP file.t7.
There are too many lines in the file, expecting only 10003 lines.
Please check the section about field maps in the user manual.
**************************************************************
....
----
Again there seems to be something wrong with the number of grid spacings
provided in the header. In this example _OPAL-t_ found more lines than
it expected. Note that comments and empty lines at the end of a file are
ignored such that *they don’t cause* this warning.
....
----
************ W A R N I N G ***********************************
THERE SEEMS TO BE SOMETHING WRONG WITH YOUR FIELD MAP file.t7.
_error_msg_
expecting: '_expecting_' on line 3,
found instead: '_found_'.
**************************************************************
....
----
Where `"`_error_msg_`"` is either
......@@ -124,29 +124,29 @@ comment possibly following the values. If line 3 of a file consists of
`-60.0 60.0 # This is an other invalid comment # 9999` _OPAL-t_ will
output `-60.0 60.0`.
....
----
************** W A R N I N G *********************************
DISABLING FIELD MAP file.t7 SINCE FILE COULDN'T BE FOUND!
**************************************************************
....
----
This warning could be issued if the file name is mistyped or otherwise
if the file couldn’t be read.
....
----
************ W A R N I N G **********************************
THERE SEEMS TO BE SOMETHING WRONG WITH YOUR FIELDMAP file.t7.
Could not determine the file type.
Please check the section about field maps in the user manual.
*************************************************************
....
----
In this case _OPAL-t_ didn’t recognize the string of characters which
identify the type of field map stored in the file.
For one-dimensional field maps an other warning may be issued:
....
----
* ************ W A R N I N G ***************************************************
* IT SEEMS THAT YOU USE TOO FEW FOURIER COMPONENTS TO SUFFICIENTLY WELL *
* RESOLVE THE FIELD MAP 'file.T7'. *
......@@ -157,7 +157,7 @@ For one-dimensional field maps an other warning may be issued:
* field. *
* The lower limit for the two ratios is 1e-2 *
* ******************************************************************************
....
----
This warning is issued when the low pass filter that is applied to the
field sampling uses too few Fourier coefficients. In this case increase
......@@ -343,13 +343,13 @@ structure of unknown origin, but presumably due to errors in the
Superfish <<bib.superfish>> interpolation algorithm.
[#fig_fieldnoiseexample]
.The longitudinal phase space after a gun simulation using a 1D field map (on-axis field) of the gun, a 1D field map (on-axis field) of the gun in combination with the `FAST` switch, and a 2D field map of the gun generated by Superfish <<bib.superfish>>.
.The longitudinal phase space after a gun simulation using a 1D field map (on-axis field) of the gun, a 1D field map (on-axis field) of the gun in combination with the `FAST` switch, and a 2D field map of the gun generated by Superfish.
image::./figures/Fieldmaps/fieldnoise_example.png[scaledwidth=18cm,width=750]
[[sec.fieldmaps.1DMagnetoStatic]]
=== 1DMagnetoStatic
....
----
1DMagnetoStatic 40
-60.0 60.0 9999
0.0 2.0 199
......@@ -360,7 +360,7 @@ image::./figures/Fieldmaps/fieldnoise_example.png[scaledwidth=18cm,width=750]
1.32490e-05
1.73710e-05
2.18598e-05
....
----
A 1D field map describing a magnetostatic field using 10000 grid points
(9999 grid spacings) in the longitudinal direction. The field is
......@@ -426,7 +426,7 @@ during the simulation.
[[sec.fieldmaps.AstraMagnetostatic]]
=== AstraMagnetostatic
....
----
AstraMagnetostatic 40
-3.0000000e-01 0.0000000e+00
-2.9800000e-01 2.9075045e-05
......@@ -441,7 +441,7 @@ AstraMagnetostatic 40
2.9600000e-01 5.9367702e-05
2.9800000e-01 2.9075045e-05
3.0000000e-01 0.0000000e+00
....
----
A 1D field map describing a magnetostatic field using latexmath:[N]
non-equidistant grid points in the longitudinal direction. From these
......@@ -495,7 +495,7 @@ values during the simulation.
[[sec.fieldmaps.1DDynamic]]
=== 1DDynamic
....
----
1DDynamic 40
-3.0 57.0 4999
1498.953425154
......@@ -507,7 +507,7 @@ values during the simulation.
1.32490e-05
1.73710e-05
2.18598e-05
....
----
A 1D field map describing a dynamic field using 5000 grid points (4999
grid spacings) in the longitudinal direction. The field is
......@@ -580,7 +580,7 @@ during the simulation.
[[sec.fieldmaps.AstraDynamic]]
=== AstraDynamic
....
----
AstraDynamic 40
2997.924
0.0000000e+00 0.0000000e+00
......@@ -594,7 +594,7 @@ AstraDynamic 40
1.9891525e-01 5.6553000e-04
1.9942016e-01 2.8090000e-04
1.9991554e-01 0.0000000e+00
....
----
A 1D field map describing a dynamic field using latexmath:[N]
non-equidistant grid points in longitudinal direction. From these
......@@ -832,7 +832,7 @@ always places the entrance Enge function origin at the entrance point of
the reference trajectory and the exit Enge function origin at the exit
point of the reference trajectory.)
....
----
1DProfile1 6 7 3.0
-6.0 -2.0 2.0 1000
24.0 28.0 32.0 0
......@@ -843,7 +843,7 @@ point of the reference trajectory.)
1.32490e-05
1.73710e-05
2.18598e-05
....
----
A 1D field map describing the fringe field of an element using 7 Enge
coefficients for the entrance fringe field and 8 Enge coefficients for
......@@ -919,7 +919,7 @@ exit points of the reference trajectory.
be modeled with a single `1DProfile Type 2` field map file rather than
two separate files.
....
----
1DProfile1 6 7 3.0
-6.0 -2.0 2.0 0
-2.0 2.0 6.0 0
......@@ -930,7 +930,7 @@ two separate files.
1.32490e-05
1.73710e-05
2.18598e-05
....
----
A 1D field map describing the fringe field of an element using 7 Enge
coefficients for the entrance fringe field and 8 Enge coefficients for
......@@ -948,7 +948,7 @@ origin is 2.0 cm behind (downstream of) the exit edge of the magnet.
[[sec.fieldmaps.2DElectroStatic]]
=== 2DElectroStatic
....
----
2DElectroStatic XZ
-3.0 51.0 4999
0.0 2.0 199
......@@ -959,7 +959,7 @@ origin is 2.0 cm behind (downstream of) the exit edge of the magnet.
1.32490e-05 0.00000e+00
1.73710e-05 0.00000e+00
2.18598e-05 0.00000e+00
....
----
A 2D field map describing an electrostatic field using 5000 grid points
in the longitudinal direction times 200 grid points in the radial
......@@ -1035,7 +1035,7 @@ If Orientation = ZX:::
[[sec.fieldmaps.2DMagnetoStatic]]
=== 2DMagnetoStatic
....
----
2DMagnetoStatic ZX
0.0 2.0 199
-3.0 51.0 4999
......@@ -1046,7 +1046,7 @@ If Orientation = ZX:::
0.00000e+00 1.32490e-05
0.00000e+00 1.73710e-05
0.00000e+00 2.18598e-05
....
----
A 2D field map describing a magnetostatic field using 5000 grid points
in the longitudinal direction times 200 grid points in the radial
......@@ -1122,7 +1122,7 @@ If Orientation = ZX:::
[[sec.fieldmaps.2DDynamic]]
=== 2DDynamic
....
----
2DDynamic XZ
-3.0 51.0 4121
1498.953425154
......@@ -1134,7 +1134,7 @@ If Orientation = ZX:::
1.32490e-05 0.00000e+00 0.00000e+00 1.32490e-05
1.73710e-05 0.00000e+00 0.00000e+00 1.73710e-05
2.18598e-05 0.00000e+00 0.00000e+00 2.18598e-05
....
----
A 2D field map describing a dynamic field oscillating with a frequency
of 1498.953425154MHz. The field map provides 4122 grid points in the
......@@ -1227,7 +1227,7 @@ _OPAL-t_, but must be there.
[[sec.fieldmaps.3DMagnetoStatic]]
=== 3DMagnetoStatic
....
----
3DMagnetoStatic
-1.5 1.5 227
-1.0 1.0 151
......@@ -1239,7 +1239,7 @@ _OPAL-t_, but must be there.
0.00e+00 1.32e-05 0.00e+00
0.00e+00 1.73e-05 0.00e+00
0.00e+00 2.18e-05 0.00e+00
....
----
A 3D field map describing a magnetostatic field. The field map provides
4122 grid points in z-direction times 228 grid points in x-direction and
......@@ -1310,7 +1310,7 @@ latexmath:[N= (N_{z} + 1) \times (N_{y} + 1) \times (N_{x} + 1)].
[[sec.fieldmaps.3DMagnetoStatic_Extended]]
=== 3DMagnetoStatic_Extended
....
----
3DMagnetoStatic_Extended
-9.9254 9.9254 133
-2.0 1.0 15
......@@ -1322,7 +1322,7 @@ latexmath:[N= (N_{z} + 1) \times (N_{y} + 1) \times (N_{x} + 1)].
-8.64960000e-05
-8.38540000e-05
-8.10970000e-05
....
----
A 3D field map describing a magnetostatic field on the mid-plane. The
field map provides 466 grid points in z-direction times 134 grid points
......@@ -1396,7 +1396,7 @@ shown in <<tab_3DMagnetoStatic_Extended>>.
[[sec.fieldmaps.3DDynamic]]
=== 3DDynamic
....
----
3DDynamic
1498.9534
-1.5 1.5 227
......@@ -1409,7 +1409,7 @@ shown in <<tab_3DMagnetoStatic_Extended>>.
1.32e-05 0.00e+00 1.32e-05 0.00e+00 1.32e-05 0.00e+00
1.73e-05 0.00e+00 1.73e-05 0.00e+00 1.73e-05 0.00e+00
2.18e-05 0.00e+00 2.18e-05 0.00e+00 2.18e-05 0.00e+00
....
----
A 3D field map describing a dynamic field oscillating with 1.4989534.
The field map provides 4122 grid points in z-direction times 228 grid
......@@ -1492,4 +1492,6 @@ latexmath:[N= (N_{z} + 1) \times (N_{y} + 1) \times (N_{x} + 1)].
=== References
* [[[bib.enge_fieldmaps,bib.enge]]] J. E. Spencer and H. A. Enge, _Split-pole magnetic spectrograph for precision nuclear spectroscopy_, Nucl. Instrum. Methods 49, 181–193 (1967).
* [[[bib.superfish]]] J. H. Billen and L. M. Young, _Poisson superfish_, tech. rep. LA-UR-96-1834 (Los Alamos National Laboratory, 2004).
\ No newline at end of file
* [[[bib.superfish]]] J. H. Billen and L. M. Young, _Poisson superfish_, tech. rep. LA-UR-96-1834 (Los Alamos National Laboratory, 2004).
// EOF
\ No newline at end of file
......@@ -537,3 +537,5 @@ refined. The bound is specified with `AMR_MAX_NUM_PART`
* [[[bib.qiang2005_fieldsolver,bib.qiang2005]]] J. Qiang et al., http://repositories.cdlib.org/lbnl/LBNL-59098[_A three-dimensional quasi-static model for high brightness beam dynamics simulation_], tech. rep. LBNL-59098 (LBNL).
* [[[bib.qiang2006-1_fieldsolver,bib.qiang2006-1]]] J. Qiang et al., _Three-dimensional quasi-static model for high brightness beam dynamics simulation_, Phys. Rev. ST Accel. Beams 9 (2006).
* [[[bib.qiang2006-2_fieldsolver,bib.qiang2006-2]]] J. Qiang et al., _Erratum: three-dimensional quasi-static model for high brightness beam dynamics simulation_, Phys. Rev. ST Accel. Beams 10, 12990 (2007).
// EOF
......@@ -45,10 +45,10 @@ used to indicate repetition.
The general format for a command is
....
----
keyword,attribute,...,attribute;
label:keyword,attribute,...,attribute;
....
----
It has three parts:
......@@ -58,11 +58,11 @@ identifier see <<sec.format.label>> and gives a name to the stored command.
identifier see <<sec.format.label>>.
3. Each `attribute` is entered in one of the forms
+
....
----
attribute-name
attribute-name=attribute-value
attribute-name:=attribute-value
....
----
+
and serves to define data for the command, where:
......@@ -83,21 +83,21 @@ When a command has a `label`, _OPAL_ keeps the command in memory. This
allows repeated execution of the same command by entering its label
only:
....
----
label;
....
----
or to re-execute the command with modified attributes:
....
----
label,attribute,...,attribute;
....
----
If the label of such a command appears together with new attributes,
_OPAL_ makes a copy of the stored command, replaces the attributes
entered, and then executes the copy:
....
----
QF:QUADRUPOLE,L=1,K1=0.01; // first definition of QF
QF,L=2; // redefinition of QF
......@@ -109,7 +109,7 @@ LMD; // re-execute LMD with
LMD,CALLS=100,TOLERANCE=1E-5; // re-execute LMD with
// new attributes
ENDMATCH;
....
----
[[sec.format.label]]
=== Identifiers or Labels
......@@ -136,16 +136,16 @@ expression see <<sec.format.astring>>.
An object attribute is referred to by the syntax
....
----
object-name->attribute-name
....
----
If the attribute is an array see <<sec.format.anarray>>, one of its
components is found by the syntax
....
----
object-name->attribute-name[index]
....
----
The following types of command attributes are available in _OPAL_:
......@@ -210,13 +210,13 @@ expression `X` |string |real
Examples:
....
----
TITLE,"This is a title for the program run ""test""";
CALL,FILE="save";
REAL X=1;
TWISS,LINE=LEP&STRING(X+1);
....
----
The second example converts the value of the expression `X+1` to a
string and appends it to `LEP`, giving the string `LEP2`.
......@@ -233,7 +233,7 @@ A logical expression has the same format and operator precedence as a
logical expression in C. It is built from logical operators
see <<tab_logoperator>> and logical operands:
....
----
relation ::= "TRUE" |
"FALSE" |
real-expr rel-operator real-expr
......@@ -243,7 +243,7 @@ rel-operator ::= "==" | "!=" | "<" | ">" | ">=" | "<="
and-expr ::= relation | and-expr "&&" relation
logical-expr ::= and-expr | logical-expr "||" and-expr
....
----
[#tab_logoperator]
.Logical Operators in __OPAL__
......@@ -270,22 +270,22 @@ true |logical |logical,logical
Example:
....
----
OPTION,ECHO=TRUE; // output echo is desired
....
----
When a logical attribute is not entered, its default value is always
`FALSE`. When only its name is entered, the value is set to `TRUE`:
....
----
OPTION,ECHO; // same as above
....
----
Example of a logical expression:
....
----
X>10 && Y<20 || Z==15
....
----
[[sec.format.areal]]
=== Real Expressions
......@@ -302,7 +302,7 @@ see <<sec.format.realarray>>.
A real expression is built from operators see <<tab_operator>> and
operands see <<sec.format.operand>>:
....
----
real-ref ::= real-variable |
real-array "[" index "]" |
object "->" real-attribute |
......@@ -330,7 +330,7 @@ real-expr ::= term |
"-" term |
real-expr "+" term |
real-expr "-" term |
....
----
It may contain functions see <<tab_realfun>>, Parentheses indicate
operator precedence if required. Constant sub-expressions are evaluated
......@@ -462,11 +462,11 @@ generator. It may be re-evaluated at unpredictable times, generating a
new value. However, the use of a random generator in an assignment
expression is safe. Examples:
....
----
D:DRIFT,L=0.01*RANF(); // a drift space with rand. length,
// may change during execution.
REAL P=EVAL(0.001*TGAUSS(X)); // Evaluated once and stored as a constant.
....
----
[[sec.format.operand]]
=== Operands in Expressions
......@@ -483,9 +483,9 @@ marked by the letter `D` or `E`, is permitted.
Examples:
....
----
1, 10.35, 5E3, 314.1592E-2
....
----
[[sec.format.symbolic-constants]]
==== Symbolic constants
......@@ -527,12 +527,12 @@ latexmath:[N_{p}] the total number of MPI processes.
Often a set of numerical values depends on a common variable parameter.
Such a variable must be defined as a global variable by one of
....
----
REAL X=expression;
REAL X:=expression;
VECTOR X=vector-expression;
VECTOR X:=vector-expression;
....
----
When such a variable is used in an expression, _OPAL_ uses the current
value of the variable. When the value is a constant or an expression
......@@ -542,12 +542,12 @@ expression preceded by the delimiter `:=` the expression is retained and
re-evaluated whenever one of its operands changes. +
Example:
....
----
REAL L=1.0;
REAL X:=L;
D1:DRIFT,L:=X;
D2:DRIFT,L:=2.0-X;
....
----
When the value of `X` is changed, the lengths of the drift spaces are
recalculated as `X` and `2-X` respectively.
......@@ -558,26 +558,26 @@ recalculated as `X` and `2-X` respectively.
In arithmetic expressions the attributes of physical elements or
commands can occur as operands. They are named respectively by
....
----
element-name->attribute-name
command-name->attribute-name
....
----
If they are arrays, they are denoted by
....
----
element-name->attribute-name[index]
command-name->attribute-name[index]
....
----
Values are assigned to attributes in element definitions or commands.
Example:
....
----
D1:DRIFT,L=1.0;
D2:DRIFT,L=2.0-D1->L;
....
----
`D1->L` refers to the length `L` of the drift space `D1`.
......@@ -618,29 +618,29 @@ object-name[index]::
Either form may be qualified by one or more beam line names, as
described by the formal syntax:
....
----
place ::= element-name |
element-name "[" integer "]" |
"#S" |
"#E" |
line-name "::" place
....
----
An omitted index defaults to one. Examples: assume the following
definitions:
....
----
M: MARKER;
S: LINE=(C,M,D);
L: LINE=(A,M,B,2*S,A,M,B);
SURVEY,LINE=L
....
----
The line `L` is equivalent to the sequence of elements
....
----
A,M,B,C,M,D,C,M,D,A,M,B
....
----
Some possible `place` definitions are:
......@@ -662,10 +662,10 @@ S[1]::M[1]::
A `range` in a beam line see Chapter link:lines#chp.lines[Beam Lines] is selected by the following
syntax:
....
----
range ::= place |
place "/" place
....
----
This denotes the range of elements from the first`place` to the second
`place`. Both positions are included. A few special cases are worth
......@@ -681,17 +681,17 @@ see Chapter link:lines#chp.lines[Beam Lines] the range contains the whole of th
Examples: Assume the following definitions:
....
----
M: MARKER;
S: LINE=(C,M,D);
L: LINE=(A,M,B,2*S,A,M,B);
....
----
The line L is equivalent to the sequence of elements
....
----
A,M,B,C,M,D,C,M,D,A,M,B
....
----
Examples for `range` selections:
......@@ -715,21 +715,21 @@ In matching it is desired to specify equality constraints, as well as
lower and upper limits for a quantity. _OPAL_ accepts the following form
of constraints:
....
----
constraint ::= array-expr constraint-operator array-expr
constraint-operator ::= "==" | "<" | ">"
....
----
[[sec.format.areference]]
=== Variable Names
A variable name can have one of the formats:
....
----
variable name ::= real variable |
object"->"real attribute
....
----
The first format refers to the value of the global variable
see <<sec.format.avariable>>, the second format refers to a named `attribute`
......@@ -760,24 +760,24 @@ latexmath:[\backslash]character::
All other characters stand for themselves. The pattern
....
----
"[A-Za-z][A-Za-z0-9_']*"
....
----
illustrates all possible unquoted identifier formats
see <<sec.format.label>>. Since identifiers are converted to lower case,
after reading they will match the pattern
....
----
"[a-z][a-z0-9_']*"
....
----
Examples for pattern use:
....
----
SELECT,PATTERN="D.."
SAVE,PATTERN="K.*QD.*\.R1"
....
----
The first command selects all elements whose names have exactly three
characters and begin with the letter `D`. The second command saves
......@@ -793,16 +793,16 @@ An attribute array is a set of values of the same attribute type
see <<sec.format.attribute>>. Normally an array is entered as a list in
braces:
....
----
{value,...,value}
....
----
The list length is only limited by the available storage. If the array
has only one value, the braces (``) can be omitted:
....
----
value
....
----
[[sec.format.logarray]]
==== Logical Arrays
......@@ -810,25 +810,25 @@ value
For the time being, logical arrays can only be given as a list. The
formal syntax is:
....
----
logical-array ::= "{" logical-list "}"
logical-list ::= logical-expr |
logical-list "," logical-expr
....
----
Example:
....
----
{true,true,a==b,false,x>y && y>z,true,false}
....
----
[[sec.format.realarray]]
==== Real Arrays
Real arrays have the following syntax:
....
----
array-ref ::= array-variable |
object "->" array-attribute |
......@@ -871,7 +871,7 @@ array-expr ::= array-term |
"-" array-term |
array-expr "+" array-term |
array-expr "-" array-term |
....
----
[#tab_compfun]
.Real Array Functions in _OPAL_ (acting component-wise)
......@@ -928,50 +928,50 @@ constant |real array |real array
Example:
....
----
{a,a+b,a+2*b}
....
----
There are also three functions allowing the generation of real arrays:
TABLE::
Generate an array of expressions:
+
....
----
TABLE(n2,expression) // implies
// TABLE(1:n2:1,expression)
TABLE(n1:n2,expression) // implies
// TABLE(n1:n2:1,expression)
TABLE(n1:n2:n3,expression)
....
----
+
These expressions all generate an array with `n2` components. The
components selected by `n1:n2:n3` are filled from the given
`expression`; a C pseudo-code for filling is
+
....
----
int i;
for (i = n1; i <= n2; i += n3) a[i] = expression(i);
....
----
+
In each generated expression the special character hash sign (`#`) is
replaced by the current value of the index `i`.
+
Example:
+
....
----
// an array with 9 components, evaluates to
// {1,4,7,10,13}:
table(5:9:2,3*#+1) // equivalent to
// {0,0,0,0,16,0,22,0,28}
....
----
ROW::
Generate a table row:
+
....
----
ROW(table,place) // implies all columns
ROW(table,place,column list)
....
----
+
This generates an array containing the named (or all) columns in the
selected place.
......@@ -979,10 +979,10 @@ selected place.
COLUMN::
Generate a table column:
+
....
----
COLUMN(table,column) // implies all rows
COLUMN(table,column,range)
....
----
+
This generates an array containing the selected (or all) rows of the
named column.
......@@ -995,9 +995,9 @@ permissible values String values see <<sec.format.astring>>.
Example:
....
----
{A, "xyz", A & STRING(X)}
....
----
[[sec.format.tokarray]]
==== Token List Arrays
......@@ -1006,6 +1006,8 @@ Token list arrays are always lists of single token lists.
Example:
....
----
{X:12:8,Y:12:8}
....
----
// EOF
......@@ -49,3 +49,5 @@ A::
The semi-major axis of the ellipse in [m].
B::
The semi-minor axis of the ellipse in [m].
// EOF
\ No newline at end of file
......@@ -131,3 +131,4 @@ include::autophase.adoc[]
include::benchmarks.adoc[]
endif::[]
// EOF
\ No newline at end of file
......@@ -179,3 +179,5 @@ year = {(2008-2018)}
* [[[bib.howison2010_intro,bib.howison2010]]] M. Howison et al., http://dx.doi.org/10.1109/CLUSTERWKSP.2010.5613098[_H5hut: A High-Performance I/O Library for Particle-based Simulations_], in IEEE International Conference on Cluster Computing Workshops and Posters (2010), pp. 1–8, 10 . 1109 / CLUSTERWKSP.2010.5613098.
* [[[bib.schietinger_intro,bib.schietinger]]] T. Schietinger, http://amas.web.psi.ch/tools/H5root/index.html[_H5root_], 2006.
* [[[bib.pooma]]] http://www.nongnu.org/freepooma/
// EOF
\ No newline at end of file
......@@ -18,9 +18,9 @@ simpler beam lines whose definitions can be nested to any level. A
powerful syntax allows to repeat or to reflect pieces of beam lines.
Formally a beam line is defined by a `LINE` command:
....
label:LINE=(member,...,member);
....
----
label:LINE=(member,...,member);
----
link:format#sec.format.label[label] gives a name to the beam line for later
reference.
......@@ -38,15 +38,15 @@ Beam lines can be nested to any level.
The simplest beam line consists of single elements:
....
label:LINE=(member,...,member);
....
----
label:LINE=(member,...,member);
----
Example:
....
L:LINE=(A,B,C,D,A,D);
....
----
L:LINE=(A,B,C,D,A,D);
----
ORIGIN::
Position vector of the origin of the line. All elements in this line
......@@ -66,22 +66,24 @@ is used, all its sub-lines must be known.
Example:
....
L:LINE=(A,B,S,B,A,S,A,B);
S:LINE=(C,D,E);
....
----
L:LINE=(A,B,S,B,A,S,A,B);
S:LINE=(C,D,E);
----
This example produces the following expansion steps:
1. Replace sub-line `S`:
+
....
(A,B,(C,D,E),B,A,(C,D,E),A,B)
....
----
(A,B,(C,D,E),B,A,(C,D,E),A,B)
----
2. Omit parentheses:
+
....
A,B,C,D,E,B,A,C,D,E,A,B
....
----
A,B,C,D,E,B,A,C,D,E,A,B
----
evaluated to constants immediately.
// EOF
\ No newline at end of file
......@@ -219,3 +219,5 @@ m_{p} & = & 0.939277 [GeV] & & & & c & = & 299792458 [m/s]
| latexmath:[\bar{p}_{x}]
| [eV]
|=======================================================================
// EOF
\ No newline at end of file
......@@ -60,16 +60,16 @@ be read from a file. To do this, in the _OPAL_ input file, the command
line `DISTRIBUTION` see Chapter link:distribution#chp.distribution[Distribution] should be defined like
this:
....
----
Dist1: DISTRIBUTION, TYPE=fromfile, FNAME="PartDatabase.dat";
....
----
where the file _PartDatabase.dat_ should have two lines:
....
----
1
0.001 0.001 0.001 0.001 0.001 0.001
....
----
The number in the first line is the total number of particles. In the
second line the data represents
......@@ -96,11 +96,11 @@ Like the single particle tracking mode, the initial 6D parameters of the
two particles in the local reference frame must be read from a file,
too. In the file should has three lines:
....
----
2
0.0 0.0 0.0 0.0 0.0 0.0
0.001 0.0 0.0 0.0 0.001 0.0
....
----
When the total particle number equals 2, this mode is triggered
automatically. Only the element `CYCLOTRON` in the beam line is used and
......@@ -287,7 +287,7 @@ latexmath:[\Delta \theta = \frac{1}{3}{^{\circ}}], the fourth line of
the header should be set to -3.0. Example showing the above explained
format:
....
----
3.0e+03
10.0
0.0
......@@ -298,8 +298,8 @@ format:
3.884e-02 5.999e-02 8.580e-02 1.150e-01 1.461e-01
1.779e-01 2.090e-01 2.392e-01 2.682e-01 2.964e-01
3.245e-01 3.534e-01 3.843e-01 4.184e-01 4.573e-01
......
....
...
----
[[sec.opalcycl.cyciae-type]]
==== CYCIAE type
......@@ -311,7 +311,7 @@ fields data is output by reading the APDL (ANSYS Parametric Design
Language) script during the post-processing phase (you may need to do
minor changes to adapt your own cyclotron model):
....
----
/post1
resume,solu,db
csys,1
......@@ -342,7 +342,7 @@ rsys,1
*endif
*enddo
finish
....
----
By running this in ANSYS, you can get a fields file with the name
_cyc100_ANSYS.data_. You need to put 6 parameters at the header of the
......@@ -357,7 +357,7 @@ latexmath:[\Delta \theta = \frac{1}{3} {^{\circ}}], the fourth line of
the header should be -3.0. In a word, the fields are stored in the
following format:
....
----
0.0
10.0
0.0e+00
......@@ -371,7 +371,7 @@ following format:
1 5 1 0.537657876
2 5 1 0.538079473
3 5 1 0.539086731
......
...
44 5 1 0.760777286
45 5 1 0.760918663
46 5 1 0.760969074
......@@ -383,8 +383,8 @@ following format:
1 5 1 0.704927299
2 5 1 0.705050993
3 5 1 0.705341275
......
....
...
----
[[sec.opalcycl.bandrf-type]]
==== BANDRF type
......@@ -408,7 +408,7 @@ number. This is useful is the decimal is unlimited. For instance,if
latexmath:[\Delta \theta = \frac{1}{3}{^{\circ}}], the fourth line of
the header should be -3.0.
....
----
1900.0
20.0
0.0
......@@ -423,8 +423,8 @@ the header should be -3.0.
0.506500015E+02 0.600000000E+01 0.938255981E+03 0.100000000E+01 0.240956593E+01
0.282477260E+01 0.340503168E+01 0.419502926E+01 0.505867147E+01 0.550443363E+01
0.570645094E+01 0.579413509E+01 0.583940887E+01 0.586580372E+01 0.588523722E+01
......
....
...
----
[[sec.opalcycl.3d-field-map]]
==== 3D field-map
......@@ -436,7 +436,7 @@ cavities while operating in this mode. In order to define ring
parameters such as initial ring radius a `RINGDEFINITION` type is loaded
into the line, followed by one or more `SBEND3D` elements.
....
----
ringdef: RINGDEFINITION, HARMONIC_NUMBER=6, LAT_RINIT=2350.0, LAT_PHIINIT=0.0,
LAT_THETAINIT=0.0, BEAM_PHIINIT=0.0, BEAM_PRINIT=0.0,
BEAM_RINIT=2266.0, SYMMETRY=4.0, RFFREQ=0.2;
......@@ -444,12 +444,12 @@ ringdef: RINGDEFINITION, HARMONIC_NUMBER=6, LAT_RINIT=2350.0, LAT_PHIINIT=0.0,
triplet: SBEND3D, FMAPFN="fdf-tosca-field-map.table", LENGTH_UNITS=10., FIELD_UNITS=-1e-4;
l1: Line = (ringdef, triplet, triplet);
....
----
The field-map with file name _fdf-tosca-field-map.table_ is loaded,
which is a file like
....
----
422280 422280 422280 1
1 X [LENGU]
2 Y [LENGU]
......@@ -462,7 +462,7 @@ which is a file like
194.36351 0.0000000 79.516210 0.42525693524E-07 -5.3827955117 0.17681348191E-07
194.70861 0.0000000 78.667380 0.19766168358E-07 -5.4350026348 0.82540823165E-08
<continues>
....
----
The header parameters are ignored - user supplied parameters
`LENGTH_UNITS` and `FIELD_UNITS` are used. Fields are supplied on points
......@@ -493,7 +493,7 @@ cavities, see link:elements#sec.elements.cyclotron[Cyclotron].
The voltage profile of a cavity gap is read from ASCII file. Here is an
example:
....
----
6
0.00 0.15 2.40
0.20 0.65 2.41
......@@ -501,7 +501,7 @@ example:
0.60 0.88 -1.59
0.80 0.43 -2.65
1.00 -0.05 -1.71
....
----
The number in the first line means 6 sample points and in the following
lines the three values represent the normalized distance to the inner
......@@ -612,7 +612,7 @@ chapters.
For the *Tune Calculation mode*, one additional auxiliary file with the
following format is needed.
....
----
72.000 2131.4 -0.240
74.000 2155.1 -0.296
76.000 2179.7 -0.319
......@@ -620,7 +620,7 @@ following format is needed.
80.000 2229.6 -0.264
82.000 2254.0 -0.166
84.000 2278.0 0.025
....
----
In each line the three values represent energy latexmath:[E], radius
latexmath:[r] and latexmath:[P_r] for the SEO (Static Equilibrium
......@@ -645,7 +645,7 @@ periodic accelerator. The function call also needs the symmetry of the
machine as well as a field map. The user then specifies the emittance
latexmath:[\pi] latexmath:[mm] latexmath:[mrad].
....
----
/*
* specify periodic accelerator
*/
......@@ -656,7 +656,7 @@ l1 = ...
*/
Dist1:DISTRIBUTION, TYPE=GAUSSMATCHED, LINE=l1, FMAPFN=...,
MAGSYM=..., EX = ..., EY = ..., ET = ...;
....
----
[[sec.opalcycl.example]]
==== Example
......@@ -752,3 +752,4 @@ the `SPTDUMPFREQ` option of `OPTION` statement see link:control#sec.control.opti
* [[[bib.howison2010]]] M. Howison et al., http://dx.doi.org/10.1109/CLUSTERWKSP.2010.5613098[_H5hut: A High-Performance I/O Library for Particle-based Simulations_], in IEEE International Conference on Cluster Computing Workshops and Posters (2010), pp. 1–8, 10 . 1109 / CLUSTERWKSP.2010.5613098.
* [[[bib.schietinger]]] T. Schietinger, http://amas.web.psi.ch/tools/H5root/index.html[_H5root_], 2006.
// EOF
\ No newline at end of file
......@@ -129,9 +129,9 @@ Just form the definition of the Taylor expansion, it can be seen that a finite,
++++
In _OPAL-map_ the Hamiltonian gets Taylor expanded and its map derived (`link:opalmap#sec.opalmap.creationOfMap[Creation of Map]`) in the TPSA using the _OPAL_ DA package. The truncation length gets defined in `TRACK` setting the `MAP_ORDER` attribute.
....
----
TRACK, LINE= QUADTEST, BEAM=BEAM1, MAXSTEPS=10000, DT=1.0e-10, ZSTOP=4.0, MAP_ORDER=2;
....
----
[[sec.opalmap.newParams]]
......@@ -164,21 +164,21 @@ _OPAL-map_ is the new flavour of _OPAL_ and currently just contains the fundamen
FODO lattice: https://gitlab.psi.ch/OPAL/Manual-2.0/wikis/examples/FODOmap.in[FODO.in]
To `RUN` _OPAL-map_, the `METHOD` attribute gets set to `THICK`.
....
----
RUN, METHOD = "THICK", BEAM=BEAM1, FIELDSOLVER=FS1, DISTRIBUTION=DIST1;
....
----
The maximal order of the beam line maps get defined with the `MAP_ORDER` attribute.
....
----
TRACK, LINE= QUADTEST, BEAM=BEAM1, MAXSTEPS=10000, DT=1.0e-10, ZSTOP=4.0, MAP_ORDER=2;
....
----
As an optional parameter for the beam line elements `NSlices=<x>` provides the opportunity to split one element in `<x>` smaller steps. Otherwise, the default value is defined with `1`.
....
----
D1: DRIFT, L=1., ELEMEDGE=0.000, NSLICES=10;
QP1: QUADRUPOLE, L=0.3, K1= 8.64195, ELEMEDGE=1.000, NSLICES=15;
....
----
......@@ -258,3 +258,5 @@ The first number describes the coefficient and the following 6 the variables of
[bibliography]
=== References
* [[[bib.berz1999_opalmap]]] Martin Berz. Modern map methods in particle beam physics. eng. ISBN: 978-0-12-014750-2. San Diego: Academic Press, 1999.
// EOF
\ No newline at end of file
......@@ -564,9 +564,9 @@ beam line is projected.
The script is not directly executable. Instead one has to pass it as
argument to `python`:
....
----
python myinput_ElementPositions.py --export-web
....
----
The following arguments can be passed
......@@ -1131,3 +1131,5 @@ replaced in ([eq.40]) to obtain a more explicit equation.
* [[[bib.paraview]]] A. Henderson, _ParaView guide: a parallel visualization application_ (Kitware Inc, 2007).
* [[[bib.paraview2]]] http://www.paraview.org[_ParaView_].
* [[[bib.visit]]] https://wci.llnl.gov/simulation/computer-codes/visit/[VisIt].
// EOF
\ No newline at end of file
......@@ -333,7 +333,7 @@ There are several methods to access output data:
==== Example Input File
.Example input file _05-DL_QN3.in_ for the optimization using the template file _tmpl/05-DL_QN3.tmpl_:
....
----
OPTION, ECHO=FALSE;
OPTION, INFO=TRUE;
......@@ -358,11 +358,11 @@ OPTIMIZE, INPUT="tmpl/05-DL_QN3.tmpl", OBJECTIVES = {drmsx, drmsy, goalfun},
OUTDIR="results";
QUIT;
....
----
.Template file _tmpl/05-DL_QN3.tmpl_:
....
----
OPTION, ECHO=FALSE;
OPTION, INFO=FALSE;
OPTION, PSDUMPFREQ=1000000;
......@@ -384,11 +384,11 @@ REAL QK1 = 6.2519;
REAL QSTR = QK1*BRho/2.0;
QDX1: QUADRUPOLE, ELEMEDGE=0.0, L=0.10, APERTURE="circle(0.1)",
K1=_QDX1_K1_ * BRho / 2;
K1=_QDX1_K1_ * BRho / 2;
QFX1: QUADRUPOLE, ELEMEDGE=0.91, L=0.20, APERTURE="circle(0.1)",
K1=_QFX1_K1_ * BRho / 2;
K1=_QFX1_K1_ * BRho / 2;
QDX2: QUADRUPOLE, ELEMEDGE=1.92, L=0.10, APERTURE="circle(0.1)",
K1=_QDX2_K1_ * BRho / 2;
K1=_QDX2_K1_ * BRho / 2;
FODO: LINE = (QDX1, QFX1, QDX2);
......@@ -434,10 +434,12 @@ RUN, METHOD = "PARALLEL-T", BEAM = beam1, FIELDSOLVER = Fs2, DISTRIBUTION = Dist
ENDTRACK;
QUIT;
....
----
Run OPAL with:
```
mpirun /path/to/opal --info 5 05-DL_QN3.in
```
\ No newline at end of file
```
// EOF
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment