Changeset 2f5c6d4 in sasmodels for sasmodels/models/hollow_cylinder.c
- Timestamp:
- Jul 25, 2016 10:38:21 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- a3a0c5c
- Parents:
- a4280bd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/hollow_cylinder.c
r43b7eea r2f5c6d4 1 static double _hollow_cylinder_kernel(double q, double core_radius, double radius,2 double length, double dum);3 static double hollow_cylinder_analytical_2D_scaled(double q, double q_x, double q_y, double radius, double core_radius, double length, double sld,4 double solvent_sld, double theta, double phi);5 static double hollow_cylinder_scaling(double integrand, double delrho, double volume);6 7 1 double form_volume(double radius, double core_radius, double length); 8 2 … … 12 6 double solvent_sld, double theta, double phi); 13 7 8 #define INVALID(v) (v.core_radius >= v.radius || v.radius >= v.length) 9 14 10 // From Igor library 15 static double _hollow_cylinder_kernel(double q, double core_radius, double radius, 11 static double hollow_cylinder_scaling(double integrand, double delrho, double volume) 12 { 13 double answer; 14 // Multiply by contrast^2 15 answer = integrand*delrho*delrho; 16 17 //normalize by cylinder volume 18 answer *= volume*volume; 19 20 //convert to [cm-1] 21 answer *= 1.0e-4; 22 23 return answer; 24 } 25 26 static double _hollow_cylinder_kernel(double q, double core_radius, double radius, 16 27 double length, double dum) 17 28 { … … 68 79 cos_val = cyl_x*q_x + cyl_y*q_y;// + cyl_z*q_z; 69 80 70 // The following test should always pass71 if (fabs(cos_val)>1.0) {72 //printf("core_shell_cylinder_analytical_2D: Unexpected error: cos(alpha)=%g\n", cos_val);73 return NAN;74 }75 76 81 answer = _hollow_cylinder_kernel(q, core_radius, radius, length, cos_val); 77 82 … … 79 84 answer = hollow_cylinder_scaling(answer, delrho, vol); 80 85 81 return answer;82 }83 static double hollow_cylinder_scaling(double integrand, double delrho, double volume)84 {85 double answer;86 // Multiply by contrast^287 answer = integrand*delrho*delrho;88 89 //normalize by cylinder volume90 answer *= volume*volume;91 92 //convert to [cm-1]93 answer *= 1.0e-4;94 95 86 return answer; 96 87 } … … 113 104 double summ,answer,delrho; //running tally of integration 114 105 double norm,volume; //final calculation variables 115 116 if (core_radius >= radius || radius >= length) {117 return NAN;118 }119 106 120 107 delrho = solvent_sld - sld;
Note: See TracChangeset
for help on using the changeset viewer.