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


Ignore:
Timestamp:
Sep 30, 2016 11:07:16 AM (8 years ago)
Author:
butler
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
a807206
Parents:
6e5b2a7
Message:

Updating parameter names regarding #649

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/barbell.c

    r2f5c6d4 r2222134  
    1 double form_volume(double bell_radius, double radius, double length); 
     1double form_volume(double radius_bell, double radius, double length); 
    22double Iq(double q, double sld, double solvent_sld, 
    3         double bell_radius, double radius, double length); 
     3        double radius_bell, double radius, double length); 
    44double Iqxy(double qx, double qy, double sld, double solvent_sld, 
    5         double bell_radius, double radius, double length, 
     5        double radius_bell, double radius, double length, 
    66        double theta, double phi); 
    77 
    8 #define INVALID(v) (v.bell_radius < v.radius) 
     8#define INVALID(v) (v.radius_bell < v.radius) 
    99 
    1010//barbell kernel - same as dumbell 
    1111static double 
    12 _bell_kernel(double q, double h, double bell_radius, 
     12_bell_kernel(double q, double h, double radius_bell, 
    1313             double half_length, double sin_alpha, double cos_alpha) 
    1414{ 
    1515    // translate a point in [-1,1] to a point in [lower,upper] 
    1616    const double upper = 1.0; 
    17     const double lower = h/bell_radius; 
     17    const double lower = h/radius_bell; 
    1818    const double zm = 0.5*(upper-lower); 
    1919    const double zb = 0.5*(upper+lower); 
     
    2626    //    m = q R cos(alpha) 
    2727    //    b = q(L/2-h) cos(alpha) 
    28     const double m = q*bell_radius*cos_alpha; // cos argument slope 
     28    const double m = q*radius_bell*cos_alpha; // cos argument slope 
    2929    const double b = q*(half_length-h)*cos_alpha; // cos argument intercept 
    30     const double qrst = q*bell_radius*sin_alpha; // Q*R*sin(theta) 
     30    const double qrst = q*radius_bell*sin_alpha; // Q*R*sin(theta) 
    3131    double total = 0.0; 
    3232    for (int i = 0; i < 76; i++){ 
     
    3939    // translate dx in [-1,1] to dx in [lower,upper] 
    4040    const double integral = total*zm; 
    41     const double bell_Fq = 2*M_PI*cube(bell_radius)*integral; 
     41    const double bell_Fq = 2*M_PI*cube(radius_bell)*integral; 
    4242    return bell_Fq; 
    4343} 
    4444 
    45 double form_volume(double bell_radius, 
     45double form_volume(double radius_bell, 
    4646        double radius, 
    4747        double length) 
     
    4949 
    5050    // bell radius should never be less than radius when this is called 
    51     const double hdist = sqrt(square(bell_radius) - square(radius)); 
    52     const double p1 = 2.0/3.0*cube(bell_radius); 
    53     const double p2 = square(bell_radius)*hdist; 
     51    const double hdist = sqrt(square(radius_bell) - square(radius)); 
     52    const double p1 = 2.0/3.0*cube(radius_bell); 
     53    const double p2 = square(radius_bell)*hdist; 
    5454    const double p3 = cube(hdist)/3.0; 
    5555 
     
    5858 
    5959double Iq(double q, double sld, double solvent_sld, 
    60           double bell_radius, double radius, double length) 
     60          double radius_bell, double radius, double length) 
    6161{ 
    62     const double h = -sqrt(bell_radius*bell_radius - radius*radius); 
     62    const double h = -sqrt(radius_bell*radius_bell - radius*radius); 
    6363    const double half_length = 0.5*length; 
    6464 
     
    7272        SINCOS(alpha, sin_alpha, cos_alpha); 
    7373 
    74         const double bell_Fq = _bell_kernel(q, h, bell_radius, half_length, sin_alpha, cos_alpha); 
     74        const double bell_Fq = _bell_kernel(q, h, radius_bell, half_length, sin_alpha, cos_alpha); 
    7575        const double bj = sas_J1c(q*radius*sin_alpha); 
    7676        const double si = sinc(q*half_length*cos_alpha); 
     
    9090double Iqxy(double qx, double qy, 
    9191        double sld, double solvent_sld, 
    92         double bell_radius, double radius, double length, 
     92        double radius_bell, double radius, double length, 
    9393        double theta, double phi) 
    9494{ 
     
    100100    const double alpha = acos(cos_val); // rod angle relative to q 
    101101 
    102     const double h = -sqrt(square(bell_radius) - square(radius)); 
     102    const double h = -sqrt(square(radius_bell) - square(radius)); 
    103103    const double half_length = 0.5*length; 
    104104 
    105105    double sin_alpha, cos_alpha; // slots to hold sincos function output 
    106106    SINCOS(alpha, sin_alpha, cos_alpha); 
    107     const double bell_Fq = _bell_kernel(q, h, bell_radius, half_length, sin_alpha, cos_alpha); 
     107    const double bell_Fq = _bell_kernel(q, h, radius_bell, half_length, sin_alpha, cos_alpha); 
    108108    const double bj = sas_J1c(q*radius*sin_alpha); 
    109109    const double si = sinc(q*half_length*cos_alpha); 
Note: See TracChangeset for help on using the changeset viewer.