Changeset d4c33d6 in sasmodels for sasmodels/kernel_iq.cl
- Timestamp:
- Apr 12, 2017 10:50:29 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 597878a
- Parents:
- 535fee6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_iq.cl
rbde38b5 rd4c33d6 25 25 int32_t num_weights; // total length of the weights vector 26 26 int32_t num_active; // number of non-trivial pd loops 27 int32_t theta_par; // id of spherical correction variable 27 int32_t theta_par; // id of spherical correction variable (not used) 28 28 } ProblemDetails; 29 29 … … 169 169 170 170 171 #if MAX_PD>0172 const int theta_par = details->theta_par;173 const bool fast_theta = (theta_par == p0);174 const bool slow_theta = (theta_par >= 0 && !fast_theta);175 double spherical_correction = 1.0;176 #else177 // Note: if not polydisperse the weights cancel and we don't need the178 // spherical correction.179 const double spherical_correction = 1.0;180 #endif181 182 171 int step = pd_start; 183 172 … … 217 206 #endif 218 207 #if MAX_PD>0 219 if (slow_theta) { // Theta is not in inner loop220 spherical_correction = fmax(fabs(cos(M_PI_180*local_values.vector[theta_par])), 1.e-6);221 }222 208 while(i0 < n0) { 223 209 local_values.vector[p0] = v0[i0]; 224 210 double weight0 = w0[i0] * weight1; 225 211 //if (q_index == 0) printf("step:%d level %d: p:%d i:%d n:%d value:%g weight:%g\n", step, 0, p0, i0, n0, local_values.vector[p0], weight0); 226 if (fast_theta) { // Theta is in inner loop227 spherical_correction = fmax(fabs(cos(M_PI_180*local_values.vector[p0])), 1.e-6);228 }229 212 #else 230 213 const double weight0 = 1.0; … … 232 215 233 216 //if (q_index == 0) {printf("step:%d of %d, pars:",step,pd_stop); for (int i=0; i < NUM_PARS; i++) printf("p%d=%g ",i, local_values.vector[i]); printf("\n"); } 234 //if (q_index == 0) printf("sphcor: %g\n", spherical_correction);235 217 236 218 #ifdef INVALID … … 241 223 // Note: weight==0 must always be excluded 242 224 if (weight0 > cutoff) { 243 // spherical correction is set at a minimum of 1e-6, otherwise there 244 // would be problems looking at models with theta=90. 245 const double weight = weight0 * spherical_correction; 246 pd_norm += weight * CALL_VOLUME(local_values.table); 225 pd_norm += weight0 * CALL_VOLUME(local_values.table); 247 226 248 227 #if defined(MAGNETIC) && NUM_MAGNETIC > 0 … … 296 275 const double scattering = CALL_IQ(q, q_index, local_values.table); 297 276 #endif // !MAGNETIC 298 this_result += weight * scattering;277 this_result += weight0 * scattering; 299 278 } 300 279 }
Note: See TracChangeset
for help on using the changeset viewer.