MC2D.hpp & MC3D.hpp: The bug only affects situations where there are non-scattering and scattering medium.
Transmission test from non-scattering medium to scattering medium (if statement following comment "Test transmission from vacuum -> scattering media") should mostlikely be shifted down after comment "Upgrade remaining photon propagation lenght in case it is transmitted to different mus domain".
Otherwise the first test will draw a finite value for 'prop' and the latter test will change it to zero. In the next loop over 'while(1){}' variable 'ds' will end being zero and photon position will not get updated. 'WhichFace' will have changed values of photon structure under assumption that the photon will actually propagate. This will end up screwing up tracking of the photon and will end up in tears.
Similarly, there doesn't seem to be any checks to prevent divisions by zero when calculating the propagation length in case there's a mus=0 medium somewhere.
MC2D.hpp & MC3D.hpp: The bug only affects situations where there are non-scattering and scattering medium.
Transmission test from non-scattering medium to scattering medium (if statement following comment "Test transmission from vacuum -> scattering media") should most likely be shifted down after comment "Upgrade remaining photon propagation lenght in case it is transmitted to different mus domain".
Otherwise the first test will draw a finite value for 'prop' and the latter test will change it to zero. In the next loop over 'while(1){}' variable 'ds' will end being zero and photon position will not get updated. 'WhichFace' will have changed values of photon structure under assumption that the photon will actually propagate. This will end up screwing up tracking of the photon and will end up in tears.