Changeset ee60aa7 in sasmodels for sasmodels/models/hollow_cylinder.c
- Timestamp:
- Sep 10, 2018 4:16:46 PM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- d299327
- Parents:
- 3f818b2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/hollow_cylinder.c
rd277229 ree60aa7 15 15 } 16 16 17 // TODO: interface to form_volume/shell_volume not yet settled 18 static double 19 shell_volume(double *total, double radius, double thickness, double length) 20 { 21 *total = M_PI*length*square(radius+thickness); 22 return *total - M_PI*length*radius*radius; 23 } 24 17 25 static double 18 26 form_volume(double radius, double thickness, double length) 19 27 { 20 double v_shell = M_PI*length*(square(radius+thickness) - radius*radius);21 return v_shell;28 double total; 29 return shell_volume(&total, radius, thickness, length); 22 30 } 23 31 … … 38 46 effective_radius(int mode, double radius, double thickness, double length) 39 47 { 40 if (mode == 1) { 48 switch (mode) { 49 case 1: // equivalent sphere 41 50 return radius_from_volume(radius, thickness, length); 42 } else if (mode == 2) {51 case 2: // outer radius 43 52 return radius + thickness; 44 } else if (mode == 3) {53 case 3: // half length 45 54 return 0.5*length; 46 } else if (mode == 4) {55 case 4: // half outer min dimension 47 56 return (radius + thickness < 0.5*length ? radius + thickness : 0.5*length); 48 } else if (mode == 5) {57 case 5: // half outer max dimension 49 58 return (radius + thickness > 0.5*length ? radius + thickness : 0.5*length); 50 } else {59 case 6: // half outer diagonal 51 60 return radius_from_diagonal(radius,thickness,length); 52 61 }
Note: See TracChangeset
for help on using the changeset viewer.