| 9 |
|
|
| 10 |
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
| 11 |
|
(c) Fraunhofer Institute for Solar Energy Systems, |
| 12 |
+ |
supported by the German Research Foundation (DFG) |
| 13 |
+ |
under the FARESYS project. |
| 14 |
|
(c) Lucerne University of Applied Sciences and Arts, |
| 15 |
< |
supported by the Swiss National Science Foundation (SNSF, #147053) |
| 15 |
> |
supported by the Swiss National Science Foundation (SNSF #147053). |
| 16 |
> |
(c) Tokyo University of Science, |
| 17 |
> |
supported by the JSPS KAKENHI Grant Number JP19KK0115. |
| 18 |
|
====================================================================== |
| 19 |
|
|
| 20 |
|
$Id$ |
| 274 |
|
#ifdef PMAP_OOC |
| 275 |
|
/* Open leaf file with filename derived from pmap, replace pmapFile |
| 276 |
|
* (which is currently the node file) */ |
| 277 |
< |
strncpy(leafFname, argv [arg], 1024); |
| 278 |
< |
strncat(leafFname, PMAP_OOC_LEAFSUFFIX, 1024); |
| 277 |
> |
strncpy(leafFname, argv [arg], sizeof(leafFname) - 1); |
| 278 |
> |
strncat(leafFname, PMAP_OOC_LEAFSUFFIX, sizeof(leafFname) - 1); |
| 279 |
|
fclose(pmapFile); |
| 280 |
|
if (!(pmapFile = fopen(leafFname, "rb"))) { |
| 281 |
|
sprintf(errmsg, "cannot open leaf file %s", leafFname); |
| 309 |
|
for (j = 0; j < 4; j++) |
| 310 |
|
p.flux [j] = getint(1, pmapFile); |
| 311 |
|
#endif |
| 312 |
+ |
|
| 313 |
+ |
|
| 314 |
|
|
| 315 |
|
/* Skip primary ray index */ |
| 316 |
|
getint(sizeof(p.primary), pmapFile); |
| 321 |
|
|
| 322 |
|
/* Dump photon probabilistically acc. to target sphere count */ |
| 323 |
|
if (frandom() <= dumpRatio) { |
| 324 |
< |
if (fluxCol) |
| 324 |
> |
if (fluxCol) { |
| 325 |
|
/* Get photon flux */ |
| 326 |
|
getPhotonFlux(&p, col); |
| 327 |
+ |
/* Scale by dumpRatio for energy conservation */ |
| 328 |
+ |
scalecolor(col, 1.0 / dumpRatio); |
| 329 |
+ |
} |
| 330 |
|
|
| 331 |
|
if (!points) { |
| 332 |
|
if (fluxCol) { |