Changeset d277229 in sasmodels for sasmodels/models/core_shell_parallelepiped.c
- Timestamp:
- Sep 7, 2018 5: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_parallelepiped.c
r71b751d rd277229 25 25 2.0 * length_a * length_b * thick_rim_c; 26 26 #endif 27 } 28 29 static double 30 radius_from_volume(double length_a, double length_b, double length_c, 31 double thick_rim_a, double thick_rim_b, double thick_rim_c) 32 { 33 const double volume_paral = form_volume(length_a, length_b, length_c, thick_rim_a, thick_rim_b, thick_rim_c); 34 return cbrt(0.75*volume_paral/M_PI); 35 } 36 37 static double 38 radius_from_crosssection(double length_a, double length_b, double thick_rim_a, double thick_rim_b) 39 { 40 const double area_xsec_paral = length_a*length_b + 2.0*thick_rim_a*length_b + 2.0*thick_rim_b*length_a; 41 return sqrt(area_xsec_paral/M_PI); 42 } 43 44 static double 45 effective_radius(int mode, double length_a, double length_b, double length_c, 46 double thick_rim_a, double thick_rim_b, double thick_rim_c) 47 { 48 if (mode == 1) { 49 return radius_from_volume(length_a, length_b, length_c, thick_rim_a, thick_rim_b, thick_rim_c); 50 } else if (mode == 2) { 51 return 0.5 * (length_a + thick_rim_a); 52 } else if (mode == 3) { 53 return 0.5 * (length_b + thick_rim_b); 54 } else if (mode == 4) { 55 return 0.5 * (length_c + thick_rim_c); 56 } else if (mode == 5) { 57 return radius_from_crosssection(length_a, length_b, thick_rim_a, thick_rim_b); 58 } else if (mode == 6) { 59 return 0.5*sqrt(square(length_a+thick_rim_a) + square(length_b+thick_rim_b)); 60 } else { 61 return 0.5*sqrt(square(length_a+thick_rim_a) + square(length_b+thick_rim_b) + square(length_c+thick_rim_c)); 62 } 27 63 } 28 64
Note: See TracChangeset
for help on using the changeset viewer.