Changeset e44432d in sasmodels for sasmodels/models/hollow_rectangular_prism.c
- Timestamp:
- Oct 19, 2018 5:46:26 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:
- be43e39
- Parents:
- 2586ab72
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/hollow_rectangular_prism.c
ree60aa7 re44432d 1 // TODO: interface to form_volume/shell_volume not yet settled2 1 static double 3 shell_volume(double *total, doublelength_a, double b2a_ratio, double c2a_ratio, double thickness)2 shell_volume(double length_a, double b2a_ratio, double c2a_ratio, double thickness) 4 3 { 5 double length_b = length_a * b2a_ratio;6 double length_c = length_a * c2a_ratio;7 double a_core = length_a - 2.0*thickness;8 double b_core = length_b- 2.0*thickness;9 double c_core = length_c- 2.0*thickness;10 double vol_core = a_core * b_core * c_core;11 *total = length_a * length_b * length_c;12 return *total - vol_core;4 const double length_b = length_a * b2a_ratio; 5 const double length_c = length_a * c2a_ratio; 6 const double form_volume = length_a * length_b * length_c; 7 const double a_core = length_a - 2.0*thickness; 8 const double b_core = length_b - 2.0*thickness; 9 const double c_core = length_c - 2.0*thickness; 10 const double core_volume = a_core * b_core * c_core; 11 return form_volume - core_volume; 13 12 } 14 13 … … 16 15 form_volume(double length_a, double b2a_ratio, double c2a_ratio, double thickness) 17 16 { 18 double total; 19 return shell_volume(&total, length_a, b2a_ratio, c2a_ratio, thickness); 17 const double length_b = length_a * b2a_ratio; 18 const double length_c = length_a * c2a_ratio; 19 const double form_volume = length_a * length_b * length_c; 20 return form_volume; 20 21 } 21 22 22 23 static double 23 24 effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio, double thickness) 24 //effective_radius_type = ["equivalent sphere","half length_a", "half length_b", "half length_c",25 // "equivalent outer circular cross-section","half ab diagonal","half diagonal"]26 25 // NOTE length_a is external dimension! 27 26 {
Note: See TracChangeset
for help on using the changeset viewer.