Changeset ee60aa7 in sasmodels for sasmodels/models/core_shell_parallelepiped.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/core_shell_parallelepiped.c
ra94046f ree60aa7 31 31 double thick_rim_a, double thick_rim_b, double thick_rim_c) 32 32 { 33 const double volume _paral= form_volume(length_a, length_b, length_c, thick_rim_a, thick_rim_b, thick_rim_c);34 return cbrt( 0.75*volume_paral/M_PI);33 const double volume = form_volume(length_a, length_b, length_c, thick_rim_a, thick_rim_b, thick_rim_c); 34 return cbrt(volume/M_4PI_3); 35 35 } 36 36 … … 45 45 effective_radius(int mode, double length_a, double length_b, double length_c, 46 46 double thick_rim_a, double thick_rim_b, double thick_rim_c) 47 //effective_radius_type = ["equivalent sphere","half outer length_a", "half outer length_b", "half outer length_c",48 // "equivalent circular cross-section","half outer ab diagonal","half outer diagonal"]49 // note the core box is A*B*C with slabs ta, tb & tc on each face but missing the corners, though that fact is ignored here50 // in the equvalent sphere option51 47 { 52 if (mode == 1) { 48 switch (mode) { 49 case 1: // equivalent sphere 53 50 return radius_from_volume(length_a, length_b, length_c, thick_rim_a, thick_rim_b, thick_rim_c); 54 } else if (mode == 2) {51 case 2: // half outer length a 55 52 return 0.5 * length_a + thick_rim_a; 56 } else if (mode == 3) {53 case 3: // half outer length b 57 54 return 0.5 * length_b + thick_rim_b; 58 } else if (mode == 4) {55 case 4: // half outer length c 59 56 return 0.5 * length_c + thick_rim_c; 60 } else if (mode == 5) {57 case 5: // equivalent circular cross-section 61 58 return radius_from_crosssection(length_a, length_b, thick_rim_a, thick_rim_b); 62 } else if (mode == 6) {59 case 6: // half outer ab diagonal 63 60 return 0.5*sqrt(square(length_a+ 2.0*thick_rim_a) + square(length_b+ 2.0*thick_rim_b)); 64 } else {61 case 7: // half outer diagonal 65 62 return 0.5*sqrt(square(length_a+ 2.0*thick_rim_a) + square(length_b+ 2.0*thick_rim_b) + square(length_c+ 2.0*thick_rim_c)); 66 63 }
Note: See TracChangeset
for help on using the changeset viewer.