Changeset ee60aa7 in sasmodels for sasmodels/models/rectangular_prism.c


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/rectangular_prism.c

    rd277229 ree60aa7  
    88effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio) 
    99{ 
    10     if (mode == 1) { 
     10    switch (mode) { 
     11    case 1: // equivalent sphere 
    1112        return cbrt(0.75*cube(length_a)*b2a_ratio*c2a_ratio/M_PI); 
    12     } else if (mode == 2) { 
     13    case 2: // half length_a 
    1314        return 0.5 * length_a; 
    14     } else if (mode == 3) { 
     15    case 3: // half length_b 
    1516        return 0.5 * length_a*b2a_ratio; 
    16     } else if (mode == 4) { 
     17    case 4: // half length_c 
    1718        return 0.5 * length_a*c2a_ratio; 
    18     } else if (mode == 5) { 
     19    case 5: // equivalent circular cross-section 
    1920        return length_a*sqrt(b2a_ratio/M_PI); 
    20     } else if (mode == 6) { 
     21    case 6: // half ab diagonal 
    2122        return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio))); 
    22     } else { 
     23    case 7: // half diagonal 
    2324        return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio) + square(c2a_ratio))); 
    2425    } 
Note: See TracChangeset for help on using the changeset viewer.