The GKC++ code
GKC++ (GyroKinetic Code++) is a δf gyro-kinetic code. Currently features are :
- Various geometries (sheared, shearless, toroidal)
- multiple species support
- fully electromagnetic code
- Interfaces for various field and Vlasov solvers
- Eigensolver interface using SLEPc/PETSc
- Decomposition into eigenvectors using elemental
- Preliminary support for global simulations
- 3-stage parallelization (Vectorization, OpenMP and MPI)
- Data output using HDF-5.
- Data analysis using ipython/matplotlib/ scipy/pytables
GKC++ is programmed in C++-11/Cilk+ which (for our opinion) greatly simplifies readability and handling of multi-dimensional arrays. However, note that only a limited subset of compilers support the Cilk+ extensions such as
Why C++ but not Fortran
Fortran is popular in numerical science communities due to it's power of handling multi-dimensional arrays. However, the lack of templates, function overloading, pointers and classes (although some of these features are now supported by the Fortran-03 standard) makes Fortran code difficult to read and extend as well as accessing other 3rd party libraries.
To handle multiple dimension in C++, we make use of CEAN (C/C++ Extension for Array Notation) as provided by Cilk+. Additionally, Cilk+ allows to use C99 complex numbers within C++, which facilitates vectorization. Although the code is non-standard, the authors believe that Cilk+ will establish as a new-standard such as OpenMP did (e.g. array sections in Section 2.6 OpenMP 4.0rc2).
The code is license under the GNU Public License Version 3 (or at your opinion any later version).