Changeset d277229 in sasmodels for sasmodels/models/barbell.c


Ignore:
Timestamp:
Sep 7, 2018 3:29:38 AM (6 years ago)
Author:
grethevj
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3c60146
Parents:
2a12351b
Message:

Models updated to include choices for effective interaction radii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/barbell.c

    r71b751d rd277229  
    6262} 
    6363 
     64static double 
     65radius_from_volume(double radius_bell, double radius, double length) 
     66{ 
     67    const double vol_barbell = form_volume(radius_bell,radius,length); 
     68    return cbrt(0.75*vol_barbell/M_PI); 
     69} 
     70 
     71static double 
     72radius_from_totallength(double radius_bell, double radius, double length) 
     73{ 
     74    const double hdist = sqrt(square(radius_bell) - square(radius)); 
     75    return 0.5*length + hdist + radius_bell; 
     76} 
     77 
     78static double 
     79effective_radius(int mode, double radius_bell, double radius, double length) 
     80{ 
     81    if (mode == 1) { 
     82        return radius_from_volume(radius_bell, radius , length); 
     83    } else if (mode == 2) { 
     84        return radius; 
     85    } else if (mode == 3) { 
     86        return 0.5*length; 
     87    } else { 
     88        return radius_from_totallength(radius_bell,radius,length); 
     89    } 
     90} 
     91 
    6492static void 
    6593Fq(double q,double *F1, double *F2, double sld, double solvent_sld, 
Note: See TracChangeset for help on using the changeset viewer.