Changeset 71b751d in sasmodels for sasmodels/models/barbell.c
- Timestamp:
- Aug 14, 2018 10:09:34 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 86aa992
- Parents:
- 2f8cbb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/barbell.c
r108e70e r71b751d 62 62 } 63 63 64 static double65 Iq(double q, double sld, double solvent_sld,64 static void 65 Fq(double q,double *F1, double *F2, double sld, double solvent_sld, 66 66 double radius_bell, double radius, double length) 67 67 { … … 72 72 const double zm = M_PI_4; 73 73 const double zb = M_PI_4; 74 double total = 0.0; 74 double total_F1 = 0.0; 75 double total_F2 = 0.0; 75 76 for (int i = 0; i < GAUSS_N; i++){ 76 77 const double alpha= GAUSS_Z[i]*zm + zb; … … 78 79 SINCOS(alpha, sin_alpha, cos_alpha); 79 80 const double Aq = _fq(q*sin_alpha, q*cos_alpha, h, radius_bell, radius, half_length); 80 total += GAUSS_W[i] * Aq * Aq * sin_alpha; 81 total_F1 += GAUSS_W[i] * Aq * sin_alpha; 82 total_F2 += GAUSS_W[i] * Aq * Aq * sin_alpha; 81 83 } 82 84 // translate dx in [-1,1] to dx in [lower,upper] 83 const double form = total*zm; 85 const double form_avg = total_F1*zm; 86 const double form_squared_avg = total_F2*zm; 84 87 85 88 //Contrast 86 89 const double s = (sld - solvent_sld); 87 return 1.0e-4 * s * s * form; 90 *F1 = 1.0e-2 * s * form_avg; 91 *F2 = 1.0e-4 * s * s * form_squared_avg; 88 92 } 89 90 93 91 94 static double
Note: See TracChangeset
for help on using the changeset viewer.