MatthewGrim / CFD_Codes

4 stars 4 forks source link

Add profiling to Riemann solver code #27

Closed MatthewGrim closed 5 years ago

MatthewGrim commented 5 years ago

This issue documents the addition of a simple profiling tool to the Riemann solver code, to see if I can optimise the python version a little, by using cython or numba.

MatthewGrim commented 5 years ago

Having profiled the code, it's clear that the implementation is slow because operations across the grid are done using indexing. This would be better if we could do grid based operations, but is hard to do for the exact riemann solver scheme.

There's not much point in optimising this implementation, so it is probably best to move straight to the C++ implementation I already have. The best approach would be to wrap this C++ to python if I want a nicer, more adaptable interface. In reality, this is not really necessary, given these codes are more of a numerical exercise.