### Install uv (macOS and Linux) Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Install the uv package manager, required by artistools. The Linux installer adds uv to the shell profile, but the current shell needs it too. ```bash brew install uv # macOS curl -LsSf https://astral.sh/uv/install.sh | sh # Linux ``` -------------------------------- ### Install artistools with uv Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Installs artistools and adds its tool folder to the current shell's PATH. `uv tool update-shell` adds it to the shell profile. ```bash uv tool install artistools export PATH="$(uv tool dir --bin):$PATH" ``` -------------------------------- ### Install compiler and MPI on macOS Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Install required packages via Homebrew and set PATH for LLVM and GNU coreutils. Needed before building ARTIS on macOS. ```bash brew install llvm open-mpi pkgconf zstd coreutils export PATH="$(brew --prefix llvm)/bin:$(brew --prefix coreutils)/libexec/gnubin:$PATH" ``` -------------------------------- ### Install prek with uv Source: https://artis-mcrt.readthedocs.io/en/latest/development.html Installs the `prek` tool using uv on Linux. The export is necessary for the hooks to find the tool. ```bash uv tool install prek export PATH="$(uv tool dir --bin):$PATH" ``` -------------------------------- ### Install compiler and MPI on Fedora 40+ Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Install required packages via dnf and load the OpenMPI module. Needed before building ARTIS on Fedora 40 or later. ```bash sudo dnf install gcc-c++ openmpi-devel libzstd-devel zstd git make curl xz rsync python3 perl module load mpi/openmpi-$(uname -m) ``` -------------------------------- ### Install compiler and MPI on Debian/Ubuntu 24.04+ Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Install required packages via apt and set OMPI_CXX to g++-14. Needed before building ARTIS on Debian or Ubuntu 24.04 or later. ```bash sudo apt-get install g++-14 openmpi-bin libopenmpi-dev libzstd-dev zstd git make curl xz-utils rsync python3 perl export OMPI_CXX=g++-14 ``` -------------------------------- ### Build documentation locally Source: https://artis-mcrt.readthedocs.io/en/latest/development.html Builds the documentation site locally with Sphinx. `-W` makes warnings errors, as CI and Read the Docs do. ```bash uv run --python 3.14 --with-requirements docs/requirements.txt sphinx-build -W --keep-going docs docs/_build/html ``` -------------------------------- ### Install pre-commit hooks and make compilation database Source: https://artis-mcrt.readthedocs.io/en/latest/development.html Installs pre-commit hooks, selects a preset, and makes a compilation database for clang tools. The database is rewritten on every build and always uses TESTMODE=ON flags. ```bash prek install ln -s artisoptions_nltenebular.h artisoptions.h make TESTMODE=ON compile_commands.json ``` -------------------------------- ### Symlink preset and build with make Source: https://artis-mcrt.readthedocs.io/en/latest/installation.html Creates artisoptions.h by symlinking a preset, then runs make to build sn3d and exspec. The file artisoptions.h is gitignored. ```bash ln -s artisoptions_classic.h artisoptions.h make ``` -------------------------------- ### Clone the ARTIS repository Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Clone the ARTIS repository from GitHub and change into the directory. ```bash git clone https://github.com/artis-mcrt/artis.git cd artis ``` -------------------------------- ### Source uv environment (Linux) Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Adds uv to the current shell after the Linux installer has updated the profile. ```bash source "$HOME/.local/bin/env" # Linux ``` -------------------------------- ### Select compile-time options and build Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Run inside the model folder. Creates a symlink `artisoptions.h` to the preset `artisoptions_kilonova_lte.h` and builds the code. Note that `artisoptions.h` is a symlink, so editing it changes the preset file of the clone, affecting all model folders that share the clone. ```bash cd artis ln -s artisoptions_kilonova_lte.h artisoptions.h make cd .. ``` -------------------------------- ### Create model folder from test model input files Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Run the first command in the clone of step 2. The script creates the folder, a symlink `artis` to the clone, and an `input.txt` from `scripts/input-template.txt`. The last command replaces that `input.txt` with the file of the test model. ```bash scripts/new-model-folder.sh --symlink ~/mymodel cd ~/mymodel tar -xf artis/tests/atomicdata_feconi.tar.xz rsync -a --exclude 'results_md5_*' artis/tests/kilonova_1d_inputfiles/ ./ cp input-newrun.txt input.txt ``` -------------------------------- ### Run linting and formatting commands Source: https://artis-mcrt.readthedocs.io/en/latest/development.html Commands to run before a commit. Replace `grid.cc` with the files you changed. ```bash prek run --all-files make TESTMODE=ON compile_commands.json run-clang-tidy grid.cc ``` -------------------------------- ### Start ARTIS simulation Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Start the simulation. Look for 'timestep 3 is complete' in output_0-0.txt. To run remaining timesteps, set timestep_finish to 20 and start sn3d again. ```bash mpirun -np 4 artis/sn3d ``` -------------------------------- ### Copy test input files and download atomic data Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Copies the input files of the `nebular_1d_3dgrid` test into the model folder, downloads the atomic data archive named by `artis/tests/atomic_data_release.txt`, unpacks it, and sets `input.txt` from `input-newrun.txt`. ```bash rsync -a --exclude 'results_md5_*' --exclude 'input-resume.txt' artis/tests/nebular_1d_3dgrid_inputfiles/ ./ curl -fLO "https://github.com/artis-mcrt/artis/releases/download/$(cat artis/tests/atomic_data_release.txt)/atomicdata_feconi.tar.xz" tar -xf atomicdata_feconi.tar.xz cp input-newrun.txt input.txt ``` -------------------------------- ### Set MAKEFLAGS for parallel builds Source: https://artis-mcrt.readthedocs.io/en/latest/installation.html Adds a MAKEFLAGS line to your shell startup file to enable parallel make builds using all available CPU cores. ```bash export MAKEFLAGS="--jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu)" ``` -------------------------------- ### Symlink NLTE nebular preset to artisoptions.h Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Creates a symlink from the NLTE nebular preset to artisoptions.h in the artis directory. This selects the NLTE nebular preset for the simulation. ```bash cd artis ln -s artisoptions_nltenebular.h artisoptions.h cd .. ``` -------------------------------- ### Install dependencies with Homebrew on macOS Source: https://artis-mcrt.readthedocs.io/en/latest/installation.html Installs LLVM tools, Open MPI, and other dependencies via Homebrew. Requires Homebrew to be installed. ```bash brew install llvm lld libomp open-mpi pkgconf zstd coreutils prek ``` -------------------------------- ### Clone the ARTIS source code into the model folder Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Creates the model folder and clones the ARTIS source code into the `artis` subfolder so that the options in section 4 belong to this simulation only. ```bash mkdir ~/nebular_w7 cd ~/nebular_w7 git clone https://github.com/artis-mcrt/artis.git ``` -------------------------------- ### Set NUM_PACKETS for laptop Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html The preset has a value of `NUM_PACKETS` for about 1000 MPI ranks. A laptop needs a much smaller value. Change it in `artis/artisoptions.h`. ```cpp constexpr std::int64_t NUM_PACKETS = 1e6; ``` -------------------------------- ### Check timestep progress with grep Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Shows the latest progress line from the rank 0 log after each timestep. The output example indicates the timestep number and estimated remaining time. ```bash grep "is complete" output_0-0.txt | tail -n 1 ``` ```text timestep 23 is complete (24 of 50 timesteps of the model) after 0.00 hours. If each timestep takes this time, the remaining 26 requested timesteps take 0.01 hours. ``` -------------------------------- ### Run artistools check Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Runs the artistools check command to validate the run. The output example shows a warning about temperature limits, indicating cells with Te at MINTEMP or MAXTEMP lack thermal balance and are not physical. ```bash artistools check . ``` ```text "temperature limits" warning "... over all 50 time steps, 66.7% of the values of Te are at a limit ..." ``` -------------------------------- ### Add LLVM and coreutils to PATH on macOS Source: https://artis-mcrt.readthedocs.io/en/latest/installation.html Prepends Homebrew's LLVM and coreutils bin directories to PATH so clang, clang-format, clang-tidy, clangd, nproc, and md5sum are accessible. ```bash export PATH="$(brew --prefix llvm)/bin:$(brew --prefix coreutils)/libexec/gnubin:$PATH" ``` -------------------------------- ### Run initial checks: describe, check, logsummary Source: https://artis-mcrt.readthedocs.io/en/latest/analysis.html Start by running these three commands on the model folder. `describe` gives grid, timesteps, and options; `check` gives one row per check; `logsummary` counts warning types in rank 0 logs. ```bash artistools describe artistools check artistools logsummary ``` -------------------------------- ### Select compiler for Open MPI with OMPI_CXX Source: https://artis-mcrt.readthedocs.io/en/latest/installation.html Set the C++ compiler used by Open MPI's mpicxx wrapper. Required before building when using Open MPI. ```bash export OMPI_CXX=g++ ``` -------------------------------- ### Keep first timestep settings in input.txt Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Two lines in input.txt set the first timesteps: the first four timesteps solve the gas state in LTE, and every cell is thick in these timesteps because the optical depth limit is 0. ```text 4 # 18: num_lte_timesteps 0.0 4 # 19: optical_depth_is_thick num_grey_timesteps ``` -------------------------------- ### Build and run ARTIS with mpirun Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Builds the ARTIS code and runs the sn3d simulation with 4 processes. The job folder name is printed to standard output, and tail -F shows the rank 0 log; press Ctrl+C to stop following. ```bash cd artis && make && cd .. mpirun -np 4 artis/sn3d & tail -F output_0-0.txt ``` -------------------------------- ### Plot electron temperature of cell 0 Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Plots the electron temperature of the first cell against timestep. The curve shows LTE timesteps, Spencer-Fano solver start, and detailed bound-free estimators; use results after the method changes stabilize. ```bash artistools plotestimators Te -x timestep --cell 0 . ``` -------------------------------- ### Set timesteps in input.txt Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Modifies three lines in input.txt to run 50 timesteps from 170 to 250 days and run all of them. The original input.txt runs 8 of 10 timesteps. ```text 50 # 1: ntimesteps: number of timesteps 000 050 # 2: timestep_start timestep_finish: ... 170 250 # 3: tmin_days tmax_days: start and end times [day] ``` -------------------------------- ### Check memory usage with grep mem_usage Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Displays memory usage lines for packets and large arrays from the rank 0 log. The output example shows sizes in MB for packets, linelist, and transition lists. ```bash grep mem_usage output_0-0.txt ``` ```text [info] mem_usage: packets occupy 572.205 MB [info] mem_usage: linelist occupies 15.848 MB (node shared memory) [info] mem_usage: transition lists occupy 20.800 MB (node shared memory) ... ``` -------------------------------- ### Run the kilonova_1d test model Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Run the quickest complete simulation. Downloads atomic data (~15 MB), builds sn3d and exspec, creates tests/kilonova_1d_testrun, runs the simulation in two jobs, and compares output checksums. Different compilers/CPUs may produce different checksums and stop at comparison; first job output remains complete. ```bash tests/runtest.sh kilonova_1d ``` -------------------------------- ### Use new-model-folder.sh to create model folder Source: https://artis-mcrt.readthedocs.io/en/latest/clusters.html Alternative to manual setup: runs the bundled script from an existing clone to create a new model folder and then enters its artis subfolder. The script performs the same steps as the manual commands. ```bash artis/scripts/new-model-folder.sh ../mymodel cd ../mymodel/artis ``` -------------------------------- ### compositiondata.txt level limits configuration Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Selects elements, ion stages, and levels read from atomic data. First line is element count; next two lines must be 0. Each later line specifies atomic number, ion stage range, max levels (or -1 for all), an unused value (must be ≥0), and mean atomic mass. This example selects Fe I–V, Co II–IV, Ni II–V with at most 500 levels per ion. ```text 3 0 0 26 5 1 5 500 0.0 55.8450 27 3 2 4 500 0.0 58.9332 28 4 2 5 500 0.0 58.6934 ``` -------------------------------- ### Set timestep range in input.txt Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html The line with the comment `# 2: timestep_start timestep_finish` holds the first timestep of the job and the stop timestep. The job does not run the stop timestep, so the test runs the first nine of twenty timesteps. Change that line to run the whole model. ```text 000 020 # 2: timestep_start timestep_finish: ... ``` -------------------------------- ### Describe, check, and plot model results Source: https://artis-mcrt.readthedocs.io/en/latest/quickstart.html Commands to describe the model, check results, and plot light curves and spectra. `artistools check` gives one row per check and warns for this test model due to reduced atomic data and low packet count. `plotspectra` requires a time in days (`-t`). ```bash artistools describe tests/kilonova_1d_testrun artistools check tests/kilonova_1d_testrun artistools plotlightcurves tests/kilonova_1d_testrun artistools plotspectra -t 1 tests/kilonova_1d_testrun ``` -------------------------------- ### Describe model with artistools inputmodel describe Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Run from the model directory to print the grid, mass, and element masses. For this 1D model with three shells, it reports an outer velocity of 12415 km/s, total mass 0.635 solar masses, and 49.67% iron group. Cell indices are 0-based, matching the log messages. ```bash artistools inputmodel describe . ``` -------------------------------- ### Set NUM_PACKETS in artisoptions.h Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Sets the NUM_PACKETS constant to 1e7 in artis/artisoptions.h. The preset has a value for about 1000 MPI ranks; each of the four ranks holds 2.5e6 packets, which take 572 MB of memory per rank. ```cpp constexpr std::int64_t NUM_PACKETS = 1e7; ``` -------------------------------- ### Check end state and core hours Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Shows the final log lines indicating the job finished and the total core hours. The artistools corehours command sums core hours for all jobs in a model folder. ```text No need for restart sn3d finished (job: pktprop ts 0 to ts 49 grid-preprop, 0.021 wallclock hours * 4 processes * 1 threads = 0.083 core hours) ``` -------------------------------- ### Run sn3d locally with 8 MPI ranks and follow the log Source: https://artis-mcrt.readthedocs.io/en/latest/running.html Start a local sn3d run with eight MPI ranks in the model folder. `tail -F` waits until the log file `output_0-0.txt` appears; press Ctrl+C to stop following it. ```bash mpirun -np 8 artis/sn3d & tail -F output_0-0.txt ``` -------------------------------- ### Plot spectrum with emission and absorption using artistools plotspectra Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Run from the model folder to plot the spectrum at 220 days. The --emissionabsorption flag adds colored ion emission (above axis) and absorption (below axis) features; without it, only the spectrum is drawn. The time 220 days is within the arrival times range (177.04 to 232.07 days) reported by artistools check. ```bash artistools plotspectra -t 220 --emissionabsorption . ``` -------------------------------- ### Check packet count sufficiency Source: https://artis-mcrt.readthedocs.io/en/latest/analysis.html Run `artistools check --frompackets` to get the `packet noise` row. This reads packet files and is slow. The noise is the square root of sum of squared packet energies divided by sum of packet energies. ```bash artistools check --frompackets ``` -------------------------------- ### Warning for cells with heating bigger than cooling Source: https://artis-mcrt.readthedocs.io/en/latest/example.html Shows the warning logged for cells where heating exceeds cooling over the entire T_e range, forcing T_e to MAXTEMP. These cells lack atomic data for silicon and sulphur, making their results non-physical. ```text [warning] call_T_e_finder: heating bigger than cooling over the whole T_e range [1000,30000] in modelcell 1 (...). T_e forced to be MAXTEMP ``` -------------------------------- ### Download and unpack the Shingles et al. (2022) atomic database Source: https://artis-mcrt.readthedocs.io/en/latest/data.html Downloads the atomic database for the nebular phase of a Type Ia supernova into the model folder and unpacks it. Requires the `zstd` command; the `libzstd-dev` package does not supply it, so install the `zstd` package as well. ```bash curl -fLO https://github.com/artis-mcrt/artis/releases/download/v2026.5.15/atomicdata_shinglesetal2022.tar.zst tar --zstd -xf atomicdata_shinglesetal2022.tar.zst ``` -------------------------------- ### Escaped packet count log output Source: https://artis-mcrt.readthedocs.io/en/latest/planning.html Shown in the log of each rank during a timestep. The count is only a guide; it includes all escaped packet types (including gamma packets) and the spectrum holds only r-packets. Light travel time can move a packet to the timestep of its arrival. ```text During timestep 33 on MPI process 0, 47523 pellets decayed and 49411 packets escaped. (t=220.124 [d]) ``` -------------------------------- ### artistools commands for first look at simulation output Source: https://artis-mcrt.readthedocs.io/en/latest/outputfiles.html Use these artistools commands to inspect a model folder: describe, check, plotlightcurves, plotspectra (with -t for days), and plotestimators. They read the output files produced by the simulation. ```bash artistools describe artistools check artistools plotlightcurves artistools plotspectra -t artistools plotestimators ``` -------------------------------- ### Write spectra as text Source: https://artis-mcrt.readthedocs.io/en/latest/analysis.html Write the spectra of each timestep as text files. ```bash artistools writespectra ``` -------------------------------- ### Create model folder and clone release branch Source: https://artis-mcrt.readthedocs.io/en/latest/clusters.html Sets up a new model folder, clones the ARTIS repository's release branch, copies the input template, and enters the artis subfolder. The source code and git metadata must be kept in the artis subfolder so the code finds its data files in artis/data. ```bash mkdir mymodel cd mymodel git clone --branch release https://github.com/artis-mcrt/artis.git cp artis/scripts/input-template.txt input.txt cd artis ``` -------------------------------- ### Build ARTIS with make Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Build the ARTIS executable after editing artisoptions.h. Run from the artis directory. ```bash make cd .. ``` -------------------------------- ### Check input with mpirun -c Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Run the input check. The standard output has 'input check: complete' when no error is found. ```bash mpirun -np 4 artis/sn3d -c ``` -------------------------------- ### Create model folder and download atomic data Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Run in a clone of the repository to create a new model folder with symlinks, then download and extract the FeCoNi atomic data archive. The archive holds Fe, Co, and Ni, so the model can hold only these elements; a cell with mass only in other elements becomes an empty cell. ```bash scripts/new-model-folder.sh --symlink ~/ownmodel cd ~/ownmodel curl -fLO https://github.com/artis-mcrt/artis/releases/download/v2026.5.15/atomicdata_feconi.tar.xz tar -xf atomicdata_feconi.tar.xz ``` -------------------------------- ### Build and run unit tests with make unittests Source: https://artis-mcrt.readthedocs.io/en/latest/testing.html Builds and runs the unit tests covering numeric/parsing helpers and physics functions like the Compton cross-section and Spencer-Fano triangular solve. CI runs them for the classic and NLTE nebular presets. ```bash make unittests && ./unittests ``` -------------------------------- ### Run make_model.py Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Run the script in the model folder to generate model.txt and abundances.txt. The script prints the total mass and Ni56 mass. ```bash python3 make_model.py ``` -------------------------------- ### Write model.txt and abundances.txt with make_model.py Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Place this script in the model folder as make_model.py. It writes model.txt and abundances.txt for a 1D model with an exponential density profile, 20 shells, and Ni56 inside a specified velocity. The script prints the total mass and Ni56 mass. ```python """Write model.txt and abundances.txt of a 1D model with an exponential density profile.""" import math from pathlib import Path MSUN = 1.989e33 # g DAY = 86400.0 # s KM = 1.0e5 # cm t_model_days = 1.0 ncells = 20 v_max_kms = 15000.0 v_scale_kms = 3000.0 # the e-folding velocity of the density mass_total_msun = 1.0 v_ni56_max_kms = 6000.0 # the Ni56 is inside this velocity x_ni56_inner = 0.7 t_model_s = t_model_days * DAY v_outer_kms = [v_max_kms * (i + 1) / ncells for i in range(ncells)] v_inner_kms = [0.0, *v_outer_kms[:-1]] # volume of each shell at t_model, and an unscaled density at the middle velocity of the shell volume_cm3 = [ 4.0 / 3.0 * math.pi * ((v_o * KM * t_model_s) ** 3 - (v_i * KM * t_model_s) ** 3) for v_i, v_o in zip(v_inner_kms, v_outer_kms, strict=True) ] rho_unscaled = [ math.exp(-0.5 * (v_i + v_o) / v_scale_kms) for v_i, v_o in zip(v_inner_kms, v_outer_kms, strict=True) ] # scale the density to the total mass mass_unscaled = sum(r * v for r, v in zip(rho_unscaled, volume_cm3, strict=True)) rho_g_cm3 = [r * mass_total_msun * MSUN / mass_unscaled for r in rho_unscaled] x_ni56 = [x_ni56_inner if v_o <= v_ni56_max_kms else 0.0 for v_o in v_outer_kms] with Path("model.txt").open("w", encoding="utf-8") as model_file: model_file.write(f"{ncells}\n{t_model_days}\n") model_file.write("#inputcellid vel_r_max_kmps logrho X_Fegroup X_Ni56 X_Co56 X_Fe52 X_Cr48\n") for cell_id in range(ncells): logrho = math.log10(rho_g_cm3[cell_id]) model_file.write(f"{cell_id} {v_outer_kms[cell_id]} {logrho:.6f} 1.0 {x_ni56[cell_id]} 0.0 0.0 0.0\n") with Path("abundances.txt").open("w", encoding="utf-8") as abundances_file: for cell_id in range(ncells): x_by_atomic_number = [0.0] * 28 # Z = 1 to 28 x_by_atomic_number[28 - 1] = x_ni56[cell_id] x_by_atomic_number[26 - 1] = 1.0 - x_ni56[cell_id] abundances_file.write(f"{cell_id} " + " ".join(str(x) for x in x_by_atomic_number) + "\n") mass_ni56_msun = sum( r * v * x for r, v, x in zip(rho_g_cm3, volume_cm3, x_ni56, strict=True) ) / MSUN print(f"total mass {mass_total_msun:.3f} Msun, Ni56 mass {mass_ni56_msun:.3f} Msun") ``` -------------------------------- ### Log output: atomic data summary Source: https://artis-mcrt.readthedocs.io/en/latest/planning.html Shown in the log after reading atomic data; lists total ions, levels, lines, and photoionisation transitions. ```text [info] in total 12 ions, 5263 levels (4262 ionising), 519292 lines, 14780 photoionisation transitions ``` -------------------------------- ### Symlink artisoptions.h to a preset Source: https://artis-mcrt.readthedocs.io/en/latest/troubleshooting.html The build requires an `artisoptions.h` in the repository root, which git does not track. Symlink a preset file to it, e.g. `artisoptions_classic.h`. ```bash ln -s artisoptions_classic.h artisoptions.h ``` -------------------------------- ### Create symlink to preset artisoptions.h Source: https://artis-mcrt.readthedocs.io/en/latest/presets.html Select a preset by symlinking it to artisoptions.h. The build requires this symlink; do not copy the preset because artisoptions.h is gitignored and the symlink keeps options correct when the preset changes. ```bash ln -s artisoptions_nltenebular.h artisoptions.h ``` -------------------------------- ### Edit input.txt simulation options Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Change these lines in input.txt to run the first four timesteps. tmin_days must be at or after the snapshot time of model.txt or the run stops. ```plaintext 20 # 1: ntimesteps ... 000 004 # 2: timestep_start timestep_finish ... 2 30 # 3: tmin_days tmax_days ... 3 # 18: num_lte_timesteps 3.0 3 # 19: optical_depth_is_thick num_grey_timesteps ``` -------------------------------- ### Select preset and set packet count Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Create a symlink to the nearest preset header and set NUM_PACKETS to 1e5 in artisoptions.h. The symlink means git restore artisoptions_classic.h removes the change. ```bash cd artis ln -sf artisoptions_classic.h artisoptions.h ``` -------------------------------- ### grep mem_usage output_0-0.txt Source: https://artis-mcrt.readthedocs.io/en/latest/planning.html Command to read the memory of packets and each large array from the rank 0 log. ```bash grep mem_usage output_0-0.txt ``` -------------------------------- ### Plot NLTE populations, radiation field, deposition, log files, core hours Source: https://artis-mcrt.readthedocs.io/en/latest/analysis.html Plot ion populations (requires NLTE levels), radiation field of a cell, deposition rates, rank timing, and core hours. ```bash artistools plotnltepops Fe --ion-stages 2 --cell -t ``` ```bash artistools plotradfield --cell -t ``` ```bash artistools deposition ``` ```bash artistools plotlogfiles ``` ```bash artistools corehours ``` -------------------------------- ### Plot light curves with filters and deposition Source: https://artis-mcrt.readthedocs.io/en/latest/analysis.html Plot bolometric light curve, light curves for specific filters (B V), or deposition of decay products (gamma betaplus). Each writes a PDF to the current folder. ```bash artistools plotlightcurves ``` ```bash artistools plotlightcurves --filter B V ``` ```bash artistools plotlightcurves --deposition gamma betaplus ``` -------------------------------- ### Log output: timestep completion and estimate Source: https://artis-mcrt.readthedocs.io/en/latest/planning.html Log line showing the time of each timestep and an estimate for remaining requested timesteps. ```text timestep 23 is complete (24 of 50 timesteps of the model) after 0.00 hours. If each timestep takes this time, the remaining 26 requested timesteps take 0.01 hours. ``` -------------------------------- ### Grep warnings from input check Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html Read warnings from the input check output. A run with Fe, Co, Ni data gives a warning comparing Co III ground term levels with photoionisation targets. ```bash grep warning inputcheck/output_0-0.txt ``` -------------------------------- ### Expected output of make_model.py Source: https://artis-mcrt.readthedocs.io/en/latest/ownmodel.html The script prints this line after running. The values show the total mass and Ni56 mass in solar masses. ```text total mass 1.000 Msun, Ni56 mass 0.260 Msun ``` -------------------------------- ### artistools corehours command Source: https://artis-mcrt.readthedocs.io/en/latest/planning.html Command to sum the core hours of all jobs in a model folder. ```bash artistools corehours ``` -------------------------------- ### Run exspec with mpirun Source: https://artis-mcrt.readthedocs.io/en/latest/exspec.html Run exspec in the model folder with any number of ranks from one up to the number of packet files. It reads the same input.txt, model, and atomic data files as sn3d, so it must run in the same folder. Rank 0 writes the log to exspec.txt. ```bash mpirun -np 8 artis/exspec ``` -------------------------------- ### Packet count and memory log output Source: https://artis-mcrt.readthedocs.io/en/latest/planning.html Shown in the log of each rank during a run. The number of packets and their memory usage are printed; the size of a packet depends on the build, so read the value from your own log. ```text Simulation propagates 2500000 packets on this rank (total 1e+07 with nprocs 4) [info] mem_usage: packets occupy 572.205 MB ``` -------------------------------- ### Log output: total NLTE levels Source: https://artis-mcrt.readthedocs.io/en/latest/planning.html Log line giving the sum of excited NLTE levels and superlevels over all ions. ```text [info] Total NLTE levels: 1008, of which 11 are superlevels ``` -------------------------------- ### NLEVELS_ADD_MISSING_COLLISIONAL_TRANSITIONS kilonova_lte preset Source: https://artis-mcrt.readthedocs.io/en/latest/options.html Adds 80 transitions for Fe (26) or Ni (28) with ionstage >= 1, otherwise 0, in the kilonova_lte preset. ```c { return ((element_z == 26 || element_z == 28) && ionstage >= 1) ? 80 : 0; } ``` -------------------------------- ### Plot spectra with various options Source: https://artis-mcrt.readthedocs.io/en/latest/analysis.html Plot spectrum at a time, by emission/absorption process, by element emission, or from packet files. `plotspectra` only accepts times within the arrival times range from `artistools check`. ```bash artistools plotspectra -t ``` ```bash artistools plotspectra -t --emissionabsorption ``` ```bash artistools plotspectra -t --showemission --groupby element ``` ```bash artistools plotspectra -t --frompackets ``` -------------------------------- ### Log output: core hours of the job Source: https://artis-mcrt.readthedocs.io/en/latest/planning.html Last line of the log giving the core hours of the job. ```text sn3d finished (job: pktprop ts 0 to ts 49 grid-preprop, 0.021 wallclock hours * 4 processes * 1 threads = 0.083 core hours) ``` -------------------------------- ### FORCE_SAHA_ION_BALANCE classic preset Source: https://artis-mcrt.readthedocs.io/en/latest/options.html Returns false for the classic preset, meaning Saha ionisation balance is not forced. ```c { return false; } ``` -------------------------------- ### ION_NLEVELS_EXCITED_NLTE classic preset Source: https://artis-mcrt.readthedocs.io/en/latest/options.html Returns 0 for the classic preset, meaning no excited levels in full NLTE. ```c { return 0; } ``` -------------------------------- ### FORCE_SAHA_ION_BALANCE kilonova_lte preset Source: https://artis-mcrt.readthedocs.io/en/latest/options.html Returns true for elements with atomic number less than 38 or greater than 40, forcing Saha balance for those elements in the kilonova_lte preset. ```c { return element_z < 38 || element_z > 40; } ``` -------------------------------- ### Direction-resolved results with --plotviewingangle Source: https://artis-mcrt.readthedocs.io/en/latest/analysis.html For 2D/3D models, each `--plotviewingangle` number selects one observer direction bin. `plotspherical` draws a direction map from escaped packets. ```bash artistools plotspectra -t --plotviewingangle 0 ``` ```bash artistools plotlightcurves --plotviewingangle 0 10 ``` ```bash artistools plotspherical ``` -------------------------------- ### ION_NLEVELS_EXCITED_NLTE nltenebular preset Source: https://artis-mcrt.readthedocs.io/en/latest/options.html Returns 197 for Fe II (element_z 26, ionstage 2) and 80 for other ions in the nltenebular preset. ```c { if (element_z == 26 && ionstage == 2) { return 197; } return 80; } ``` -------------------------------- ### Plot estimators for a cell or all cells Source: https://artis-mcrt.readthedocs.io/en/latest/analysis.html Plot an estimator (e.g., Te) against timestep for a specific cell, or plot estimators for all cells at a given time. ```bash artistools plotestimators Te -x timestep --cell ``` ```bash artistools plotestimators -t -p Te nne ``` -------------------------------- ### Edit and submit job script on Cosma8 Source: https://artis-mcrt.readthedocs.io/en/latest/clusters.html Edits the cluster-specific job script (e.g., rank count, account, email) and queues it with sbatch. On Cosma8, use this exact script name. ```bash vim artis/scripts/artis-cosma8.sh sbatch artis/scripts/artis-cosma8.sh ``` -------------------------------- ### Set sanitizer environment variables for TESTMODE=ON Source: https://artis-mcrt.readthedocs.io/en/latest/testing.html Required environment variables when running a build with TESTMODE=ON (sanitizers and extra assertions). The script sets these before running such a build. ```bash export ASAN_OPTIONS=detect_stack_use_after_return=1:detect_leaks=0 export OMPI_MCA_memory='^patcher' ``` -------------------------------- ### NLEVELS_ADD_MISSING_COLLISIONAL_TRANSITIONS nltephotospheric preset Source: https://artis-mcrt.readthedocs.io/en/latest/options.html Adds 100 transitions for elements with atomic number below 20 and 200 otherwise in the nltephotospheric preset. ```c { return (element_z < 20) ? 100 : 200; } ``` -------------------------------- ### ION_NLEVELS_EXCITED_NLTE nltephotospheric preset Source: https://artis-mcrt.readthedocs.io/en/latest/options.html Returns 100 for elements with atomic number below 20 and 200 otherwise in the nltephotospheric preset. ```c { if (element_z < 20) { return 100; } return 200; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.