Skip to content

AstroBarker/sitar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. First three ionization levels of Calcium

Building

To build Sitar, simply

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) and ruff (here) 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.

About

simple Saha ionization solver written in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published