Changeset d277229 in sasmodels for sasmodels/models/fuzzy_sphere.py
- Timestamp:
- Sep 7, 2018 3:29:38 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 3c60146
- Parents:
- 2a12351b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/fuzzy_sphere.py
r71b751d rd277229 78 78 ["sld_solvent", "1e-6/Ang^2", 3, [-inf, inf], "sld", "Solvent scattering length density"], 79 79 ["radius", "Ang", 60, [0, inf], "volume", "Sphere radius"], 80 ["fuzziness", "Ang", 10, [0, inf], " ", "std deviation of Gaussian convolution for interface (must be << radius)"],80 ["fuzziness", "Ang", 10, [0, inf], "volume", "std deviation of Gaussian convolution for interface (must be << radius)"], 81 81 ] 82 82 # pylint: enable=bad-whitespace,line-too-long 83 83 84 source = ["lib/sas_3j1x_x.c" ]84 source = ["lib/sas_3j1x_x.c","fuzzy_sphere.c"] 85 85 have_Fq = True 86 effective_radius_type = ["radius","radius + fuzziness"] 86 87 87 c_code = """ 88 static double form_volume(double radius) 89 { 90 return M_4PI_3*cube(radius); 91 } 92 93 static void Fq(double q, double *F1, double *F2, double sld, double sld_solvent, 94 double radius, double fuzziness) 95 { 96 const double qr = q*radius; 97 const double bes = sas_3j1x_x(qr); 98 const double qf = exp(-0.5*square(q*fuzziness)); 99 const double contrast = (sld - sld_solvent); 100 const double form = contrast * form_volume(radius) * bes * qf; 101 *F1 = 1.0e-2*form; 102 *F2 = 1.0e-4*form*form; 103 } 104 """ 105 106 def ER(radius): 107 """ 108 Return radius 109 """ 110 return radius 88 #def ER(radius): 89 # """ 90 # Return radius 91 # """ 92 # return radius 111 93 112 94 # VR defaults to 1.0
Note: See TracChangeset
for help on using the changeset viewer.