From f959c71f6d0ba6471a15a6fd016480fd4b5efd29 Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Sat, 22 Jun 2024 15:23:34 -0400 Subject: [PATCH] [bug] store reflection position in trajectory --- src/mcx_core.cu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mcx_core.cu b/src/mcx_core.cu index 6869fab8..9421ec27 100644 --- a/src/mcx_core.cu +++ b/src/mcx_core.cu @@ -2368,6 +2368,14 @@ __global__ void mcx_main_loop(uint media[], OutputType field[], float genergy[], GPUDEBUG(("Rtotal=%f\n", Rtotal)); } //< else, total internal reflection + if (gcfg->debuglevel & (MCX_DEBUG_MOVE | MCX_DEBUG_MOVE_ONLY)) { + if (ispolarized && gcfg->istrajstokes) { + savedebugstokes(&p, &s, (uint)f.ndone + idx * gcfg->threadphoton + umin(idx, gcfg->oddphotons), gdebugdata, (int)ppath[gcfg->w0offset - 1]); + } else { + savedebugdata(&p, (uint)f.ndone + idx * gcfg->threadphoton + umin(idx, gcfg->oddphotons), gdebugdata, (int)ppath[gcfg->w0offset - 1]); + } + } + if (Rtotal < 1.f // if total internal reflection does not happen && (!(mediaid == 0 && ((isdet & 0xF) == bcMirror))) // if out of bbx and cfg.bc is not 'm' && rand_next_reflect(t) > Rtotal) { // and if photon chooses the transmission path, then do transmission