Changeset 71b751d in sasmodels for sasmodels/models/core_shell_bicelle_elliptical.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/core_shell_bicelle_elliptical.c
r108e70e r71b751d 10 10 } 11 11 12 static double 13 Iq(double q, 12 static void 13 Fq(double q, 14 double *F1, 15 double *F2, 14 16 double r_minor, 15 17 double x_core, … … 36 38 37 39 //initialize integral 38 double outer_sum = 0.0; 40 double outer_total_F1 = 0.0; 41 double outer_total_F2 = 0.0; 39 42 for(int i=0;i<GAUSS_N;i++) { 40 43 //setup inner integral over the ellipsoidal cross-section 41 //const double va = 0.0;42 //const double vb = 1.0;43 44 //const double cos_theta = ( GAUSS_Z[i]*(vb-va) + va + vb )/2.0; 44 45 const double cos_theta = ( GAUSS_Z[i] + 1.0 )/2.0; … … 48 49 const double si1 = sas_sinx_x(halfheight*qc); 49 50 const double si2 = sas_sinx_x((halfheight+thick_face)*qc); 50 double inner_sum=0.0; 51 double inner_total_F1 = 0; 52 double inner_total_F2 = 0; 51 53 for(int j=0;j<GAUSS_N;j++) { 52 54 //76 gauss points for the inner integral (WAS 20 points,so this may make unecessarily slow, but playing safe) 53 // inner integral limits 54 //const double vaj=0.0; 55 //const double vbj=M_PI; 56 //const double phi = ( GAUSS_Z[j]*(vbj-vaj) + vaj + vbj )/2.0; 57 const double phi = ( GAUSS_Z[j] +1.0)*M_PI_2; 58 const double rr = sqrt(r2A - r2B*cos(phi)); 55 //const double beta = ( GAUSS_Z[j]*(vbj-vaj) + vaj + vbj )/2.0; 56 const double beta = ( GAUSS_Z[j] +1.0)*M_PI_2; 57 const double rr = sqrt(r2A - r2B*cos(beta)); 59 58 const double be1 = sas_2J1x_x(rr*qab); 60 59 const double be2 = sas_2J1x_x((rr+thick_rim)*qab); 61 const double f q= dr1*si1*be1 + dr2*si2*be2 + dr3*si2*be1;60 const double f = dr1*si1*be1 + dr2*si2*be2 + dr3*si2*be1; 62 61 63 inner_sum += GAUSS_W[j] * fq * fq; 62 inner_total_F1 += GAUSS_W[j] * f; 63 inner_total_F2 += GAUSS_W[j] * f * f; 64 64 } 65 65 //now calculate outer integral 66 outer_sum += GAUSS_W[i] * inner_sum; 66 outer_total_F1 += GAUSS_W[i] * inner_total_F1; 67 outer_total_F2 += GAUSS_W[i] * inner_total_F2; 67 68 } 69 // now complete change of integration variables (1-0)/(1-(-1))= 0.5 70 outer_total_F1 *= 0.25; 71 outer_total_F2 *= 0.25; 68 72 69 return outer_sum*2.5e-05; 73 //convert from [1e-12 A-1] to [cm-1] 74 *F1 = 1e-2*outer_total_F1; 75 *F2 = 1e-4*outer_total_F2; 70 76 } 71 77
Note: See TracChangeset
for help on using the changeset viewer.