Ignore:
Timestamp:
Sep 10, 2018 2: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/hollow_rectangular_prism_thin_walls.c

    rd277229 ree60aa7  
     1// TODO: interface to form_volume/shell_volume not yet settled 
    12static double 
    2 form_volume(double length_a, double b2a_ratio, double c2a_ratio) 
     3shell_volume(double *total, double length_a, double b2a_ratio, double c2a_ratio) 
    34{ 
    45    double length_b = length_a * b2a_ratio; 
    56    double length_c = length_a * c2a_ratio; 
    67    double vol_shell = 2.0 * (length_a*length_b + length_a*length_c + length_b*length_c); 
     8    *total = length_a * length_b * length_c; 
    79    return vol_shell; 
    810} 
    911 
    1012static double 
     13form_volume(double length_a, double b2a_ratio, double c2a_ratio) 
     14{ 
     15    double total; 
     16    return shell_volume(&total, length_a, b2a_ratio, c2a_ratio); 
     17} 
     18 
     19 
     20static double 
    1121effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio) 
    1222{ 
    13     if (mode == 1) { 
     23    switch (mode) { 
     24    case 1: // equivalent sphere 
    1425        return cbrt(0.75*cube(length_a)*b2a_ratio*c2a_ratio/M_PI); 
    15     } else if (mode == 2) { 
     26    case 2: // half length_a 
    1627        return 0.5 * length_a; 
    17     } else if (mode == 3) { 
     28    case 3: // half length_b 
    1829        return 0.5 * length_a*b2a_ratio; 
    19     } else if (mode == 4) { 
     30    case 4: // half length_c 
    2031        return 0.5 * length_a*c2a_ratio; 
    21     } else if (mode == 5) { 
     32    case 5: // equivalent outer circular cross-section 
    2233        return length_a*sqrt(b2a_ratio/M_PI); 
    23     } else if (mode == 6) { 
     34    case 6: // half ab diagonal 
    2435        return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio))); 
    25     } else { 
     36    case 7: // half diagonal 
    2637        return 0.5*sqrt(square(length_a) * (1.0 + square(b2a_ratio) + square(c2a_ratio))); 
    2738    } 
Note: See TracChangeset for help on using the changeset viewer.