Changeset 71b751d in sasmodels for sasmodels/models/parallelepiped.c
- Timestamp:
- Aug 14, 2018 12:09:34 PM (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/parallelepiped.c
rdbf1a60 r71b751d 6 6 7 7 8 static double 9 Iq(double q, 8 static void 9 Fq(double q, 10 double *F1, 11 double *F2, 10 12 double sld, 11 13 double solvent_sld, … … 21 23 22 24 // outer integral (with gauss points), integration limits = 0, 1 23 double outer_total =0; //initialize integral24 25 double outer_total_F1 = 0.0; //initialize integral 26 double outer_total_F2 = 0.0; //initialize integral 25 27 for( int i=0; i<GAUSS_N; i++) { 26 28 const double sigma = 0.5 * ( GAUSS_Z[i] + 1.0 ); … … 29 31 // inner integral (with gauss points), integration limits = 0, 1 30 32 // corresponding to angles from 0 to pi/2. 31 double inner_total = 0.0; 33 double inner_total_F1 = 0.0; 34 double inner_total_F2 = 0.0; 32 35 for(int j=0; j<GAUSS_N; j++) { 33 36 const double uu = 0.5 * ( GAUSS_Z[j] + 1.0 ); … … 36 39 const double si1 = sas_sinx_x(mu_proj * sin_uu * a_scaled); 37 40 const double si2 = sas_sinx_x(mu_proj * cos_uu); 38 inner_total += GAUSS_W[j] * square(si1 * si2); 41 const double fq = si1 * si2; 42 inner_total_F1 += GAUSS_W[j] * fq; 43 inner_total_F2 += GAUSS_W[j] * fq * fq; 39 44 } 40 45 // now complete change of inner integration variable (1-0)/(1-(-1))= 0.5 41 inner_total *= 0.5; 46 inner_total_F1 *= 0.5; 47 inner_total_F2 *= 0.5; 42 48 43 49 const double si = sas_sinx_x(mu * c_scaled * sigma); 44 outer_total += GAUSS_W[i] * inner_total * si * si; 50 outer_total_F1 += GAUSS_W[i] * inner_total_F1 * si; 51 outer_total_F2 += GAUSS_W[i] * inner_total_F2 * si * si; 45 52 } 46 53 // now complete change of outer integration variable (1-0)/(1-(-1))= 0.5 47 outer_total *= 0.5; 54 outer_total_F1 *= 0.5; 55 outer_total_F2 *= 0.5; 48 56 49 57 // Multiply by contrast^2 and convert from [1e-12 A-1] to [cm-1] 50 58 const double V = form_volume(length_a, length_b, length_c); 51 const double drho = (sld-solvent_sld); 52 return 1.0e-4 * square(drho * V) * outer_total; 59 const double contrast = (sld-solvent_sld); 60 const double s = contrast * V; 61 *F1 = 1.0e-2 * s * outer_total_F1; 62 *F2 = 1.0e-4 * s * s * outer_total_F2; 53 63 } 54 55 64 56 65 static double
Note: See TracChangeset
for help on using the changeset viewer.