Changeset becded3 in sasmodels
- Timestamp:
- Oct 17, 2017 6:21:27 PM (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:
- 8698a0d
- Parents:
- 2a602c7
- Location:
- sasmodels/models
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/barbell.c
r2a0b2b1 rbecded3 1 double form_volume(double radius_bell, double radius, double length);2 double Iq(double q, double sld, double solvent_sld,3 double radius_bell, double radius, double length);4 double Iqxy(double qx, double qy, double sld, double solvent_sld,5 double radius_bell, double radius, double length,6 double theta, double phi);7 8 1 #define INVALID(v) (v.radius_bell < v.radius) 9 2 … … 55 48 } 56 49 57 58 doubleform_volume(double radius_bell,59 60 50 static double 51 form_volume(double radius_bell, 52 double radius, 53 double length) 61 54 { 62 55 // bell radius should never be less than radius when this is called … … 69 62 } 70 63 71 double Iq(double q, double sld, double solvent_sld, 72 double radius_bell, double radius, double length) 64 static double 65 Iq(double q, double sld, double solvent_sld, 66 double radius_bell, double radius, double length) 73 67 { 74 68 const double h = -sqrt(radius_bell*radius_bell - radius*radius); … … 95 89 96 90 97 double Iqxy(double qx, double qy, 98 double sld, double solvent_sld,99 double radius_bell, double radius, double length,100 double theta, double phi)91 static double 92 Iqxy(double qab, double qc, 93 double sld, double solvent_sld, 94 double radius_bell, double radius, double length) 101 95 { 102 double q, sin_alpha, cos_alpha;103 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);104 const double qab = q*sin_alpha;105 const double qc = q*cos_alpha;106 107 96 const double h = -sqrt(square(radius_bell) - square(radius)); 108 97 const double Aq = _fq(qab, qc, h, radius_bell, radius, 0.5*length); -
sasmodels/models/bcc_paracrystal.c
r7e0b281 rbecded3 54 54 55 55 static double Iq(double q, double dnn, 56 double d_factor, double radius,57 double sld, double solvent_sld)56 double d_factor, double radius, 57 double sld, double solvent_sld) 58 58 { 59 59 // translate a point in [-1,1] to a point in [0, 2 pi] … … 91 91 92 92 93 static double Iqxy(double q x, double qy,93 static double Iqxy(double qa, double qb, double qc, 94 94 double dnn, double d_factor, double radius, 95 double sld, double solvent_sld, 96 double theta, double phi, double psi) 95 double sld, double solvent_sld) 97 96 { 98 double q, zhat, yhat, xhat; 99 ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 100 const double qa = q*xhat; 101 const double qb = q*yhat; 102 const double qc = q*zhat; 103 104 q = sqrt(qa*qa + qb*qb + qc*qc); 97 const double q = sqrt(qa*qa + qb*qb + qc*qc); 105 98 const double Zq = bcc_Zq(qa, qb, qc, dnn, d_factor); 106 99 const double Pq = sphere_form(q, radius, sld, solvent_sld); -
sasmodels/models/capped_cylinder.c
r2a0b2b1 rbecded3 1 double form_volume(double radius, double radius_cap, double length);2 double Iq(double q, double sld, double solvent_sld,3 double radius, double radius_cap, double length);4 double Iqxy(double qx, double qy, double sld, double solvent_sld,5 double radius, double radius_cap, double length, double theta, double phi);6 7 1 #define INVALID(v) (v.radius_cap < v.radius) 8 2 … … 17 11 static double 18 12 _cap_kernel(double qab, double qc, double h, double radius_cap, 19 13 double half_length) 20 14 { 21 15 // translate a point in [-1,1] to a point in [lower,upper] … … 60 54 } 61 55 62 double form_volume(double radius, double radius_cap, double length) 56 static double 57 form_volume(double radius, double radius_cap, double length) 63 58 { 64 59 // cap radius should never be less than radius when this is called … … 89 84 } 90 85 91 double Iq(double q, double sld, double solvent_sld, 92 double radius, double radius_cap, double length) 86 static double 87 Iq(double q, double sld, double solvent_sld, 88 double radius, double radius_cap, double length) 93 89 { 94 90 const double h = sqrt(radius_cap*radius_cap - radius*radius); … … 118 114 119 115 120 double Iqxy(double qx, double qy, 116 static double 117 Iqxy(double qab, double qc, 121 118 double sld, double solvent_sld, double radius, 122 double radius_cap, double length, 123 double theta, double phi) 119 double radius_cap, double length) 124 120 { 125 double q, sin_alpha, cos_alpha;126 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);127 const double qab = q*sin_alpha;128 const double qc = q*cos_alpha;129 130 121 const double h = sqrt(radius_cap*radius_cap - radius*radius); 131 122 const double Aq = _fq(qab, qc, h, radius_cap, radius, 0.5*length); -
sasmodels/models/core_shell_bicelle.c
r2a0b2b1 rbecded3 67 67 68 68 static double 69 Iqxy(double q x, double qy,69 Iqxy(double qab, double qc, 70 70 double radius, 71 71 double thick_rim, … … 75 75 double face_sld, 76 76 double rim_sld, 77 double solvent_sld, 78 double theta, 79 double phi) 77 double solvent_sld) 80 78 { 81 double q, sin_alpha, cos_alpha;82 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);83 const double qab = q*sin_alpha;84 const double qc = q*cos_alpha;85 86 79 double fq = bicelle_kernel(qab, qc, radius, thick_rim, thick_face, 87 80 0.5*length, core_sld, face_sld, rim_sld, -
sasmodels/models/core_shell_bicelle_elliptical.c
r2a0b2b1 rbecded3 2 2 static double 3 3 form_volume(double r_minor, 4 5 6 7 4 double x_core, 5 double thick_rim, 6 double thick_face, 7 double length) 8 8 { 9 9 return M_PI*(r_minor+thick_rim)*(r_minor*x_core+thick_rim)*(length+2.0*thick_face); … … 12 12 static double 13 13 Iq(double q, 14 15 16 17 18 19 20 21 22 14 double r_minor, 15 double x_core, 16 double thick_rim, 17 double thick_face, 18 double length, 19 double sld_core, 20 double sld_face, 21 double sld_rim, 22 double sld_solvent) 23 23 { 24 24 // core_shell_bicelle_elliptical, RKH Dec 2016, based on elliptical_cylinder and core_shell_bicelle … … 71 71 72 72 static double 73 Iqxy(double qx, double qy, 74 double r_minor, 75 double x_core, 76 double thick_rim, 77 double thick_face, 78 double length, 79 double sld_core, 80 double sld_face, 81 double sld_rim, 82 double sld_solvent, 83 double theta, 84 double phi, 85 double psi) 73 Iqxy(double qa, double qb, double qc, 74 double r_minor, 75 double x_core, 76 double thick_rim, 77 double thick_face, 78 double length, 79 double sld_core, 80 double sld_face, 81 double sld_rim, 82 double sld_solvent) 86 83 { 87 double q, xhat, yhat, zhat;88 ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat);89 const double qa = q*xhat;90 const double qb = q*yhat;91 const double qc = q*zhat;92 93 84 const double dr1 = sld_core-sld_face; 94 85 const double dr2 = sld_rim-sld_solvent; -
sasmodels/models/core_shell_cylinder.c
r2a0b2b1 rbecded3 48 48 49 49 50 double Iqxy(double q x, double qy,50 double Iqxy(double qab, double qc, 51 51 double core_sld, 52 52 double shell_sld, … … 54 54 double radius, 55 55 double thickness, 56 double length, 57 double theta, 58 double phi) 56 double length) 59 57 { 60 double q, sin_alpha, cos_alpha;61 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);62 const double qab = q*sin_alpha;63 const double qc = q*cos_alpha;64 65 58 const double core_r = radius; 66 59 const double core_h = 0.5*length; -
sasmodels/models/core_shell_ellipsoid.c
r2a0b2b1 rbecded3 75 75 76 76 static double 77 Iqxy(double q x, double qy,77 Iqxy(double qab, double qc, 78 78 double radius_equat_core, 79 79 double x_core, … … 82 82 double core_sld, 83 83 double shell_sld, 84 double solvent_sld, 85 double theta, 86 double phi) 84 double solvent_sld) 87 85 { 88 double q, sin_alpha, cos_alpha;89 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);90 const double qab = q*sin_alpha;91 const double qc = q*cos_alpha;92 93 86 const double sld_core_shell = core_sld - shell_sld; 94 87 const double sld_shell_solvent = shell_sld - solvent_sld; -
sasmodels/models/core_shell_parallelepiped.c
r2a0b2b1 rbecded3 1 double form_volume(double length_a, double length_b, double length_c, 2 double thick_rim_a, double thick_rim_b, double thick_rim_c); 3 double Iq(double q, double core_sld, double arim_sld, double brim_sld, double crim_sld, 4 double solvent_sld, double length_a, double length_b, double length_c, 5 double thick_rim_a, double thick_rim_b, double thick_rim_c); 6 double Iqxy(double qx, double qy, double core_sld, double arim_sld, double brim_sld, 7 double crim_sld, double solvent_sld, double length_a, double length_b, 8 double length_c, double thick_rim_a, double thick_rim_b, 9 double thick_rim_c, double theta, double phi, double psi); 10 11 double form_volume(double length_a, double length_b, double length_c, 12 double thick_rim_a, double thick_rim_b, double thick_rim_c) 1 static double 2 form_volume(double length_a, double length_b, double length_c, 3 double thick_rim_a, double thick_rim_b, double thick_rim_c) 13 4 { 14 5 //return length_a * length_b * length_c; … … 19 10 } 20 11 21 double Iq(double q, 12 static double 13 Iq(double q, 22 14 double core_sld, 23 15 double arim_sld, … … 118 110 } 119 111 120 double Iqxy(double qx, double qy, 112 static double 113 Iqxy(double qa, double qb, double qc, 121 114 double core_sld, 122 115 double arim_sld, … … 129 122 double thick_rim_a, 130 123 double thick_rim_b, 131 double thick_rim_c, 132 double theta, 133 double phi, 134 double psi) 124 double thick_rim_c) 135 125 { 136 double q, zhat, yhat, xhat;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;141 142 126 // cspkernel in csparallelepiped recoded here 143 127 const double dr0 = core_sld-solvent_sld; -
sasmodels/models/cylinder.c
rb34fc77 rbecded3 45 45 46 46 static double 47 Iqxy(double q x, double qy,47 Iqxy(double qab, double qc, 48 48 double sld, 49 49 double solvent_sld, 50 50 double radius, 51 double length, 52 double theta, 53 double phi) 51 double length) 54 52 { 55 double q, sin_alpha, cos_alpha;56 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);57 const double qab = q*sin_alpha;58 const double qc = q*cos_alpha;59 60 53 const double s = (sld-solvent_sld) * form_volume(radius, length); 61 54 const double form = fq(qab, qc, radius, length); -
sasmodels/models/ellipsoid.c
r2a0b2b1 rbecded3 39 39 40 40 static double 41 Iqxy(double q x, double qy,41 Iqxy(double qab, double qc, 42 42 double sld, 43 43 double sld_solvent, 44 44 double radius_polar, 45 double radius_equatorial, 46 double theta, 47 double phi) 45 double radius_equatorial) 48 46 { 49 double q, sin_alpha, cos_alpha;50 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);51 const double qab = q*sin_alpha;52 const double qc = q*cos_alpha;53 54 47 const double qr = sqrt(square(radius_equatorial*qab) + square(radius_polar*qc)); 55 48 const double f = sas_3j1x_x(qr); -
sasmodels/models/elliptical_cylinder.c
r2a0b2b1 rbecded3 55 55 56 56 static double 57 Iqxy(double q x, double qy,57 Iqxy(double qa, double qb, double qc, 58 58 double radius_minor, double r_ratio, double length, 59 double sld, double solvent_sld, 60 double theta, double phi, double psi) 59 double sld, double solvent_sld) 61 60 { 62 double q, xhat, yhat, zhat;63 ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat);64 const double qa = q*xhat;65 const double qb = q*yhat;66 const double qc = q*zhat;67 68 61 // Compute: r = sqrt((radius_major*cos_nu)^2 + (radius_minor*cos_mu)^2) 69 62 // Given: radius_major = r_ratio * radius_minor -
sasmodels/models/fcc_paracrystal.c
r7e0b281 rbecded3 82 82 83 83 84 static double Iqxy(double q x, double qy,84 static double Iqxy(double qa, double qb, double qc, 85 85 double dnn, double d_factor, double radius, 86 double sld, double solvent_sld, 87 double theta, double phi, double psi) 86 double sld, double solvent_sld) 88 87 { 89 double q, zhat, yhat, xhat; 90 ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 91 const double qa = q*xhat; 92 const double qb = q*yhat; 93 const double qc = q*zhat; 94 95 q = sqrt(qa*qa + qb*qb + qc*qc); 88 const double q = sqrt(qa*qa + qb*qb + qc*qc); 96 89 const double Pq = sphere_form(q, radius, sld, solvent_sld); 97 90 const double Zq = fcc_Zq(qa, qb, qc, dnn, d_factor); -
sasmodels/models/hollow_cylinder.c
r2a0b2b1 rbecded3 1 double form_volume(double radius, double thickness, double length);2 double Iq(double q, double radius, double thickness, double length, double sld,3 double solvent_sld);4 double Iqxy(double qx, double qy, double radius, double thickness, double length, double sld,5 double solvent_sld, double theta, double phi);6 7 1 //#define INVALID(v) (v.radius_core >= v.radius) 8 2 … … 28 22 } 29 23 30 double24 static double 31 25 form_volume(double radius, double thickness, double length) 32 26 { … … 36 30 37 31 38 double32 static double 39 33 Iq(double q, double radius, double thickness, double length, 40 34 double sld, double solvent_sld) … … 57 51 } 58 52 59 double60 Iqxy(double q x, double qy,53 static double 54 Iqxy(double qab, double qc, 61 55 double radius, double thickness, double length, 62 double sld, double solvent_sld , double theta, double phi)56 double sld, double solvent_sld) 63 57 { 64 double q, sin_alpha, cos_alpha;65 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);66 const double qab = q*sin_alpha;67 const double qc = q*cos_alpha;68 69 58 const double form = _fq(qab, qc, radius, thickness, length); 70 59 -
sasmodels/models/parallelepiped.c
r2a0b2b1 rbecded3 1 double form_volume(double length_a, double length_b, double length_c); 2 double Iq(double q, double sld, double solvent_sld, 3 double length_a, double length_b, double length_c); 4 double Iqxy(double qx, double qy, double sld, double solvent_sld, 5 double length_a, double length_b, double length_c, 6 double theta, double phi, double psi); 7 8 double form_volume(double length_a, double length_b, double length_c) 1 static double 2 form_volume(double length_a, double length_b, double length_c) 9 3 { 10 4 return length_a * length_b * length_c; … … 12 6 13 7 14 double Iq(double q, 8 static double 9 Iq(double q, 15 10 double sld, 16 11 double solvent_sld, … … 57 52 58 53 59 double Iqxy(double qx, double qy, 54 static double 55 Iq2d(double qa, double qb, double qc, 60 56 double sld, 61 57 double solvent_sld, 62 58 double length_a, 63 59 double length_b, 64 double length_c, 65 double theta, 66 double phi, 67 double psi) 60 double length_c) 68 61 { 69 double q, xhat, yhat, zhat;70 ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat);71 const double qa = q*xhat;72 const double qb = q*yhat;73 const double qc = q*zhat;74 75 62 const double siA = sas_sinx_x(0.5*length_a*qa); 76 63 const double siB = sas_sinx_x(0.5*length_b*qb); -
sasmodels/models/sc_paracrystal.c
r7e0b281 rbecded3 36 36 37 37 38 static double Iq(double q, double dnn, 39 double d_factor, double radius, 40 double sld, double solvent_sld) 38 static double 39 Iq(double q, double dnn, 40 double d_factor, double radius, 41 double sld, double solvent_sld) 41 42 { 42 43 // translate a point in [-1,1] to a point in [0, 2 pi] … … 76 77 77 78 78 static double Iqxy(double qx, double qy, 79 static double 80 Iqxy(double qa, double qb, double qc, 79 81 double dnn, double d_factor, double radius, 80 double sld, double solvent_sld, 81 double theta, double phi, double psi) 82 double sld, double solvent_sld) 82 83 { 83 double q, zhat, yhat, xhat; 84 ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 85 const double qa = q*xhat; 86 const double qb = q*yhat; 87 const double qc = q*zhat; 88 89 q = sqrt(qa*qa + qb*qb + qc*qc); 84 const double q = sqrt(qa*qa + qb*qb + qc*qc); 90 85 const double Pq = sphere_form(q, radius, sld, solvent_sld); 91 86 const double Zq = sc_Zq(qa, qb, qc, dnn, d_factor); -
sasmodels/models/stacked_disks.c
rb34fc77 rbecded3 1 static double stacked_disks_kernel( 1 static double 2 stacked_disks_kernel( 2 3 double qab, 3 4 double qc, … … 60 61 61 62 62 static double stacked_disks_1d( 63 static double 64 stacked_disks_1d( 63 65 double q, 64 66 double thick_core, … … 102 104 } 103 105 104 static double form_volume( 106 static double 107 form_volume( 105 108 double thick_core, 106 109 double thick_layer, … … 113 116 } 114 117 115 static double Iq( 118 static double 119 Iq( 116 120 double q, 117 121 double thick_core, … … 137 141 138 142 139 static double Iqxy(double qx, double qy, 143 static double 144 Iqxy(double qab, double qc, 140 145 double thick_core, 141 146 double thick_layer, … … 145 150 double core_sld, 146 151 double layer_sld, 147 double solvent_sld, 148 double theta, 149 double phi) 152 double solvent_sld) 150 153 { 151 double q, sin_alpha, cos_alpha;152 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);153 const double qab = q*sin_alpha;154 const double qc = q*cos_alpha;155 156 154 int n_stacking = (int)(fp_n_stacking + 0.5); 157 155 double d = 2.0 * thick_layer + thick_core; -
sasmodels/models/triaxial_ellipsoid.c
r2a0b2b1 rbecded3 46 46 47 47 static double 48 Iqxy(double q x, double qy,48 Iqxy(double qa, double qb, double qc, 49 49 double sld, 50 50 double sld_solvent, 51 51 double radius_equat_minor, 52 52 double radius_equat_major, 53 double radius_polar, 54 double theta, 55 double phi, 56 double psi) 53 double radius_polar) 57 54 { 58 double q, xhat, yhat, zhat;59 ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat);60 const double qa = q*xhat;61 const double qb = q*yhat;62 const double qc = q*zhat;63 64 55 const double qr = sqrt(square(radius_equat_minor*qa) 65 56 + square(radius_equat_major*qb)
Note: See TracChangeset
for help on using the changeset viewer.