Changeset b260926 in sasmodels
 Timestamp:
 Mar 22, 2017 9:29:03 PM (2 years ago)
 Branches:
 master, core_shell_microgels, costrafo411, magnetic_model, ticket1257vesicleproduct, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
 Children:
 f4f85b3
 Parents:
 50beefe
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sasmodels/models/core_shell_bicelle.c
r592343f rb260926 30 30 31 31 static double 32 bicelle_kernel(double q q,32 bicelle_kernel(double q, 33 33 double rad, 34 34 double radthick, 35 35 double facthick, 36 double length,36 double halflength, 37 37 double rhoc, 38 38 double rhoh, … … 42 42 double cos_alpha) 43 43 { 44 double si1,si2,be1,be2;45 46 44 const double dr1 = rhocrhoh; 47 45 const double dr2 = rhorrhosolv; 48 46 const double dr3 = rhohrhor; 49 const double vol1 = M_PI*rad*rad*(2.0*length); 50 const double vol2 = M_PI*(rad+radthick)*(rad+radthick)*2.0*(length+facthick); 51 const double vol3 = M_PI*rad*rad*2.0*(length+facthick); 52 double besarg1 = qq*rad*sin_alpha; 53 double besarg2 = qq*(rad+radthick)*sin_alpha; 54 double sinarg1 = qq*length*cos_alpha; 55 double sinarg2 = qq*(length+facthick)*cos_alpha; 47 const double vol1 = M_PI*square(rad)*2.0*(halflength); 48 const double vol2 = M_PI*square(rad+radthick)*2.0*(halflength+facthick); 49 const double vol3 = M_PI*square(rad)*2.0*(halflength+facthick); 56 50 57 be1 = sas_2J1x_x(besarg1);58 be2 = sas_2J1x_x(besarg2);59 si1 = sas_sinx_x(sinarg1);60 si2 = sas_sinx_x(sinarg2);51 const double be1 = sas_2J1x_x(q*(rad)*sin_alpha); 52 const double be2 = sas_2J1x_x(q*(rad+radthick)*sin_alpha); 53 const double si1 = sas_sinx_x(q*(halflength)*cos_alpha); 54 const double si2 = sas_sinx_x(q*(halflength+facthick)*cos_alpha); 61 55 62 56 const double t = vol1*dr1*si1*be1 + … … 64 58 vol3*dr3*si2*be1; 65 59 66 const double retval = t*t *sin_alpha;60 const double retval = t*t; 67 61 68 62 return retval; … … 71 65 72 66 static double 73 bicelle_integration(double q q,67 bicelle_integration(double q, 74 68 double rad, 75 69 double radthick, … … 83 77 // set up the integration end points 84 78 const double uplim = M_PI_4; 85 const double half height= 0.5*length;79 const double halflength = 0.5*length; 86 80 87 81 double summ = 0.0; … … 90 84 double sin_alpha, cos_alpha; // slots to hold sincos function output 91 85 SINCOS(alpha, sin_alpha, cos_alpha); 92 double yyy = Gauss76Wt[i] * bicelle_kernel(q q, rad, radthick, facthick,93 half height, rhoc, rhoh, rhor, rhosolv,86 double yyy = Gauss76Wt[i] * bicelle_kernel(q, rad, radthick, facthick, 87 halflength, rhoc, rhoh, rhor, rhosolv, 94 88 sin_alpha, cos_alpha); 95 summ += yyy ;89 summ += yyy*sin_alpha; 96 90 } 97 91 … … 119 113 double answer = bicelle_kernel(q, radius, thick_rim, thick_face, 120 114 0.5*length, core_sld, face_sld, rim_sld, 121 solvent_sld, sin_alpha, cos_alpha) / fabs(sin_alpha); 122 123 answer *= 1.0e4; 124 125 return answer; 115 solvent_sld, sin_alpha, cos_alpha); 116 return 1.0e4*answer; 126 117 } 127 118
Note: See TracChangeset
for help on using the changeset viewer.