Changeset 71b751d in sasmodels for sasmodels/models/core_shell_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/core_shell_parallelepiped.c
rdbf1a60 r71b751d 27 27 } 28 28 29 static double 30 Iq(double q, 29 static void 30 Fq(double q, 31 double *F1, 32 double *F2, 31 33 double core_sld, 32 34 double arim_sld, … … 60 62 // outer integral (with gauss points), integration limits = 0, 1 61 63 // substitute d_cos_alpha for sin_alpha d_alpha 62 double outer_sum = 0; //initialize integral 64 double outer_sum_F1 = 0; //initialize integral 65 double outer_sum_F2 = 0; //initialize integral 63 66 for( int i=0; i<GAUSS_N; i++) { 64 67 const double cos_alpha = 0.5 * ( GAUSS_Z[i] + 1.0 ); … … 69 72 // inner integral (with gauss points), integration limits = 0, 1 70 73 // substitute beta = PI/2 u (so 2/PI * d_(PI/2 * beta) = d_beta) 71 double inner_sum = 0.0; 74 double inner_sum_F1 = 0.0; 75 double inner_sum_F2 = 0.0; 72 76 for(int j=0; j<GAUSS_N; j++) { 73 77 const double u = 0.5 * ( GAUSS_Z[j] + 1.0 ); … … 91 95 #endif 92 96 93 inner_sum += GAUSS_W[j] * f * f; 97 inner_sum_F1 += GAUSS_W[j] * f; 98 inner_sum_F2 += GAUSS_W[j] * f * f; 94 99 } 95 100 // now complete change of inner integration variable (1-0)/(1-(-1))= 0.5 96 inner_sum *= 0.5;97 // now sum up the outer integral98 outer_sum += GAUSS_W[i] * inner_sum;101 // and sum up the outer integral 102 outer_sum_F1 += GAUSS_W[i] * inner_sum_F1 * 0.5; 103 outer_sum_F2 += GAUSS_W[i] * inner_sum_F2 * 0.5; 99 104 } 100 105 // now complete change of outer integration variable (1-0)/(1-(-1))= 0.5 101 outer_sum *= 0.5; 106 outer_sum_F1 *= 0.5; 107 outer_sum_F2 *= 0.5; 102 108 103 109 //convert from [1e-12 A-1] to [cm-1] 104 return 1.0e-4 * outer_sum; 110 *F1 = 1.0e-2 * outer_sum_F1; 111 *F2 = 1.0e-4 * outer_sum_F2; 105 112 } 106 113
Note: See TracChangeset
for help on using the changeset viewer.