Changeset 99658f6 in sasmodels for sasmodels/models/rectangular_prism.c
- Timestamp:
- Nov 6, 2018 2:10:43 PM (5 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- cf3d0ce
- Parents:
- 5024a56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/rectangular_prism.c
rd42dd4a r99658f6 6 6 7 7 static double 8 radius_from_excluded_volume(double length_a, double b2a_ratio, double c2a_ratio) 9 { 10 double const r_equiv = sqrt(length_a*length_a*b2a_ratio/M_PI); 11 double const length_c = c2a_ratio*length_a; 12 return 0.5*cbrt(0.75*r_equiv*(2.0*r_equiv*length_c + (r_equiv + length_c)*(M_PI*r_equiv + length_c))); 13 } 14 15 static double 8 16 effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio) 9 17 { 10 18 switch (mode) { 11 19 default: 12 case 1: // equivalent sphere 20 case 1: // equivalent cylinder excluded volume 21 return radius_from_excluded_volume(length_a,b2a_ratio,c2a_ratio); 22 case 2: // equivalent volume sphere 13 23 return cbrt(cube(length_a)*b2a_ratio*c2a_ratio/M_4PI_3); 14 case 2: // half length_a24 case 3: // half length_a 15 25 return 0.5 * length_a; 16 case 3: // half length_b26 case 4: // half length_b 17 27 return 0.5 * length_a*b2a_ratio; 18 case 4: // half length_c28 case 5: // half length_c 19 29 return 0.5 * length_a*c2a_ratio; 20 case 5: // equivalent circular cross-section30 case 6: // equivalent circular cross-section 21 31 return length_a*sqrt(b2a_ratio/M_PI); 22 case 6: // half ab diagonal32 case 7: // half ab diagonal 23 33 return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio))); 24 case 7: // half diagonal34 case 8: // half diagonal 25 35 return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio) + square(c2a_ratio))); 26 36 }
Note: See TracChangeset
for help on using the changeset viewer.