Changeset edf1e8b in sasmodels
- Timestamp:
- Dec 20, 2016 5:30:01 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:
- 4367142
- Parents:
- d504bcd
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/stacked_disks.c
r98ce141 redf1e8b 1 double form_volume(double thick_core, 2 double thick_layer, 3 double radius, 4 double n_stacking); 5 6 double Iq(double q, 7 double thick_core, 8 double thick_layer, 9 double radius, 10 double n_stacking, 11 double sigma_dnn, 12 double core_sld, 13 double layer_sld, 14 double solvent_sld); 15 16 double Iqxy(double qx, double qy, 17 double thick_core, 18 double thick_layer, 19 double radius, 20 double n_stacking, 21 double sigma_dnn, 22 double core_sld, 23 double layer_sld, 24 double solvent_sld, 25 double theta, 26 double phi); 27 28 static 29 double _kernel(double q, 30 double radius, 31 double core_sld, 32 double layer_sld, 33 double solvent_sld, 34 double halfheight, 35 double thick_layer, 36 double sin_alpha, 37 double cos_alpha, 38 double sigma_dnn, 39 double d, 40 double n_stacking) 1 static double stacked_disks_kernel( 2 double q, 3 double halfheight, 4 double thick_layer, 5 double radius, 6 double n_stacking, 7 double sigma_dnn, 8 double core_sld, 9 double layer_sld, 10 double solvent_sld, 11 double sin_alpha, 12 double cos_alpha, 13 double d) 41 14 42 15 { … … 88 61 89 62 90 static 91 double stacked_disks_kernel(double q,92 93 94 95 96 97 98 99 63 static double stacked_disks_1d( 64 double q, 65 double thick_core, 66 double thick_layer, 67 double radius, 68 double n_stacking, 69 double sigma_dnn, 70 double core_sld, 71 double layer_sld, 72 double solvent_sld) 100 73 { 101 74 /* StackedDiscsX : calculates the form factor of a stacked "tactoid" of core shell disks … … 111 84 double sin_alpha, cos_alpha; // slots to hold sincos function output 112 85 SINCOS(zi, sin_alpha, cos_alpha); 113 double yyy = _kernel(q, 86 double yyy = stacked_disks_kernel(q, 87 halfheight, 88 thick_layer, 114 89 radius, 90 n_stacking, 91 sigma_dnn, 115 92 core_sld, 116 93 layer_sld, 117 94 solvent_sld, 118 halfheight,119 thick_layer,120 95 sin_alpha, 121 96 cos_alpha, 122 sigma_dnn, 123 d, 124 n_stacking); 97 d); 125 98 summ += Gauss76Wt[i] * yyy * sin_alpha; 126 99 } … … 132 105 } 133 106 134 double form_volume(double thick_core, 135 double thick_layer, 136 double radius, 137 double n_stacking){ 107 static double form_volume( 108 double thick_core, 109 double thick_layer, 110 double radius, 111 double fp_n_stacking) 112 { 113 int n_stacking = (int)(fp_n_stacking + 0.5); 138 114 double d = 2.0 * thick_layer + thick_core; 139 115 return M_PI * radius * radius * d * n_stacking; 140 116 } 141 117 142 double Iq(double q, 143 double thick_core, 144 double thick_layer, 145 double radius, 146 double n_stacking, 147 double sigma_dnn, 148 double core_sld, 149 double layer_sld, 150 double solvent_sld) 118 static double Iq( 119 double q, 120 double thick_core, 121 double thick_layer, 122 double radius, 123 double fp_n_stacking, 124 double sigma_dnn, 125 double core_sld, 126 double layer_sld, 127 double solvent_sld) 151 128 { 152 return stacked_disks_kernel(q, 129 int n_stacking = (int)(fp_n_stacking + 0.5); 130 return stacked_disks_1d(q, 153 131 thick_core, 154 132 thick_layer, … … 162 140 163 141 164 double 165 Iqxy(double qx, double qy, 166 double thick_core, 167 double thick_layer, 168 double radius, 169 double n_stacking, 170 double sigma_dnn, 171 double core_sld, 172 double layer_sld, 173 double solvent_sld, 174 double theta, 175 double phi) 142 static double Iqxy(double qx, double qy, 143 double thick_core, 144 double thick_layer, 145 double radius, 146 double fp_n_stacking, 147 double sigma_dnn, 148 double core_sld, 149 double layer_sld, 150 double solvent_sld, 151 double theta, 152 double phi) 176 153 { 154 int n_stacking = (int)(fp_n_stacking + 0.5); 177 155 double q, sin_alpha, cos_alpha; 178 156 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); … … 180 158 double d = 2.0 * thick_layer + thick_core; 181 159 double halfheight = 0.5*thick_core; 182 double answer = _kernel(q, 160 double answer = stacked_disks_kernel(q, 161 halfheight, 162 thick_layer, 183 163 radius, 164 n_stacking, 165 sigma_dnn, 184 166 core_sld, 185 167 layer_sld, 186 168 solvent_sld, 187 halfheight,188 thick_layer,189 169 sin_alpha, 190 170 cos_alpha, 191 sigma_dnn, 192 d, 193 n_stacking); 171 d); 194 172 195 173 //convert to [cm-1] -
sasmodels/models/stacked_disks.py
r07300ea redf1e8b 126 126 ["thick_layer", "Ang", 10.0, [0, inf], "volume", "Thickness of layer each side of core"], 127 127 ["radius", "Ang", 15.0, [0, inf], "volume", "Radius of the stacked disk"], 128 ["n_stacking", "", 1.0, [ 0, inf], "volume", "Number of stacked layer/core/layer disks"],128 ["n_stacking", "", 1.0, [1, inf], "volume", "Number of stacked layer/core/layer disks"], 129 129 ["sigma_d", "Ang", 0, [0, inf], "", "Sigma of nearest neighbor spacing"], 130 130 ["sld_core", "1e-6/Ang^2", 4, [-inf, inf], "sld", "Core scattering length density"],
Note: See TracChangeset
for help on using the changeset viewer.