Changeset 71b751d in sasmodels for sasmodels/models/capped_cylinder.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/capped_cylinder.c
r108e70e r71b751d 84 84 } 85 85 86 static double87 Iq(double q, double sld, double solvent_sld,86 static void 87 Fq(double q,double *F1, double *F2, double sld, double solvent_sld, 88 88 double radius, double radius_cap, double length) 89 89 { … … 94 94 const double zm = M_PI_4; 95 95 const double zb = M_PI_4; 96 double total = 0.0; 96 double total_F1 = 0.0; 97 double total_F2 = 0.0; 97 98 for (int i=0; i<GAUSS_N ;i++) { 98 99 const double theta = GAUSS_Z[i]*zm + zb; … … 103 104 const double Aq = _fq(qab, qc, h, radius_cap, radius, half_length); 104 105 // scale by sin_theta for spherical coord integration 105 total += GAUSS_W[i] * Aq * Aq * sin_theta; 106 total_F1 += GAUSS_W[i] * Aq * sin_theta; 107 total_F2 += GAUSS_W[i] * Aq * Aq * sin_theta; 106 108 } 107 109 // translate dx in [-1,1] to dx in [lower,upper] 108 const double form = total * zm; 110 const double form_avg = total_F1 * zm; 111 const double form_squared_avg = total_F2 * zm; 109 112 110 113 // Contrast 111 114 const double s = (sld - solvent_sld); 112 return 1.0e-4 * s * s * form; 115 *F1 = 1.0e-2 * s * form_avg; 116 *F2 = 1.0e-4 * s * s * form_squared_avg; 113 117 } 114 118
Note: See TracChangeset
for help on using the changeset viewer.