https://github.com/astrobarker/sitar
simple Saha ionization solver written in C++
https://github.com/astrobarker/sitar
Last synced: over 1 year ago
JSON representation
simple Saha ionization solver written in C++
- Host: GitHub
- URL: https://github.com/astrobarker/sitar
- Owner: AstroBarker
- License: gpl-3.0
- Created: 2023-01-19T22:37:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-30T13:47:31.000Z (almost 2 years ago)
- Last Synced: 2025-02-04T10:56:39.701Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 353 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sitar
SIngle isoTope sAha solveR. Also a stringed instrument from the Indian subcontinent.
a Saha ionization solver
The figure below shows ionization fractions for unionized, singly, and doubly ionized Calcium.
Compare to Figure 2.6 of "Supernovae and Nucleosynthesis", David Arnett.

## Building
To build `Sitar`, simply
```sh
mkdir build && cd build
cmake ..
make -j
```
Then an executable `saha` will be created in `build/src`.
An observation: a Saha solver requires an iterative solver, such as Newton-Raphson.
Implementing Anderson accelerated Newton-Raphson provides a roughly 4x speedup for the calculations above.
## Testing
Compilation and regression tests are run on each PR.
## Code Style
We use `clang format` ([here](https://clang.llvm.org/docs/ClangFormat.html))
and `ruff` ([here](https://docs.astral.sh/ruff/linter/)) for code cleanliness.
C++ rules are listed in `.clang-format`.
The current version of `clang-format` used is 19.1.0.
Simply call `tools/bash/format.sh` to format the `.hpp` and `.cpp` files.
Python code linting and formatting is done with `ruff`.
Rules are listed in `ruff.toml`.
To check all python in the current directory, you may `ruff .`
To format a given file according to `ruff.toml`, run `ruff format file.py`.
Checks for formatting are performed on each PR.