Changeset d277229 in sasmodels for sasmodels/models/capped_cylinder.c
- Timestamp:
- Sep 7, 2018 5:29:38 AM (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:
- 3c60146
- Parents:
- 2a12351b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/capped_cylinder.c
r71b751d rd277229 84 84 } 85 85 86 static double 87 radius_from_volume(double radius, double radius_cap, double length) 88 { 89 const double vol_cappedcyl = form_volume(radius,radius_cap,length); 90 return cbrt(0.75*vol_cappedcyl/M_PI); 91 } 92 93 static double 94 radius_from_totallength(double radius, double radius_cap, double length) 95 { 96 const double hc = radius_cap - sqrt(radius_cap*radius_cap - radius*radius); 97 return 0.5*length + hc; 98 } 99 100 static double 101 effective_radius(int mode, double radius, double radius_cap, double length) 102 { 103 if (mode == 1) { 104 return radius_from_volume(radius, radius_cap, length); 105 } else if (mode == 2) { 106 return radius; 107 } else if (mode == 3) { 108 return 0.5*length; 109 } else { 110 return radius_from_totallength(radius, radius_cap,length); 111 } 112 } 113 86 114 static void 87 115 Fq(double q,double *F1, double *F2, double sld, double solvent_sld,
Note: See TracChangeset
for help on using the changeset viewer.