A quasi-optical beam-tracing code for electron cyclotron waves absorption and current drive in tokamaks
Go to file
Michele Guerini Rocco 3f75cbd357
default.nix: pass system argument to nixpkgs
2024-12-12 03:13:17 +01:00
doc document the wave polarisation convention 2024-11-09 21:19:45 +01:00
schemas Remove unused imports 2024-05-17 11:01:14 +02:00
scripts package the python scripts 2024-12-12 02:28:27 +01:00
src src/pec.f90: remove leftover file 2024-12-03 16:33:54 +01:00
srcjetto fixed incompatibilities with allocatable arrays (pgf90 compiler, JETTO); fixed input/output scaling (gray/jetto interface); fixed error in read_beams2 for small beam tables 2016-06-01 13:49:35 +00:00
tests src/gray_core.f90: fix polarisation shown in summary table 2024-11-04 12:05:49 +01:00
.gitignore package the python scripts 2024-12-12 02:28:27 +01:00
.version add infrastructure for making releases 2024-12-04 16:39:25 +01:00
LICENSE.md move vendored libraries to their own directory 2024-04-29 10:08:16 +02:00
Makefile package the python scripts 2024-12-12 02:28:27 +01:00
README.md README.md: finally add a README 2024-12-04 16:39:25 +01:00
configure add support for intel compilers 2024-11-04 12:00:19 +01:00
default.nix default.nix: pass system argument to nixpkgs 2024-12-12 03:13:17 +01:00

README.md

GRAY

beam-tracing code for EC waves

GRAY is a beam-tracing code for Electron Cyclotron (EC) waves in a tokamak. It is based on the complex eikonal theory (quasi-optics), which can accurately describe the propagation of a Gaussian beam, diffraction effects included.

In addition, power absorption and current drive are computed using the fully relativistic dispersion relation and a neoclassical response function, respectively.

Documentation

The GRAY user manual is available online here.
You can also find a PDF version of the user manual and the man pages for the files and commands in the release archives.

Installing

Download the latest release from here. Some pre-compiled static binaries may be available for your platform, if not, fetch the source archive and follow the instructions below for how to build GRAY yourself.

If you have the Nix package manager, to build GRAY all you need to do is run nix-build in the source directory. The resulting build will be linked to ./result.

To install GRAY in your environment you can run nix-env -i -f.. This will allow you to invoke gray (and other commands) and access the GRAY man pages from anywhere in your system.

Note: this method is recommended because Nix will automatically fetch all the dependencies (at a known good version) for you and the build result will be reproducible.

Building from source manually

To build GRAY from source make sure you have:

  • a Fortran compiler (gfortran ≥12.0 and ifort ≥2021 tested)
  • a POSIX-compatible environment (GNU and Darwin tested)
  • GNU Make (≥4.4 tested)

Unpack the release archive and in the source directory run:

./configure
make

This will build the gray program in build/bin/gray. You can find more configuration options by running ./configure --help.

Finally, to install the build results, run

make install-bin

Note: the location where GRAY will be installed on your system can configured with the --prefix option of the configure script.

Note: gray is dynamically linked by default. If supported by your system, you can build a static binary using the --enable-static configure option.

Building the documentation

To build the documentation (GRAY user manual and man pages) you need:

Then run:

./configure --with-katex=/path/to/katex/archive/unpacked
make docs

The results will be placed in build/share, to install, run:

make install-doc

Running the tests

GRAY includes a number of integration tests that are useful to check whether your build was successful or when developing a new feature. To run these tests you will a Python interpreter with these packages included:

  • NumPy (≥1.24 and <2.0 tested)
  • SciPy
  • Matplotlib

To run all tests do make check. To test only a specific case (eg. a failed one) do:

python -m tests tests.<name>

The list of available tests cases is obtained with:

python -m tests --list-cases

Note: the --visual option may provide more clues into why a test case is failing.

License

See the LICENSE.md file.