Gkc
A gyrokinetic code written in C++/Cilk+
Install / Use
/learn @philscher/GkcREADME
The GKC++ code
Description
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
However, this code is still considered experimental and benchmark to other codes is pending. You may want to consider using other gyro-kinetic codes such as GENE, gkw or gs2 for production usage.
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
- Intel Compiler
- [GCC-4.9] (http://gcc.gnu.org/wiki/cilkplus-merge)
- Cilkplus/LLVM
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).
License
The code is license under the GNU Public License Version 3 (or at your opinion any later version).
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
