Changeset 44e8a93 in sasmodels


Ignore:
Timestamp:
Apr 8, 2017 6:05:01 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
85190c2
Parents:
f3073b0
Message:

core_shell_bicelle_elliptical: use consistent variable names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_bicelle_elliptical.c

    rf4f85b3 r44e8a93  
    1 double form_volume(double radius, double x_core, double thick_rim, double thick_face, double length); 
    2 double Iq(double q, 
    3           double radius, 
    4           double x_core, 
    5           double thick_rim, 
    6           double thick_face, 
    7           double length, 
    8           double core_sld, 
    9           double face_sld, 
    10           double rim_sld, 
    11           double solvent_sld); 
    12  
    13  
    14 double Iqxy(double qx, double qy, 
    15           double radius, 
    16           double x_core, 
    17           double thick_rim, 
    18           double thick_face, 
    19           double length, 
    20           double core_sld, 
    21           double face_sld, 
    22           double rim_sld, 
    23           double solvent_sld, 
    24           double theta, 
    25           double phi, 
    26           double psi); 
    27  
    281// NOTE that "length" here is the full height of the core! 
    29 double form_volume(double radius, double x_core, double thick_rim, double thick_face, double length) 
     2static double 
     3form_volume(double r_minor, 
     4        double x_core, 
     5        double thick_rim, 
     6        double thick_face, 
     7        double length) 
    308{ 
    31     return M_PI*(radius+thick_rim)*(radius*x_core+thick_rim)*(length+2.0*thick_face); 
     9    return M_PI*(r_minor+thick_rim)*(r_minor*x_core+thick_rim)*(length+2.0*thick_face); 
    3210} 
    3311 
    34 double Iq(double q, 
    35           double rad, 
    36           double x_core, 
    37           double radthick, 
    38           double facthick, 
    39           double length, 
    40           double rhoc, 
    41           double rhoh, 
    42           double rhor, 
    43           double rhosolv) 
     12static double 
     13Iq(double q, 
     14        double r_minor, 
     15        double x_core, 
     16        double thick_rim, 
     17        double thick_face, 
     18        double length, 
     19        double rhoc, 
     20        double rhoh, 
     21        double rhor, 
     22        double rhosolv) 
    4423{ 
    4524    double si1,si2,be1,be2; 
     
    5433    //const double vbj=M_PI; 
    5534 
    56     const double radius_major = rad * x_core; 
    57     const double rA = 0.5*(square(radius_major) + square(rad)); 
    58     const double rB = 0.5*(square(radius_major) - square(rad)); 
    59     const double dr1 = (rhoc-rhoh)   *M_PI*rad*radius_major*(2.0*halfheight);; 
    60     const double dr2 = (rhor-rhosolv)*M_PI*(rad+radthick)*(radius_major+radthick)*2.0*(halfheight+facthick); 
    61     const double dr3 = (rhoh-rhor)   *M_PI*rad*radius_major*2.0*(halfheight+facthick); 
    62     //const double vol1 = M_PI*rad*radius_major*(2.0*halfheight); 
    63     //const double vol2 = M_PI*(rad+radthick)*(radius_major+radthick)*2.0*(halfheight+facthick); 
    64     //const double vol3 = M_PI*rad*radius_major*2.0*(halfheight+facthick); 
     35    const double r_major = r_minor * x_core; 
     36    const double rA = 0.5*(square(r_major) + square(r_minor)); 
     37    const double rB = 0.5*(square(r_major) - square(r_minor)); 
     38    const double dr1 = (rhoc-rhoh)   *M_PI*r_minor*r_major*(2.0*halfheight);; 
     39    const double dr2 = (rhor-rhosolv)*M_PI*(r_minor+thick_rim)*(r_major+thick_rim)*2.0*(halfheight+thick_face); 
     40    const double dr3 = (rhoh-rhor)   *M_PI*r_minor*r_major*2.0*(halfheight+thick_face); 
     41    //const double vol1 = M_PI*r_minor*r_major*(2.0*halfheight); 
     42    //const double vol2 = M_PI*(r_minor+thick_rim)*(r_major+thick_rim)*2.0*(halfheight+thick_face); 
     43    //const double vol3 = M_PI*r_minor*r_major*2.0*(halfheight+thick_face); 
    6544 
    6645    //initialize integral 
     
    7453        double inner_sum=0; 
    7554        double sinarg1 = q*halfheight*cos_alpha; 
    76         double sinarg2 = q*(halfheight+facthick)*cos_alpha; 
     55        double sinarg2 = q*(halfheight+thick_face)*cos_alpha; 
    7756        si1 = sas_sinx_x(sinarg1); 
    7857        si2 = sas_sinx_x(sinarg2); 
     
    8362            const double rr = sqrt(rA - rB*cos(beta)); 
    8463            double besarg1 = q*rr*sin_alpha; 
    85             double besarg2 = q*(rr+radthick)*sin_alpha; 
     64            double besarg2 = q*(rr+thick_rim)*sin_alpha; 
    8665            be1 = sas_2J1x_x(besarg1); 
    8766            be2 = sas_2J1x_x(besarg2); 
     
    9776} 
    9877 
    99 double  
     78static double 
    10079Iqxy(double qx, double qy, 
    101           double rad, 
     80          double r_minor, 
    10281          double x_core, 
    103           double radthick, 
    104           double facthick, 
     82          double thick_rim, 
     83          double thick_face, 
    10584          double length, 
    10685          double rhoc, 
     
    11897    const double dr2 = rhor-rhosolv; 
    11998    const double dr3 = rhoh-rhor; 
    120     const double radius_major = rad*x_core; 
     99    const double r_major = r_minor*x_core; 
    121100    const double halfheight = 0.5*length; 
    122     const double vol1 = M_PI*rad*radius_major*length; 
    123     const double vol2 = M_PI*(rad+radthick)*(radius_major+radthick)*2.0*(halfheight+facthick); 
    124     const double vol3 = M_PI*rad*radius_major*2.0*(halfheight+facthick); 
     101    const double vol1 = M_PI*r_minor*r_major*length; 
     102    const double vol2 = M_PI*(r_minor+thick_rim)*(r_major+thick_rim)*2.0*(halfheight+thick_face); 
     103    const double vol3 = M_PI*r_minor*r_major*2.0*(halfheight+thick_face); 
    125104 
    126     // Compute:  r = sqrt((radius_major*zhat)^2 + (radius_minor*yhat)^2) 
    127     // Given:    radius_major = r_ratio * radius_minor   
    128     // ASSUME the sin_alpha is included in the separate integration over orientation of rod angle 
    129     const double rad_minor = rad; 
    130     const double rad_major = rad*x_core; 
    131     const double r_hat = sqrt(square(rad_major*xhat) + square(rad_minor*yhat)); 
    132     const double rshell_hat = sqrt(square((rad_major+radthick)*xhat) 
    133                                    + square((rad_minor+radthick)*yhat)); 
     105    // Compute effective radius in rotated coordinates 
     106    const double r_hat = sqrt(square(r_major*xhat) + square(r_minor*yhat)); 
     107    const double rshell_hat = sqrt(square((r_major+thick_rim)*xhat) 
     108                                   + square((r_minor+thick_rim)*yhat)); 
    134109    const double be1 = sas_2J1x_x( q*r_hat ); 
    135110    const double be2 = sas_2J1x_x( q*rshell_hat ); 
    136111    const double si1 = sas_sinx_x( q*halfheight*zhat ); 
    137     const double si2 = sas_sinx_x( q*(halfheight + facthick)*zhat ); 
     112    const double si2 = sas_sinx_x( q*(halfheight + thick_face)*zhat ); 
    138113    const double Aq = square( vol1*dr1*si1*be1 + vol2*dr2*si2*be2 +  vol3*dr3*si2*be1); 
    139     //const double vol = form_volume(radius_minor, r_ratio, length); 
    140114    return 1.0e-4 * Aq; 
    141115} 
Note: See TracChangeset for help on using the changeset viewer.