HLLD Implementation 2

HLLD Implementation

After finishign the HLLD solver through the L/R states last week I spent this week implementing the star and double star states. I used a similar pattern to the L/R states. This first draft of the HLLD solver is rough. It’s about 1000 lines, around half of which are just function definitions and calls. Each step requires so many different variables that the functions have dozens of arguments; this really bites into readability. I’m considering replacing a lot of it with some structs, arrays, or file scope variables but I want to get it tested and working first. Also, however I end up refactoring it I will need to take performance into great consideration and profiling can only be done one I have an HLLD solver that produces correct output.

I’m also not 100% sure about my implementation of passive scalars and dual energy. That is something I will need to thoroughly test.


  • Finished my application to the 2022 Internation HPC Summer School and submitted it.

Original HLLD paper: Miyoshi & Kusano 2005

Blog post on the HLLD Algorithm: HLLD Algorithm

This post is licensed under CC BY 4.0 by the author.