Cleanup of C++ core codebase
Created by: paulromano
After #1171 is merged, we no longer have any Fortran code in OpenMC. However, there are still some things that need cleaning up on the C++ side. I wanted to open this issue to keep track of them:
-
Fix off-by-one indexing. Much of the C API still expects indices based on 1-indexing instead of 0-indexing. As a result, there is a whole bunch of
-1
and+1
s scattered through the code. We should consistently use 0-indexing now that there is no Fortran. -
Replace
xyz
anduvw
with thePosition
andDirection
classes (mostly as part of theParticle
class) -
The
Particle::initialize
method should probably be part of a constructor? -
See if we can get rid of
MAXCOORD
andMAX_SECONDARY
? - Use the GSL library for spans (to replace pointer/length pairs in interfaces) and asserts
-
Use trailing underscore for class data members consistently (especially
Particle
) -
Use
enum class
where it makes sense -
Use
unique_ptr
instead of raw pointers in global vectors
If any of you guys have other things in mind that I'm missing, feel free to add to the list.