Changeset 99658f6 in sasmodels for sasmodels/models/hollow_cylinder.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_cylinder.c
rd42dd4a r99658f6 11 11 { 12 12 return M_PI*length*square(radius+thickness); 13 } 14 15 static double 16 radius_from_excluded_volume(double radius, double thickness, double length) 17 { 18 const double radius_tot = radius + thickness; 19 return 0.5*cbrt(0.75*radius_tot*(2.0*radius_tot*length + (radius_tot + length)*(M_PI*radius_tot + length))); 13 20 } 14 21 … … 31 38 switch (mode) { 32 39 default: 33 case 1: // equivalent sphere 40 case 1: // excluded volume 41 return radius_from_excluded_volume(radius, thickness, length); 42 case 2: // equivalent volume sphere 34 43 return radius_from_volume(radius, thickness, length); 35 case 2: // outer radius44 case 3: // outer radius 36 45 return radius + thickness; 37 case 3: // half length46 case 4: // half length 38 47 return 0.5*length; 39 case 4: // half outer min dimension48 case 5: // half outer min dimension 40 49 return (radius + thickness < 0.5*length ? radius + thickness : 0.5*length); 41 case 5: // half outer max dimension50 case 6: // half outer max dimension 42 51 return (radius + thickness > 0.5*length ? radius + thickness : 0.5*length); 43 case 6: // half outer diagonal52 case 7: // half outer diagonal 44 53 return radius_from_diagonal(radius,thickness,length); 45 54 }
Note: See TracChangeset
for help on using the changeset viewer.