ARTIS (Sim 2007; Kromer & Sim 2009) is a 3D radiative transfer code for Type Ia supernovae using the Monte Carlo method with indivisible energy packets (Lucy 2002). The latest version incorporates polarisation and virtual packets (Bulla et al. 2015), non-LTE physics appropriate for the nebular phase of Type Ia supernovae (Shingles et al. 2020), and alpha- and beta-decays with time-dependent thermalisation (Shingles et al. 2023).
The code is modern C++23 and scales to thousands of CPU cores across multiple node using MPI with shared memory windows on each node. Experimental support is also provided for OpenMP and C++ standard parallelism (for multicore CPU and upcoming GPU targets).
The ARTIS code forms part of the method used to obtain published scientific results. Those interested in understanding the numerical techniques in greater detail than the published descriptions have full access to the underlying code. We anticipate that some developers building similar simulation codes might find our code useful, and in this case we ask that authors of any derivative works acknowledge and cite the ARTIS collaboration. This is in addition to the legal requirements of attribution and preservation of copyright notices on any substantial copies under the BSD 3-Clause licence.
We do not have the resources to support users of the code outside our team of direct collaborators.
We recommended that you retain the full source code and Git version metadata within each simulation folder for future reference (i.e. don't just copy the executables).
Clone the source code repository from the release branch:
git clone --branch release https://github.com/artis-mcrt/artis.git
cd artisTo compile and run artis, you will need a recent C++ compiler (g++, LLVM Clang, Apple Clang, or nvc++), and an MPI library with a wrapper command `mpicxx'. Typically these are made available on HPC systems using module or spack commands. For systems that we use, look at the top of the relevant SLURM script in scripts/artis-*.sh to find compatible modules specifications.
Next, select an options preset and compile with `make'. For example:
ln -s artisoptions_classic.h artisoptions.h
makeYou will likely want to change the number of packets per rank (MPKTS), and the GRID_TYPE (SPHERICAL1D, CYLINDRICAL2D, or CARTESIAN3D) using a text editor. A CARTESIAN3D grid can be used with any 1D, 2D, or 3D input model (as was historically done) but there will be a loss of accuracy due to the mismatch between model cells and propagation cells.
Next, go up to the model folder and symlink the executables and data folder:
cd ..
ln -s artis/sn3d
ln -s artis/exspec
ln -s artis/dataThe next steps are to ensure a full set of snapshot files (model.txt and abundances.txt) and an atomic database are present, and to configure the timesteps in input.txt. Then, queue the relevant job script with a command such as:
sbatch artis/scripts/artis-juwels.shClone the source code repository and checkout the default branch:
git clone https://github.com/artis-mcrt/artis.git
cd artisOn macOS, it's recommend that you install homebrew llvm to get clang-format, clang-tidy, clangd language server, and the clang C++ compiler. You can install this and other dependencies with:
brew install llvm open-mpi gsl prek compiledbInstall the pre-commit hooks and generate a compilation database for clang tools:
prek install
make clean && compiledb -n make TESTMODE=ONFor editing, the clangd language server is recommended (e.g., with the VS Code plugin).
sn3d will not write to the standard output (unless a crash occurs) but each MPI rank n will produce a log file called output_n-0.txt. A local run might look something like this:
mpirun -np 8 ./sn3d&
tail -f output_0-0.txtPress Ctrl+C to stop following the log file.
- TESTMODE=ON: Enable additional assertions and compile with address sanitizer.
- FASTMATH=OFF: Don't enable compiler transformations that affect round-off-level results (e.g. a*(b+c).
- BOOST=OFF: Use GSL (not Boost) for root finding (classic nne solver, T_e, and binned radfield) and adaptive integration.
- EIGEN=OFF: Use GSL (not Eigen) for matrix-vector solving (Spencer-Fano and NLTE pops).
- MAX_NODE_SIZE=N: Artificially limit MPI node size to N ranks. Useful for testing or preventing MPI shared memory windows from crossing CPU sockets.
- REPRODUCIBLE=ON: Use stable sorts and disable FASTMATH.
- GPU=ON: Required to compile for GPUs. Avoids incompatible GSL and std::random calls.
Run-time configuration with:
- number of timesteps
- the start and end time in days
- number of pure LTE timesteps,
- optically-thick condition that switches cells to a grey opacity treatment.
Grid parameters, cell densities and nuclear composition.
Per-cell elemental mass fractions (in case the set of isotopic abundances in model.txt is not complete).
One block per ion consisting of:
Header:
[atomic number] [ionisation stage] [level count] [ionisation energy in eV]
Level count rows of:
[level index] [energy in eV] [statistical weight] [level transition count] [level name or description]
One block per ion consisting of:
Header:
[atomic number] [ionisation stage] [transition count]
Transition count rows of:
[lower level index] [upper level index] [A value] [collision strength] [forbidden flag]
In case the collision strength is not available, it will be -1.0 for permitted and -2.0 for forbidden transitions.
Sets a filter on the elements, ion stages, and energy levels that are read in from atomic data files.
Photoionisation cross sections in v1 format (arbitrary energy tables) or v2 format (regularly spaced energy grid).
Gamma decay spectra containing energies [MeV] and probabilities.
Distributed under the BSD 3-Clause license. See LICENSE for more information.