98 lines
4.8 KiB
Plaintext
Executable File
98 lines
4.8 KiB
Plaintext
Executable File
COMPILATION OF THE CODE:
|
|
|
|
The code requires a C++ compiler (e.g. gcc) and few external libraries (MPI,
|
|
HDF5, Jansson, Blitz++). All of them are available in Debian and are
|
|
listed with package names in the file REQUIRED. Other distributions might have
|
|
slightly different package names. After installing all external dependencies
|
|
using the package manager of your distribution the compilation of KARL is
|
|
straight forward. First provide the path of the current working directory as an
|
|
environment variable named "HOMEBASE", eg. through:
|
|
|
|
$ export HOMEBASE=$(pwd)
|
|
|
|
Then simply run
|
|
|
|
$ make
|
|
|
|
which should build and link all files to produce the binary file "bin/karl"
|
|
in the current working directory. If any library is not available in the system
|
|
wide include or library path you might have to edit the settings in
|
|
config/config.mk.
|
|
|
|
If either Jansson or Blitz++ are not available via packages the config/config.mk
|
|
file includes the option for those libraries to be built on their own.
|
|
To do that, the MAKE_* (e.g. MAKE_BLITZ) variable has to be set to "true" before the
|
|
make call. Depending on the status of MAKE_BLITZ and MAKE_JANSSON the include
|
|
and lib paths are set automatically to the self-built libraries or the system
|
|
libraries.
|
|
|
|
Compiling the libraries requires autoconf, automake, libtool and python
|
|
|
|
START OF A SIMULATION:
|
|
|
|
The simulation needs a JSON file that describes the physical and numerical
|
|
parameters of the simulation. One such file is provided with the source code
|
|
(simulation_config/test_parameter.json).
|
|
The JSON file also contains the location for the simulation output. Before
|
|
running on a cluster you should
|
|
|
|
edit the JSON file, adjust "folder" and "filename" in the "Output" section.
|
|
|
|
You can then start the simulation using
|
|
|
|
$ mpiexec -n 4 bin/karl --parameter_file simulation_config/test_parameter.json
|
|
|
|
You can of course specify some other number of MPI threads or use a different
|
|
JSON file. If you have to use some non-standard method to start MPI programs
|
|
(such as poe) instead of mpiexec you might need to check the relevant
|
|
documentation.
|
|
|
|
ANALYSIS OF THE SIMULATION OUTPUT:
|
|
Python scripts are provided to analyze the output of the simulation. They can be
|
|
found in the folder "analysis". The script require the python packages
|
|
numpy, matplotlib, scipy and h5py.
|
|
|
|
An example of how to use the analysis scripts is provided in the file "analysis/plot_example.py".
|
|
|
|
INPUT OF THE SIMULATION (JSON files):
|
|
In the simulation_config/ subdirectory some example files for the general input of
|
|
a simulation are given.
|
|
|
|
The two files "parameter_katrin_example.json" and "test_parameter.json" are two
|
|
complete examples, that can be used to start a simulation.
|
|
The "parameter_katrin_example.json" file describes the setup for the
|
|
simulation of the KATRIN WGTS and "test_parameter.json" is a generic test case example.
|
|
|
|
The other provided JSON files are meant to explain the structure and show the possible
|
|
options that can be chosen for some of the more complex elements required in a parameter
|
|
file and can not be used as input for a simulation.
|
|
E.g. "scattering_angle_example.json" shows the four different types of
|
|
scattering angle distributions that can be used in the code and how they are to be
|
|
structured in a working parameter file.
|
|
|
|
INPUT OF THE SIMULATION (HDF5 files):
|
|
For several groups in the JSON input file it is possible to read data from an external
|
|
HDF5 file, these groups are those that specify a Vector Field, Function or a Scattering Angle Distribution.
|
|
|
|
For the Scattering Angle Distribution it is necessary that the HDF5 files contain the
|
|
three objects "energies(eV)", "angles(rad)" and "cross_sections(m-2)". The first two
|
|
both have to be one dimensional arrays, containing the energies in eV and angles in rad
|
|
where the cross sections are defined respectivley. The thrid key has to contain a
|
|
two-dimensional array containing the actual values of the cross section in m^2, with the
|
|
first dimension being the energy and the second dimension being the angle.
|
|
|
|
In case of the Vector Field or the Function the structure of the input HDF5 file
|
|
is not as rigid, since the keys to the specific objects in the file have to be provided
|
|
in the JSON object.
|
|
The necessary structure in the JSON file for these two types types
|
|
of objects can either be found in the provided example JSON files or in the comments
|
|
in the corresponding generator files (i.e. "include/generators/vector_field_generator.h"
|
|
and "include/generators/function_generator.h").
|
|
|
|
|
|
NOTES:
|
|
Kommentare in den files: position_binning.*, current_collector.*, kinematic.*, sim_constants.h, mover.*, simulation_output.*, functions.*, injector_generator.h, ionization.h, recombination.cpp und species_generator überprüfen lassen
|
|
|
|
für interactions.cpp: mehr Kommentare zum source code (i.e. zur Berechnung?)
|
|
für cross_sections.h: Referenzen mit reinschreiben?
|