Skip to content

Commit

Permalink
Merge branch 'master' into boinc_api
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed May 16, 2019
2 parents 6f0b4ff + 648439f commit 4409198
Show file tree
Hide file tree
Showing 35 changed files with 1,302 additions and 734 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -286,7 +286,7 @@ list(APPEND FORT90_LIB
common_modules close strings string_tools mainarrays mod_meta
mod_time mod_alloc zipf matrix_inv lielib beam6d mod_geometry
bouncy_castle plato_seq bdex fma dabnew end_sixtrack
ranecu wire hions elens mod_dist scatter dump dynk
ranecu wire elens mod_dist scatter dump dynk
aperture mod_fluc beam6d_fox six_fox postprocessing
read_write ranlux collimation coll_db mod_particles cheby utils
mod_ffield mod_ffield_aux
Expand Down
7 changes: 7 additions & 0 deletions doc/user_manual/chGeneralInput.tex
Expand Up @@ -10,6 +10,13 @@ \section{Main Input Files} \label{InFiles}
If none is provided, SixTrack will look for a file named \texttt{fort.2}.
These files will be referred to as \texttt{fort.3} and \texttt{fort.2} in the rest of this document.

\bigskip
Note that you can always add the global \texttt{DEBUG} flag to the \texttt{SETTINGS} block to enable echoing back most of the input parameters set in the \texttt{fort.3} file.
The flag is described in Section~\ref{STSett}.
This can not only verify that SixTrack understood and received the values correctly, but it also often echoes back other parameters computed from the input values.
The echoed back lines will start with ``\texttt{INPUT> DEBUG}'', so it is sometimes easier to grep for these lines in the output.
They contain the nme of the block where they were parsed, and the line number within the block if available.

% ================================================================================================================================ %
\section{Program Version} \label{ProVer}

Expand Down
271 changes: 270 additions & 1 deletion doc/user_manual/chInitialConditions.tex
Expand Up @@ -7,6 +7,275 @@ \chapter{Initial Conditions for Tracking} \label{InitCondTrack}
In order to derive the Lyapunov exponent\index{Lyapunov exponent}, and thereby to distinguish between regular and chaotic motion, the particle has a close by companion particle.
Moreover, experience has shown that varying only the amplitude while keeping the phases constant is sufficient to understand the non-linear dynamics, as a subsequent detailed post-processing allows to find the dependence of the parameter of interest on these phases.

A number of features have over time been deprecated or replaced by other modules in SixTrack.
Therefore there are a number of parameters that are no longer in use, but nevertheless have to be set to dummy values.
The Simulation (\texttt{SIMU}) and Distribution (\texttt{DIST}) blocks are intended to replace all of the blocks in this chapter.
These blocks take keyword/value sets instead of blocks of numbers, and are therefore easier to maintain.
The \texttt{SIMU} block (Section~\ref{Input:SIMU}) can currently be used to replace the \texttt{TRAC}, \texttt{INIT}, and \texttt{HION} blocks (Section~\ref{TraPar}), but note that the implementation may still have bugs, and is therefore considered experimental\index{SIMU}.

% ================================================================================================================================ %
\section{Simulation Parameters} \label{Input:SIMU}

\textcolor{notered}{\textbf{Note:} This input block is experimental. It provides an alternative interface to the most used parameters of the \texttt{TRAC}, \texttt{INIT}, and \texttt{HION} blocks, and is intended to be used in combination with the \texttt{DIST} block.}

\bigskip
The Simulation block (\texttt{SIMU}) is intended to take the main simulation parameters, and replaces the \texttt{TRAC}, \texttt{INTI}, and \texttt{HION} blocks\index{SIMU}\index{Simualtion Block}.
If the \texttt{SIMU} block is present in \texttt{fort.3}, these blocks cannot be present.

If the reference particle mass is set in the \texttt{SIMU} block, the value provided in the \texttt{SYNC} block is ignored.

\bigskip
\begin{tabular}{@{}lp{0.7\linewidth}}
\textbf{Keyword} & \texttt{SIMU}\index{SIMU} \\
\textbf{Data lines} & Variable \\
\textbf{Format} & Keyword/value format. See Table~\ref{Table:SIMU}.
\end{tabular}

\bigskip
Some settings provided by the \texttt{TRAC} and \texttt{INIT} blocks are not supported by the \texttt{SIMU} block.
These are listed below.
The option to add closed orbit to generated particles is only supported for the amplitude scan, which is not supported by the \texttt{SIMU} block.
If you need this feature, please use the old input format.

\bigskip
\begin{tabular}{@{}llp{0.7\linewidth}}
\texttt{TRAC} & \texttt{ntwin} & Fixed to a value of 2.\\
\texttt{TRAC} & \texttt{idy(1), idy(2)} & Fixed to a value of 1.\\
\texttt{TRAC} & \texttt{idfor} & Fixed to a value of 1.\\
\texttt{TRAC} & \texttt{amp(1), amp0} & Fixed to a value of 0.\\
\end{tabular}

\begin{center}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\begin{longtable}{@{\extracolsep{\fill}}|l|p{10cm}|l|}
\caption{Available arguents in the SIMU block.}
\label{Table:SIMU} \\*
\hline
\rowcolor{blue!30}
\textbf{Keyword} & \textbf{Argument(s)} & \textbf{Default} \\*
\hline
\endfirsthead

\hline
\rowcolor{blue!30}
\textbf{Keyword} & \textbf{Argument(s)} & \textbf{Default} \\*
\endhead

\rowcolor{gray!15}
\multicolumn{3}{|c|}{(The table continues on the next page)}\\*
\hline
\endfoot

\hline
\endlastfoot

\rowcolor{blue!15}
\multicolumn{3}{|c|}{\textbf{Particles and Turns}}\\*
\hline

\rowcolor{gray!15}
\texttt{PARTICLES} & \texttt{n\_particles(int)} & \texttt{0}\\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
The number of particles to be tracked.
The value must be an even number.
This is due to several parts of SixTrack dealing with particles as pairs.
\index{particles}
} \\*
\hline

