Changeset 2a0b2b1 in sasmodels for sasmodels/models/core_shell_parallelepiped.c
- Timestamp:
- Apr 14, 2017 6:30:29 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- fdd56a1
- Parents:
- 9901384
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_parallelepiped.c
r92dfe0c r2a0b2b1 1 double form_volume(double length_a, double length_b, double length_c, 1 double form_volume(double length_a, double length_b, double length_c, 2 2 double thick_rim_a, double thick_rim_b, double thick_rim_c); 3 3 double Iq(double q, double core_sld, double arim_sld, double brim_sld, double crim_sld, … … 9 9 double thick_rim_c, double theta, double phi, double psi); 10 10 11 double form_volume(double length_a, double length_b, double length_c, 11 double form_volume(double length_a, double length_b, double length_c, 12 12 double thick_rim_a, double thick_rim_b, double thick_rim_c) 13 13 { 14 14 //return length_a * length_b * length_c; 15 return length_a * length_b * length_c + 16 2.0 * thick_rim_a * length_b * length_c + 15 return length_a * length_b * length_c + 16 2.0 * thick_rim_a * length_b * length_c + 17 17 2.0 * thick_rim_b * length_a * length_c + 18 18 2.0 * thick_rim_c * length_a * length_b; … … 34 34 // Code converted from functions CSPPKernel and CSParallelepiped in libCylinder.c_scaled 35 35 // Did not understand the code completely, it should be rechecked (Miguel Gonzalez) 36 36 37 37 const double mu = 0.5 * q * length_b; 38 38 39 39 //calculate volume before rescaling (in original code, but not used) 40 //double vol = form_volume(length_a, length_b, length_c, thick_rim_a, thick_rim_b, thick_rim_c); 41 //double vol = length_a * length_b * length_c + 42 // 2.0 * thick_rim_a * length_b * length_c + 40 //double vol = form_volume(length_a, length_b, length_c, thick_rim_a, thick_rim_b, thick_rim_c); 41 //double vol = length_a * length_b * length_c + 42 // 2.0 * thick_rim_a * length_b * length_c + 43 43 // 2.0 * thick_rim_b * length_a * length_c + 44 44 // 2.0 * thick_rim_c * length_a * length_b; 45 45 46 46 // Scale sides by B 47 47 const double a_scaled = length_a / length_b; … … 101 101 // ( dr0*tmp1*tmp2*tmp3*Vin + drA*(tmpt1-tmp1)*tmp2*tmp3*V1+ drB*tmp1*(tmpt2-tmp2)*tmp3*V2 + drC*tmp1*tmp2*(tmpt3-tmp3)*V3); // correct FF : square of sum of phase factors 102 102 // This is the function called by csparallelepiped_analytical_2D_scaled, 103 // while CSParallelepipedModel calls CSParallelepiped in libCylinder.c 104 103 // while CSParallelepipedModel calls CSParallelepiped in libCylinder.c 104 105 105 // correct FF : sum of square of phase factors 106 106 inner_total += Gauss76Wt[j] * form * form; … … 136 136 double q, zhat, yhat, xhat; 137 137 ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 138 const double qa = q*xhat; 139 const double qb = q*yhat; 140 const double qc = q*zhat; 138 141 139 142 // cspkernel in csparallelepiped recoded here … … 160 163 double tc = length_a + 2.0*thick_rim_c; 161 164 //handle arg=0 separately, as sin(t)/t -> 1 as t->0 162 double siA = sas_sinx_x(0.5* q*length_a*xhat);163 double siB = sas_sinx_x(0.5* q*length_b*yhat);164 double siC = sas_sinx_x(0.5* q*length_c*zhat);165 double siAt = sas_sinx_x(0.5* q*ta*xhat);166 double siBt = sas_sinx_x(0.5* q*tb*yhat);167 double siCt = sas_sinx_x(0.5* q*tc*zhat);168 165 double siA = sas_sinx_x(0.5*length_a*qa); 166 double siB = sas_sinx_x(0.5*length_b*qb); 167 double siC = sas_sinx_x(0.5*length_c*qc); 168 double siAt = sas_sinx_x(0.5*ta*qa); 169 double siBt = sas_sinx_x(0.5*tb*qb); 170 double siCt = sas_sinx_x(0.5*tc*qc); 171 169 172 170 173 // f uses Vin, V1, V2, and V3 and it seems to have more sense than the value computed … … 174 177 + drB*siA*(siBt-siB)*siC*V2 175 178 + drC*siA*siB*(siCt*siCt-siC)*V3); 176 179 177 180 return 1.0e-4 * f * f; 178 181 }
Note: See TracChangeset
for help on using the changeset viewer.