@@ -1648,7 +1648,7 @@ __device__ inline int launchnewphoton(MCXpos* p, MCXdir* v, Stokes* s, MCXtime*
16481648 ppath[2 ] = ((gcfg->srcnum > 1 ) ? ppath[2 ] : p->w ); // store initial weight
16491649 v->nscat = EPS;
16501650
1651- if (gcfg->outputtype == otRF || gcfg->outputtype == otRFmus) { // if run RF replay
1651+ if (gcfg->outputtype == otRF || gcfg->outputtype == otRFmus) { // if run RF replay
16521652 f->pathlen = photontof[(threadid * gcfg->threadphoton + min (threadid, gcfg->oddphotons - 1 ) + (int )f->ndone )];
16531653 sincosf (gcfg->omega * f->pathlen , ppath + 5 + gcfg->srcnum , ppath + 4 + gcfg->srcnum );
16541654 }
@@ -2007,7 +2007,7 @@ __global__ void mcx_main_loop(uint media[], OutputType field[], float genergy[],
20072007#endif
20082008 }
20092009
2010- if (gcfg->outputtype == otRFmus) {
2010+ if (gcfg->seed == SEED_FROM_FILE && gcfg-> outputtype == otRFmus) {
20112011 OutputType w_N_scatt = replayweight[(idx * gcfg->threadphoton + min (idx, gcfg->oddphotons - 1 ) + (int )f.ndone )];
20122012 OutputType cos_omega_t = ppath[gcfg->w0offset + gcfg->srcnum ];
20132013 OutputType sin_omega_t = ppath[gcfg->w0offset + gcfg->srcnum + 1 ];
@@ -2880,9 +2880,9 @@ void mcx_run_simulation(Config* cfg, GPUInfo* gpu) {
28802880 {
28812881 if (cfg->exportfield == NULL && cfg->issave2pt ) {
28822882 if (cfg->seed == SEED_FROM_FILE && cfg->replaydet == -1 ) {
2883- cfg->exportfield = (float *)calloc (sizeof (float ) * dimxyz, gpu[gpuid].maxgate * (1 + (cfg->outputtype == otRF)) * cfg->detnum );
2883+ cfg->exportfield = (float *)calloc (sizeof (float ) * dimxyz, gpu[gpuid].maxgate * (1 + (cfg->outputtype == otRF || cfg-> outputtype == otRFmus )) * cfg->detnum );
28842884 } else {
2885- cfg->exportfield = (float *)calloc (sizeof (float ) * dimxyz, gpu[gpuid].maxgate * (1 + (cfg->outputtype == otRF)));
2885+ cfg->exportfield = (float *)calloc (sizeof (float ) * dimxyz, gpu[gpuid].maxgate * (1 + (cfg->outputtype == otRF || cfg-> outputtype == otRFmus )));
28862886 }
28872887 }
28882888
@@ -3302,7 +3302,7 @@ void mcx_run_simulation(Config* cfg, GPUInfo* gpu) {
33023302 *
33033303 * The calculation of the energy conservation will only reflect the last simulation.
33043304 */
3305- sharedbuf = (param.nphaselen + param.nanglelen ) * sizeof (float ) + gpu[gpuid].autoblock * (cfg->issaveseed * (RAND_BUF_LEN * sizeof (RandType)) + sizeof (float ) * (param.w0offset + cfg->srcnum + 2 * (cfg->outputtype == otRF)));
3305+ sharedbuf = (param.nphaselen + param.nanglelen ) * sizeof (float ) + gpu[gpuid].autoblock * (cfg->issaveseed * (RAND_BUF_LEN * sizeof (RandType)) + sizeof (float ) * (param.w0offset + cfg->srcnum + 2 * (cfg->outputtype == otRF || cfg-> outputtype == otRFmus )));
33063306
33073307 MCX_FPRINTF (cfg->flog , " requesting %d bytes of shared memory\n " , sharedbuf);
33083308
@@ -3656,14 +3656,14 @@ is more than what your have specified (%d), please use the -H option to specify
36563656 field[i] = rawfield[i];
36573657#ifndef USE_DOUBLE
36583658
3659- if (cfg->outputtype != otRF) {
3659+ if (cfg->outputtype != otRF && cfg-> outputtype != otRFmus ) {
36603660 field[i] += rawfield[i + fieldlen];
36613661 }
36623662
36633663#endif
36643664 }
36653665
3666- if (cfg->outputtype == otRF && cfg->omega > 0 .f && SHADOWCOUNT == 2 ) {
3666+ if (( cfg->outputtype == otRF || cfg-> outputtype == otRFmus) && cfg->omega > 0 .f && SHADOWCOUNT == 2 ) {
36673667 rfimag = (OutputType*)malloc (fieldlen * sizeof (OutputType));
36683668 memcpy (rfimag, rawfield + fieldlen, fieldlen * sizeof (OutputType));
36693669 }
@@ -3720,7 +3720,7 @@ is more than what your have specified (%d), please use the -H option to specify
37203720 #pragma omp atomic
37213721 cfg->exportfield [i] += field[i];
37223722
3723- if (cfg->outputtype == otRF && rfimag) {
3723+ if (( cfg->outputtype == otRF || cfg-> outputtype == otRFmus) && rfimag) {
37243724 for (i = 0 ; i < fieldlen; i++)
37253725 #pragma omp atomic
37263726 cfg->exportfield [i + fieldlen] += rfimag[i];
@@ -3807,7 +3807,7 @@ is more than what your have specified (%d), please use the -H option to specify
38073807 }
38083808 } else if (cfg->outputtype == otEnergy || cfg->outputtype == otL) { /* * If output is energy (joule), raw data is simply multiplied by 1/Nphoton */
38093809 scale[0 ] = 1 .f / cfg->energytot ;
3810- } else if (cfg->outputtype == otJacobian || cfg->outputtype == otWP || cfg->outputtype == otDCS || cfg->outputtype == otRF) {
3810+ } else if (cfg->outputtype == otJacobian || cfg->outputtype == otWP || cfg->outputtype == otDCS || cfg->outputtype == otRF || cfg-> outputtype == otRFmus ) {
38113811 if (cfg->seed == SEED_FROM_FILE && cfg->replaydet == -1 ) {
38123812 int detid;
38133813
@@ -3831,7 +3831,7 @@ is more than what your have specified (%d), please use the -H option to specify
38313831 fflush (cfg->flog );
38323832 mcx_normalize (cfg->exportfield + (detid - 1 )*dimxyz * gpu[gpuid].maxgate , scale[0 ], dimxyz * gpu[gpuid].maxgate , cfg->isnormalized , 0 , 1 );
38333833
3834- if (cfg->outputtype == otRF) {
3834+ if (cfg->outputtype == otRF || cfg-> outputtype == otRFmus ) {
38353835 mcx_normalize (cfg->exportfield + fieldlen + (detid - 1 )*dimxyz * gpu[gpuid].maxgate , scale[0 ], dimxyz * gpu[gpuid].maxgate , cfg->isnormalized , 0 , 1 );
38363836 }
38373837 }
@@ -3880,7 +3880,7 @@ is more than what your have specified (%d), please use the -H option to specify
38803880 for (i = 0 ; i < (int )cfg->srcnum ; i++) {
38813881 MCX_FPRINTF (cfg->flog , " source %d, normalization factor alpha=%f\n " , (i + 1 ), scale[i]);
38823882 fflush (cfg->flog );
3883- mcx_normalize (cfg->exportfield , scale[i], fieldlen / cfg->srcnum * ((cfg->outputtype == otRF) + 1 ), cfg->isnormalized , i, cfg->srcnum );
3883+ mcx_normalize (cfg->exportfield , scale[i], fieldlen / cfg->srcnum * ((cfg->outputtype == otRF || cfg-> outputtype == otRFmus ) + 1 ), cfg->isnormalized , i, cfg->srcnum );
38843884 }
38853885 }
38863886
0 commit comments