\rowcolor{gray!15}
\texttt{TURNS} & \texttt{forward(int) [backward(int)]} & \texttt{0 0} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
The number of turns in the forward, and optionally, backward direction.
\index{turns}
} \\*
\hline

\rowcolor{gray!15}
\texttt{CRPOINT} & \texttt{interval(int)} & \texttt{1000} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
How often to write checkpoint files.
This parameter is ignored if SixTrack was not built with checkpoint/restart functionality.
Checkpoint files are always written on turn 1, then with the interval specified here, and then a last time at the end of tracking.
\index{checkpoint/restart}\index{CR}
} \\*

\hline
\rowcolor{blue!15}
\multicolumn{3}{|c|}{\textbf{Reference Particle}}\\*
\hline

\rowcolor{gray!15}
\texttt{REF\_ENERGY} & \texttt{energy(float,MeV)} & \texttt{0.0}\\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
The reference particle energy in MeV.
\index{reference particle}\index{reference energy}
} \\*
\hline

\rowcolor{gray!15}
\texttt{REF\_PARTICLE} & \texttt{mass(float,MeV) [charge A Z]} & \texttt{938.271998 1 1 1}\\*
\hline
\rowcolor{gray!15}
\texttt{REF\_PARTICLE} & \texttt{name [charge A Z]} & \texttt{proton 1 1 1}\\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
The reference mass can either be provided as a value in MeV, or as a named particle.
Currently this can only be set to ``proton''.
This value defaults to the proton mass set in the SixTrack physical constants module in \texttt{source/constants.f90}.
Optionally, the reference particle charge and atomic mass (A), and atomic number (Z) can be set.
If A is set, Z must also be set.
If only charge is set, Z is set to the same value.
The default values are all 1 (proton).
\index{reference particle}\index{reference mass}
} \\*
\hline

