Changes in sasmodels/models/core_shell_bicelle_elliptical.c [71b751d:d277229] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_bicelle_elliptical.c
r71b751d rd277229 8 8 { 9 9 return M_PI*(r_minor+thick_rim)*(r_minor*x_core+thick_rim)*(length+2.0*thick_face); 10 } 11 12 static double 13 radius_from_volume(double r_minor, double x_core, double thick_rim, double thick_face, double length) 14 { 15 const double volume_bicelle = form_volume(r_minor, x_core, thick_rim,thick_face,length); 16 return cbrt(0.75*volume_bicelle/M_PI); 17 } 18 19 static double 20 radius_from_diagonal(double r_minor, double x_core, double thick_rim, double thick_face, double length) 21 { 22 const double radius_max = (x_core < 1.0 ? r_minor : x_core*r_minor); 23 const double radius_max_tot = radius_max + thick_rim; 24 const double length_tot = length + 2.0*thick_face; 25 return sqrt(radius_max_tot*radius_max_tot + 0.25*length_tot*length_tot); 26 } 27 28 static double 29 effective_radius(int mode, double r_minor, double x_core, double thick_rim, double thick_face, double length) 30 { 31 if (mode == 1) { 32 return radius_from_volume(r_minor, x_core, thick_rim, thick_face, length); 33 } else if (mode == 2) { 34 return 0.5*r_minor*(1.0 + x_core) + thick_rim; 35 } else if (mode == 3) { 36 return (x_core < 1.0 ? x_core*r_minor+thick_rim : r_minor+thick_rim); 37 } else if (mode == 4) { 38 return (x_core > 1.0 ? x_core*r_minor+thick_rim : r_minor+thick_rim); 39 } else if (mode ==5) { 40 return 0.5*length + thick_face; 41 } else { 42 return radius_from_diagonal(r_minor,x_core,thick_rim,thick_face,length); 43 } 10 44 } 11 45
Note: See TracChangeset
for help on using the changeset viewer.