Changeset 5bddd89 in sasmodels for sasmodels/models/core_shell_ellipsoid.c
- Timestamp:
- Oct 14, 2016 2:05:39 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 9068f4c
- Parents:
- 0b717c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_ellipsoid.c
r0d6e865 r5bddd89 32 32 const double equat_shell = radius_equat_core + thick_shell; 33 33 const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; 34 double vol = 4.0*M_PI/3.0*equat_shell*equat_shell*polar_shell;34 double vol = M_4PI_3*equat_shell*equat_shell*polar_shell; 35 35 return vol; 36 36 } … … 60 60 61 61 for(int i=0;i<N_POINTS_76;i++) { 62 double zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0;62 double zi = 0.5*( Gauss76Z[i]*(uplim-lolim) + uplim + lolim ); 63 63 double yyy = Gauss76Wt[i] * gfn4(zi, 64 64 radius_equat_core, … … 72 72 } 73 73 74 double answer = (uplim-lolim)/2.0*summ;74 double answer = 0.5*(uplim-lolim)*summ; 75 75 //convert to [cm-1] 76 76 answer *= 1.0e-4; … … 80 80 81 81 static double 82 core_shell_ellipsoid_xt_kernel_2d(double q , double q_x, double q_y,82 core_shell_ellipsoid_xt_kernel_2d(double qx, double qy, 83 83 double radius_equat_core, 84 84 double x_core, … … 91 91 double phi) 92 92 { 93 //convert angle degree to radian 94 theta = theta * M_PI_180; 95 phi = phi * M_PI_180; 96 97 // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 98 const double cyl_x = sin(theta) * cos(phi); 99 const double cyl_y = sin(theta) * sin(phi); 93 double q, sin_alpha, cos_alpha; 94 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 100 95 101 96 const double sldcs = core_sld - shell_sld; 102 97 const double sldss = shell_sld- solvent_sld; 103 104 // Compute the angle btw vector q and the105 // axis of the cylinder106 const double cos_val = cyl_x*q_x + cyl_y*q_y;107 98 108 99 const double polar_core = radius_equat_core*x_core; … … 112 103 // Call the IGOR library function to get the kernel: 113 104 // MUST use gfn4 not gf2 because of the def of params. 114 double answer = gfn4(cos_ val,105 double answer = gfn4(cos_alpha, 115 106 radius_equat_core, 116 107 polar_core, … … 160 151 double phi) 161 152 { 162 double q; 163 q = sqrt(qx*qx+qy*qy); 164 double intensity = core_shell_ellipsoid_xt_kernel_2d(q, qx/q, qy/q, 153 double intensity = core_shell_ellipsoid_xt_kernel_2d(qx, qy, 165 154 radius_equat_core, 166 155 x_core,
Note: See TracChangeset
for help on using the changeset viewer.