\rowcolor{gray!15}
\texttt{PDG\_YEAR} & \texttt{year(int)} & \texttt{2002}\\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
This can be used to set the PDG year to use for the mass if a name is provided in \texttt{REF\_PARTICLE}.
The default value is the 2002 proton mass, the other value currently supported is 2018.
More will be added in the future.
Note that this value affects how the proton radius is calculated as it uses the PDG year to select the relevant constant for calculating this.
Even when setting a reference particle mass in MeV, the PDG year is used for this.
\index{reference particle}\index{PDG}\index{proton radius}
} \\*
\hline

\rowcolor{blue!15}
\multicolumn{3}{|c|}{\textbf{Lattice and Optics}}\\*
\hline

\rowcolor{gray!15}
\texttt{LATTICE} & \texttt{thin|thick 4D|6D} & \texttt{thin 4D} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
The first argument must be either \texttt{thick} or \texttt{thin}, and this must match the content of the geometry file.
The second argument must be either \texttt{4D} or \texttt{6D}.
These arguments are not case sensitive.
When 6D tracking is requested, closed orbit and optical functions at the starting point are calculated using the differential algebra package.
\index{thick tracking}\index{thin tracking}\index{4D}\index{6D}
} \\*
\hline

\rowcolor{gray!15}
\texttt{OPTICS} & \texttt{first(int) last(int)} & \texttt{1 nblz} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
Start and stop structure element index for optics calculation.
If set to 0 or omitted, the optics calculation defaults to the full machine.
\index{optics calculation}
} \\*
\hline

\rowcolor{blue!15}
\multicolumn{3}{|c|}{\textbf{Closed Orbit}}\\*
\hline

\rowcolor{gray!15}
\texttt{6D\_CLORB} & \texttt{on|off} & \texttt{off} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
Compute the 6D closed orbit.
If the simulation is running 4D, this option is ignored.
\index{closed orbit}
} \\*
\hline

\rowcolor{gray!15}
\texttt{INIT\_CLORB} & \texttt{on|off} & \texttt{off} \\*
\hline
\rowcolor{gray!15}
\texttt{INIT\_CLORB} & \texttt{x xp y yp [sigma dpsv] (float)} & \texttt{6 * 0.0} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
Initialise closed orbit.
This keyword can be called either with a flag, in which case it turns on or off the reading of a closed orbit suggestion from file \texttt{fort.33}, or it can provide 4 or 6 values for the closed orbit suggestion.
If omitted, the values are initialised to zero, and the 4D closed orbit is used to seed the first four values of the 6D closed orbit.
These settings are ignored when running in 4D.
\index{closed orbit}\index{6D}
} \\*
\hline

\rowcolor{blue!15}
\multicolumn{3}{|c|}{\textbf{Particle and Track Files}}\\*
\hline

\rowcolor{gray!15}
\texttt{READ\_FORT13} & \texttt{on|off} & \texttt{off} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
Read the particle distribution from file \texttt{fort.13}.
This file is not intended for reading an initial distribution, but for continuing tracking from a previous simulation from a \texttt{fort.12} file.

Note that if the file is used as an input file for the initial distribution, the closed orbit is not added, even if requested with the \texttt{ADD\_CLORB} flag.
\index{fort.13}\index{fort.12}
} \\*
\hline

\rowcolor{gray!15}
\texttt{WRITE\_FORT12} & \texttt{interval(int)} & \texttt{10000} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
How often, in terms of turns, to write the particle distribution to file \texttt{fort.12}.
This file can be renamed to \texttt{fort.13} and used as an input file for continued tracking.
\index{fort.13}\index{fort.12}
} \\*
\hline

\rowcolor{gray!15}
\texttt{WRITE\_TRACKS} & \texttt{interval(int) [rewind(flag)]} & \texttt{nturn+1 on} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
How often, in terms of turns, to write to the tracking files on unit 90 and lower (see Appendix~\ref{Files}).
The optional \texttt{rewind} flag specifies whether or not to rewind the tracking files on each write.
\index{singletrackfile}\index{trackfiles}
} \\*
\hline

