4 |
|
|
5 |
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
6 |
|
(c) Fraunhofer Institute for Solar Energy Systems, |
7 |
< |
Lucerne University of Applied Sciences & Arts |
7 |
> |
(c) Lucerne University of Applied Sciences and Arts, |
8 |
> |
supported by the Swiss National Science Foundation (SNSF, #147053) |
9 |
|
================================================================== |
10 |
|
|
11 |
|
$Id$ |
47 |
|
if (!emap -> partitions) |
48 |
|
error(USER, "can't allocate source partitions"); |
49 |
|
|
50 |
< |
bzero(emap -> partitions + (emap -> maxPartitions >> 2), |
51 |
< |
emap -> maxPartitions >> 2); |
50 |
> |
memset(emap -> partitions + (emap -> maxPartitions >> 2), 0, |
51 |
> |
emap -> maxPartitions >> 2); |
52 |
|
} |
53 |
|
|
54 |
|
if (du2 * dv2 <= 1) { /* hit limit? */ |
101 |
|
RREAL *vp; |
102 |
|
double du2, dv2; |
103 |
|
|
104 |
< |
bzero(emap -> partitions, emap -> maxPartitions >> 1); |
104 |
> |
memset(emap -> partitions, 0, emap -> maxPartitions >> 1); |
105 |
|
emap -> partArea = srcsizerat * thescene.cusize; |
106 |
|
emap -> partArea *= emap -> partArea; |
107 |
|
vp = emap -> src -> ss [SU]; |
133 |
|
|
134 |
|
else { |
135 |
|
/* No photon ports defined, so partition scene cube faces */ |
136 |
< |
bzero(emap -> partitions, emap -> maxPartitions >> 1); |
136 |
> |
memset(emap -> partitions, 0, emap -> maxPartitions >> 1); |
137 |
|
setpart(emap -> partitions, 0, S0); |
138 |
|
emap -> partitionCnt = 0; |
139 |
|
emap -> numPartitions = 1 / srcsizerat; |
151 |
|
{ |
152 |
|
unsigned numTheta, numPhi; |
153 |
|
|
154 |
< |
bzero(emap -> partitions, emap -> maxPartitions >> 1); |
154 |
> |
memset(emap -> partitions, 0, emap -> maxPartitions >> 1); |
155 |
|
setpart(emap -> partitions, 0, S0); |
156 |
|
emap -> partArea = 4 * PI * sqr(emap -> src -> srad); |
157 |
|
emap -> numPartitions = emap -> partArea / |
181 |
|
emap -> maxPartitions >> 1); |
182 |
|
if (!emap -> partitions) |
183 |
|
error(USER, "can't allocate source partitions"); |
184 |
< |
bzero(emap -> partitions + (emap -> maxPartitions >> 2), |
184 |
> |
|
185 |
> |
memset(emap -> partitions + (emap -> maxPartitions >> 2), 0, |
186 |
|
emap -> maxPartitions >> 2); |
187 |
|
} |
188 |
|
|
224 |
|
{ |
225 |
|
double d2; |
226 |
|
|
227 |
< |
bzero(emap -> partitions, emap -> maxPartitions >> 1); |
227 |
> |
memset(emap -> partitions, 0, emap -> maxPartitions >> 1); |
228 |
|
d2 = srcsizerat * thescene.cusize; |
229 |
|
d2 = PI * emap -> src -> ss2 / (2 * emap -> src -> srad * sqr(d2)); |
230 |
|
d2 *= d2 * DOT(emap -> src -> ss [SU], emap -> src -> ss [SU]); |