Ignore:
Timestamp:
Sep 10, 2018 4:16:46 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

clean up effective radius functions; improve mono_gauss_coil accuracy; start moving VR into C

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_parallelepiped.c

    ra94046f ree60aa7  
    3131                   double thick_rim_a, double thick_rim_b, double thick_rim_c) 
    3232{ 
    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); 
    3535} 
    3636 
     
    4545effective_radius(int mode, double length_a, double length_b, double length_c, 
    4646                 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 here 
    50 // in the equvalent sphere option 
    5147{ 
    52     if (mode == 1) { 
     48    switch (mode) { 
     49    case 1: // equivalent sphere 
    5350        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 
    5552        return 0.5 * length_a + thick_rim_a; 
    56     } else if (mode == 3) { 
     53    case 3: // half outer length b 
    5754        return 0.5 * length_b + thick_rim_b; 
    58     } else if (mode == 4) { 
     55    case 4: // half outer length c 
    5956        return 0.5 * length_c + thick_rim_c; 
    60     } else if (mode == 5) { 
     57    case 5: // equivalent circular cross-section 
    6158        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 
    6360        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 
    6562        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)); 
    6663    } 
Note: See TracChangeset for help on using the changeset viewer.