\rowcolor{blue!15}
\multicolumn{3}{|c|}{\textbf{Various Flags and Options}}\\*
\hline

\rowcolor{gray!15}
\texttt{EXACT} & \texttt{on|off} & \texttt{off} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
Switch to enable exact solution of the equation of motion into tracking and 6D (no 4D) optics calculations.
\begin{equation*}
\mbox{\texttt{off:}}
\quad x^\prime \simeq \frac{P_x}{P_0(1+\delta)},
\quad y^\prime \simeq \frac{P_y}{P_0(1+\delta)};
\end{equation*}
\begin{equation*}
\mbox{\texttt{on:}}
\quad x^\prime \simeq \frac{P_x}{P_0\sqrt{(1+\delta)^2-P_x^2-P_y^2}},
\quad y^\prime \simeq \frac{P_y}{P_0\sqrt{(1+\delta)^2-P_x^2-P_y^2}}.
\end{equation*}
\index{equation of motion}
} \\*
\hline

\rowcolor{gray!15}
\texttt{CURVEFF} & \texttt{on|off} & \texttt{off} \\*
\hline
\multicolumn{3}{|>{\raggedright}p{\textwidth}|}{%
Enable or disable the effect of the curvature in a combined function magnet (bending + quadrupole).
Note that the weak focusing effect is always included.
\index{curve effect}\index{combined function magnet}
} \\*
\hline

\end{longtable}
\end{center}

% ================================================================================================================================ %
\section{Tracking Parameters} \label{TraPar}

Expand Down Expand Up @@ -37,7 +306,7 @@ \section{Tracking Parameters} \label{TraPar}
\texttt{niu(1),niu(2)} & integer & Start and stop structure element index for optics calculation. If 0, defaults to the full machine. \\
\texttt{numlcp} & integer & Checkpoint/restart\index{checkpoint/restart} version: How often to write checkpointing files. \\
\texttt{numlmax} & integer & No longer in use. \\
\texttt{idz(1),idz(2)} & integers & A tracking where one of the transversal motion planes shall be ignored is only possible when all coupling terms are switched off. The part of the coupling that is due to closed orbit and other effects can be turned off with these switches. \\
\texttt{idz(1),idz(2)} & integers & A tracking where one of the transversal motion planes shall be ignored is only possible when all coupling terms are switched off. The part of the coupling that is due to closed orbit and other effects can be turned off with these switches. \\
& & \texttt{idz(1), idz(2) = 1}: coupling on. \\
& & \texttt{idz(1), idz(2) = 0}: coupling to the horizontal and vertical motion plane respectively switched off. \\
\texttt{idfor} & integer & Usually the closed orbit is added to the initial coordinates. This can be turned off using \texttt{idfor}, for instance when a run is to be prolonged. \\
Expand Down
1 change: 1 addition & 0 deletions doc/user_manual/six.tex
Expand Up @@ -8,6 +8,7 @@
\usepackage{verbatim}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}

%\usepackage{html}

Expand Down
1 change: 0 additions & 1 deletion source/aperture.f90
Expand Up @@ -18,7 +18,6 @@ module aperture
use mod_common_track
use mod_common_da

use mod_hions
use mod_alloc
#ifdef HDF5
use hdf5_output
Expand Down
1 change: 0 additions & 1 deletion source/beamgas.f90
Expand Up @@ -77,7 +77,6 @@ subroutine beamGas( myix, mysecondary, totals, myenom, ipart ,turn, el_idx )
use crcoall
use parpro
use parbeam
use mod_hions
use mod_common
use mod_common_track
use mod_common_main
Expand Down
1 change: 0 additions & 1 deletion source/cheby.f90
Expand Up @@ -603,7 +603,6 @@ subroutine cheby_kick(i,ix,n)
! apply kick of Chebyshev lenses

use mod_common, only : betrel, napx, brho
use mod_hions, only : moidpsv
use mod_common_main
use mathlib_bouncer
use numerical_constants, only : zero, c180e0, pi
Expand Down

0 comments on commit 4409198

Please sign in to comment.