Changeset 99658f6 in sasmodels for sasmodels/models/hollow_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/hollow_rectangular_prism.c
rd42dd4a r99658f6 22 22 23 23 static double 24 radius_from_excluded_volume(double length_a, double b2a_ratio, double c2a_ratio) 25 { 26 const double r_equiv = sqrt(length_a*length_a*b2a_ratio/M_PI); 27 const double length_c = length_a*c2a_ratio; 28 return 0.5*cbrt(0.75*r_equiv*(2.0*r_equiv*length_c + (r_equiv + length_c)*(M_PI*r_equiv + length_c))); 29 } 30 31 static double 24 32 effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio, double thickness) 25 33 // NOTE length_a is external dimension! … … 27 35 switch (mode) { 28 36 default: 29 case 1: // equivalent sphere 37 case 1: // equivalent cylinder excluded volume 38 return radius_from_excluded_volume(length_a, b2a_ratio, c2a_ratio); 39 case 2: // equivalent outer volume sphere 30 40 return cbrt(cube(length_a)*b2a_ratio*c2a_ratio/M_4PI_3); 31 case 2: // half length_a41 case 3: // half length_a 32 42 return 0.5 * length_a; 33 case 3: // half length_b43 case 4: // half length_b 34 44 return 0.5 * length_a*b2a_ratio; 35 case 4: // half length_c45 case 5: // half length_c 36 46 return 0.5 * length_a*c2a_ratio; 37 case 5: // equivalent outer circular cross-section47 case 6: // equivalent outer circular cross-section 38 48 return length_a*sqrt(b2a_ratio/M_PI); 39 case 6: // half ab diagonal49 case 7: // half ab diagonal 40 50 return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio))); 41 case 7: // half diagonal51 case 8: // half diagonal 42 52 return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio) + square(c2a_ratio))); 43 53 }
Note: See TracChangeset
for help on using the changeset viewer.