This repository contains work related to projects in the course AST3310 at UiO. The course is organized in projects, but these are sequential and therefore presented as one repository. To see the state of the code as of completion of separate projects, tags exists for the relevant commits.
The final goal (now completed) is the have a working numerical model of a star, able to produce any relevant quantity as a function of its radius, given a set of initial conditions. Project 1 sets up the framework for computing the energy production at any point in the star, given a density, temperature and mass fractions for all the different types of particles present. In project 2, a model of the inner radiative core of a star is developed, and project 3 expands the model to include the outer convection zone.
$ cd report && make
The main body of the code base is written in C++, with plotting and other data processing done in Python. All of the latter is placed in the python/ folder.
The program itself is built around the main integrator method that solves the governing equations of a star. In order to do this, there are functions and data structures for computing densities, pressures, energy production etc. The latter is the most complex function, making use of several tabulated functions, reaction energies and particle types. The best way to get an overview of the code quickly, would be to sift through the include/ folder.
If you prefer, a HTML-version of the code documentation can be generated:
$ make doc
Then just open the file
build/html/index.html in a browser.
To build the sources you can use the supplied CMakeLists.txt file.
$ mkdir build && cd build $ cmake [-Ddebug=ON/OFF -Dcoverage=ON/OFF] .. # ".." is path to CMakeLists.txt $ make
The options to
cmake are optional, and defaults to using debugging (compiles with
This will produce executables for every file in app/, as well
as a test executable
unit_tests.x from tests/main.cpp.
$ sudo apt-get install liblapack-dev libblas-dev libboost-dev $ # use apt-get (version might not be recent enough) $ sudo apt-get install libarmadillo-dev $ # or, if apt-get version is not recent enough $ wget http://sourceforge.net/projects/arma/files/armadillo-6.600.4.tar.gz $ tar xf armadillo-6.600.4.tar.gz $ cd armadillo-6.600.4 && cmake . && make && sudo make install && cd -