Changeset 99658f6 in sasmodels for sasmodels/models/hollow_rectangular_prism_thin_walls.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/hollow_rectangular_prism_thin_walls.c
rd42dd4a r99658f6 18 18 19 19 static double 20 radius_from_excluded_volume(double length_a, double b2a_ratio, double c2a_ratio) 21 { 22 const double r_equiv = sqrt(length_a*length_a*b2a_ratio/M_PI); 23 const double length_c = length_a*c2a_ratio; 24 return 0.5*cbrt(0.75*r_equiv*(2.0*r_equiv*length_c + (r_equiv + length_c)*(M_PI*r_equiv + length_c))); 25 } 26 27 static double 20 28 effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio) 21 29 { 22 30 switch (mode) { 23 31 default: 24 case 1: // equivalent sphere 32 case 1: // equivalent cylinder excluded volume 33 return radius_from_excluded_volume(length_a, b2a_ratio, c2a_ratio); 34 case 2: // equivalent outer volume sphere 25 35 return cbrt(cube(length_a)*b2a_ratio*c2a_ratio/M_4PI_3); 26 case 2: // half length_a36 case 3: // half length_a 27 37 return 0.5 * length_a; 28 case 3: // half length_b38 case 4: // half length_b 29 39 return 0.5 * length_a*b2a_ratio; 30 case 4: // half length_c40 case 5: // half length_c 31 41 return 0.5 * length_a*c2a_ratio; 32 case 5: // equivalent outer circular cross-section42 case 6: // equivalent outer circular cross-section 33 43 return length_a*sqrt(b2a_ratio/M_PI); 34 case 6: // half ab diagonal44 case 7: // half ab diagonal 35 45 return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio))); 36 case 7: // half diagonal46 case 8: // half diagonal 37 47 return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio) + square(c2a_ratio))); 38 48 }
Note: See TracChangeset
for help on using the changeset viewer.