Changeset 2f5c6d4 in sasmodels
- Timestamp:
- Jul 26, 2016 12:38:21 AM (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
- Location:
- sasmodels/models
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/barbell.c
r26141cb r2f5c6d4 5 5 double bell_radius, double radius, double length, 6 6 double theta, double phi); 7 8 #define INVALID(v) (v.bell_radius < v.radius) 7 9 8 10 //barbell kernel - same as dumbell … … 58 60 double bell_radius, double radius, double length) 59 61 { 60 // Exclude invalid inputs.61 if (bell_radius < radius) return NAN;62 62 const double h = -sqrt(bell_radius*bell_radius - radius*radius); 63 63 const double half_length = 0.5*length; … … 100 100 const double alpha = acos(cos_val); // rod angle relative to q 101 101 102 // Exclude invalid inputs.103 if (bell_radius < radius) return NAN;104 102 const double h = -sqrt(square(bell_radius) - square(radius)); 105 103 const double half_length = 0.5*length; -
sasmodels/models/capped_cylinder.c
r26141cb r2f5c6d4 4 4 double Iqxy(double qx, double qy, double sld, double solvent_sld, 5 5 double radius, double cap_radius, double length, double theta, double phi); 6 7 #define INVALID(v) (v.cap_radius < v.radius) 6 8 7 9 // Integral over a convex lens kernel for t in [h/R,1]. See the docs for … … 79 81 double radius, double cap_radius, double length) 80 82 { 81 // Exclude invalid inputs.82 if (cap_radius < radius) return NAN;83 83 const double h = sqrt(cap_radius*cap_radius - radius*radius); 84 84 const double half_length = 0.5*length; … … 121 121 const double alpha = acos(cos_val); // rod angle relative to q 122 122 123 // Exclude invalid inputs.124 if (cap_radius < radius) return NAN;125 123 const double h = sqrt(cap_radius*cap_radius - radius*radius); 126 124 const double half_length = 0.5*length; -
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; -
sasmodels/models/pearl_necklace.c
r2c74c11 r2f5c6d4 8 8 double string_thickness, double number_of_pearls, double sld, 9 9 double string_sld, double solvent_sld); 10 11 #define INVALID(v) (v.string_thickness >= v.radius || v.number_of_pearls <= 0) 10 12 11 13 // From Igor library … … 126 128 double value, tot_vol; 127 129 128 if (string_thickness >= radius || number_of_pearls <= 0) {129 return NAN;130 }131 132 130 value = _pearl_necklace_kernel(q, radius, edge_separation, string_thickness, 133 131 number_of_pearls, sld, string_sld, solvent_sld); -
sasmodels/models/triaxial_ellipsoid.c
r50e1e40 r2f5c6d4 4 4 double Iqxy(double qx, double qy, double sld, double solvent_sld, 5 5 double req_minor, double req_major, double rpolar, double theta, double phi, double psi); 6 7 //#define INVALID(v) (v.req_minor > v.req_major || v.req_major > v.rpolar) 8 6 9 7 10 double form_volume(double req_minor, double req_major, double rpolar) … … 17 20 double rpolar) 18 21 { 19 // if (req_minor > req_major || req_major > rpolar) return NAN; // Exclude invalid region20 21 22 double sn, cn; 22 23 // translate a point in [-1,1] to a point in [0, 1] … … 57 58 double psi) 58 59 { 59 // if (req_minor > req_major || req_major > rpolar) return NAN; // Exclude invalid region60 61 60 double stheta, ctheta; 62 61 double sphi, cphi;
Note: See TracChangeset
for help on using the changeset viewer.