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


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

    rfbaef04 ree60aa7  
    3535static double 
    3636effective_radius(int mode, double radius_minor, double r_ratio, double length) 
    37 //effective_radius_type = ["equivalent sphere","average radius","min radius","max radius", 
    38 //                         "equivalent circular cross-section","half length","half min dimension","half max dimension","half diagonal"] 
    3937{ 
    40     if (mode == 1) { 
     38    switch (mode) { 
     39    case 1: // equivalent sphere 
    4140        return radius_from_volume(radius_minor, r_ratio, length); 
    42     } else if (mode == 2) { 
     41    case 2: // average radius 
    4342        return 0.5*radius_minor*(1.0 + r_ratio); 
    44     } else if (mode == 3) { 
     43    case 3: // min radius 
    4544        return (r_ratio > 1.0 ? radius_minor : r_ratio*radius_minor); 
    46     } else if (mode == 4) { 
     45    case 4: // max radius 
    4746        return (r_ratio < 1.0 ? radius_minor : r_ratio*radius_minor); 
    48     } else if (mode == 5) { 
     47    case 5: // equivalent circular cross-section 
    4948        return sqrt(radius_minor*radius_minor*r_ratio); 
    50     } else if (mode == 6) { 
     49    case 6: // half length 
    5150        return 0.5*length; 
    52     } else if (mode == 7) { 
     51    case 7: // half min dimension 
    5352        return radius_from_min_dimension(radius_minor,r_ratio,0.5*length); 
    54     } else if (mode == 8) { 
     53    case 8: // half max dimension 
    5554        return radius_from_max_dimension(radius_minor,r_ratio,0.5*length); 
    56     } else { 
     55    case 9: // half diagonal 
    5756        return radius_from_diagonal(radius_minor,r_ratio,length); 
    5857    } 
Note: See TracChangeset for help on using the changeset viewer.