Changeset 99658f6 in sasmodels for sasmodels/models/barbell.c
- Timestamp:
- Nov 6, 2018 4: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/barbell.c
rd42dd4a r99658f6 63 63 64 64 static double 65 radius_from_excluded_volume(double radius_bell, double radius, double length) 66 { 67 const double hdist = sqrt(square(radius_bell) - square(radius)); 68 const double length_tot = length + 2.0*(hdist+ radius); 69 return 0.5*cbrt(0.75*radius_bell*(2.0*radius_bell*length_tot + (radius_bell + length_tot)*(M_PI*radius_bell + length_tot))); 70 } 71 72 static double 65 73 radius_from_volume(double radius_bell, double radius, double length) 66 74 { … … 81 89 switch (mode) { 82 90 default: 83 case 1: // equivalent sphere 91 case 1: // equivalent cylinder excluded volume 92 return radius_from_excluded_volume(radius_bell, radius , length); 93 case 2: // equivalent volume sphere 84 94 return radius_from_volume(radius_bell, radius , length); 85 case 2: // radius95 case 3: // radius 86 96 return radius; 87 case 3: // half length97 case 4: // half length 88 98 return 0.5*length; 89 case 4: // half total length99 case 5: // half total length 90 100 return radius_from_totallength(radius_bell,radius,length); 91 101 }
Note: See TracChangeset
for help on using the changeset viewer.