Changeset d2deac2 in sasmodels
- Timestamp:
- Dec 20, 2016 4:40:52 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:
- e9b0ef3
- Parents:
- 21fbab1
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/pearl_necklace.c
r2126131 rd2deac2 1 1 double form_volume(double radius, double edge_sep, 2 double thick_string, double num_pearls);2 double thick_string, double fp_num_pearls); 3 3 double Iq(double q, double radius, double edge_sep, 4 double thick_string, double num_pearls, double sld,4 double thick_string, double fp_num_pearls, double sld, 5 5 double string_sld, double solvent_sld); 6 6 … … 9 9 // From Igor library 10 10 static double 11 _pearl_necklace_kernel(double q, double radius, double edge_sep, double thick_string,12 doublenum_pearls, double sld_pearl, double sld_string, double sld_solv)11 pearl_necklace_kernel(double q, double radius, double edge_sep, double thick_string, 12 int num_pearls, double sld_pearl, double sld_string, double sld_solv) 13 13 { 14 14 // number of string segments … … 69 69 70 70 double form_volume(double radius, double edge_sep, 71 double thick_string, double num_pearls)71 double thick_string, double fp_num_pearls) 72 72 { 73 num_pearls = floor(num_pearls + 0.5); //Force integer number of pearls 74 75 const double num_strings = num_pearls - 1.0; 73 const int num_pearls = (int)(fp_num_pearls + 0.5); //Force integer number of pearls 74 const int num_strings = num_pearls - 1; 76 75 const double string_vol = edge_sep * M_PI_4 * thick_string * thick_string; 77 76 const double pearl_vol = M_4PI_3 * radius * radius * radius; … … 82 81 83 82 double Iq(double q, double radius, double edge_sep, 84 double thick_string, double num_pearls, double sld,83 double thick_string, double fp_num_pearls, double sld, 85 84 double string_sld, double solvent_sld) 86 85 { 87 const double form = _pearl_necklace_kernel(q, radius, edge_sep, 86 const int num_pearls = (int)(fp_num_pearls + 0.5); //Force integer number of pearls 87 const double form = pearl_necklace_kernel(q, radius, edge_sep, 88 88 thick_string, num_pearls, sld, string_sld, solvent_sld); 89 89 -
sasmodels/models/pearl_necklace.py
r2126131 rd2deac2 100 100 Redundant with form_volume. 101 101 """ 102 num_pearls = int(num_pearls + 0.5) 102 103 number_of_strings = num_pearls - 1.0 103 104 string_vol = edge_sep * pi * pow((thick_string / 2.0), 2.0) … … 111 112 Calculation for effective radius. 112 113 """ 114 num_pearls = int(num_pearls + 0.5) 113 115 tot_vol = volume(radius, edge_sep, thick_string, num_pearls) 114 116 rad_out = (tot_vol/(4.0/3.0*pi)) ** (1./3.)
Note: See TracChangeset
for help on using the changeset viewer.