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