Changeset becded3 in sasmodels for sasmodels/models


Ignore:
Timestamp:
Oct 17, 2017 4:21:27 PM (7 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:
8698a0d
Parents:
2a602c7
Message:

update oriented models to new interface (which will be in the next commit)

Location:
sasmodels/models
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/barbell.c

    r2a0b2b1 rbecded3  
    1 double form_volume(double radius_bell, double radius, double length); 
    2 double Iq(double q, double sld, double solvent_sld, 
    3         double radius_bell, double radius, double length); 
    4 double Iqxy(double qx, double qy, double sld, double solvent_sld, 
    5         double radius_bell, double radius, double length, 
    6         double theta, double phi); 
    7  
    81#define INVALID(v) (v.radius_bell < v.radius) 
    92 
     
    5548} 
    5649 
    57  
    58 double form_volume(double radius_bell, 
    59         double radius, 
    60         double length) 
     50static double 
     51form_volume(double radius_bell, 
     52    double radius, 
     53    double length) 
    6154{ 
    6255    // bell radius should never be less than radius when this is called 
     
    6962} 
    7063 
    71 double Iq(double q, double sld, double solvent_sld, 
    72           double radius_bell, double radius, double length) 
     64static double 
     65Iq(double q, double sld, double solvent_sld, 
     66    double radius_bell, double radius, double length) 
    7367{ 
    7468    const double h = -sqrt(radius_bell*radius_bell - radius*radius); 
     
    9589 
    9690 
    97 double Iqxy(double qx, double qy, 
    98         double sld, double solvent_sld, 
    99         double radius_bell, double radius, double length, 
    100         double theta, double phi) 
     91static double 
     92Iqxy(double qab, double qc, 
     93    double sld, double solvent_sld, 
     94    double radius_bell, double radius, double length) 
    10195{ 
    102     double q, sin_alpha, cos_alpha; 
    103     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    104     const double qab = q*sin_alpha; 
    105     const double qc = q*cos_alpha; 
    106  
    10796    const double h = -sqrt(square(radius_bell) - square(radius)); 
    10897    const double Aq = _fq(qab, qc, h, radius_bell, radius, 0.5*length); 
  • sasmodels/models/bcc_paracrystal.c

    r7e0b281 rbecded3  
    5454 
    5555static double Iq(double q, double dnn, 
    56   double d_factor, double radius, 
    57   double sld, double solvent_sld) 
     56    double d_factor, double radius, 
     57    double sld, double solvent_sld) 
    5858{ 
    5959    // translate a point in [-1,1] to a point in [0, 2 pi] 
     
    9191 
    9292 
    93 static double Iqxy(double qx, double qy, 
     93static double Iqxy(double qa, double qb, double qc, 
    9494    double dnn, double d_factor, double radius, 
    95     double sld, double solvent_sld, 
    96     double theta, double phi, double psi) 
     95    double sld, double solvent_sld) 
    9796{ 
    98     double q, zhat, yhat, xhat; 
    99     ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 
    100     const double qa = q*xhat; 
    101     const double qb = q*yhat; 
    102     const double qc = q*zhat; 
    103  
    104     q = sqrt(qa*qa + qb*qb + qc*qc); 
     97    const double q = sqrt(qa*qa + qb*qb + qc*qc); 
    10598    const double Zq = bcc_Zq(qa, qb, qc, dnn, d_factor); 
    10699    const double Pq = sphere_form(q, radius, sld, solvent_sld); 
  • sasmodels/models/capped_cylinder.c

    r2a0b2b1 rbecded3  
    1 double form_volume(double radius, double radius_cap, double length); 
    2 double Iq(double q, double sld, double solvent_sld, 
    3     double radius, double radius_cap, double length); 
    4 double Iqxy(double qx, double qy, double sld, double solvent_sld, 
    5     double radius, double radius_cap, double length, double theta, double phi); 
    6  
    71#define INVALID(v) (v.radius_cap < v.radius) 
    82 
     
    1711static double 
    1812_cap_kernel(double qab, double qc, double h, double radius_cap, 
    19             double half_length) 
     13    double half_length) 
    2014{ 
    2115    // translate a point in [-1,1] to a point in [lower,upper] 
     
    6054} 
    6155 
    62 double form_volume(double radius, double radius_cap, double length) 
     56static double 
     57form_volume(double radius, double radius_cap, double length) 
    6358{ 
    6459    // cap radius should never be less than radius when this is called 
     
    8984} 
    9085 
    91 double Iq(double q, double sld, double solvent_sld, 
    92           double radius, double radius_cap, double length) 
     86static double 
     87Iq(double q, double sld, double solvent_sld, 
     88    double radius, double radius_cap, double length) 
    9389{ 
    9490    const double h = sqrt(radius_cap*radius_cap - radius*radius); 
     
    118114 
    119115 
    120 double Iqxy(double qx, double qy, 
     116static double 
     117Iqxy(double qab, double qc, 
    121118    double sld, double solvent_sld, double radius, 
    122     double radius_cap, double length, 
    123     double theta, double phi) 
     119    double radius_cap, double length) 
    124120{ 
    125     double q, sin_alpha, cos_alpha; 
    126     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    127     const double qab = q*sin_alpha; 
    128     const double qc = q*cos_alpha; 
    129  
    130121    const double h = sqrt(radius_cap*radius_cap - radius*radius); 
    131122    const double Aq = _fq(qab, qc, h, radius_cap, radius, 0.5*length); 
  • sasmodels/models/core_shell_bicelle.c

    r2a0b2b1 rbecded3  
    6767 
    6868static double 
    69 Iqxy(double qx, double qy, 
     69Iqxy(double qab, double qc, 
    7070    double radius, 
    7171    double thick_rim, 
     
    7575    double face_sld, 
    7676    double rim_sld, 
    77     double solvent_sld, 
    78     double theta, 
    79     double phi) 
     77    double solvent_sld) 
    8078{ 
    81     double q, sin_alpha, cos_alpha; 
    82     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    83     const double qab = q*sin_alpha; 
    84     const double qc = q*cos_alpha; 
    85  
    8679    double fq = bicelle_kernel(qab, qc, radius, thick_rim, thick_face, 
    8780                           0.5*length, core_sld, face_sld, rim_sld, 
  • sasmodels/models/core_shell_bicelle_elliptical.c

    r2a0b2b1 rbecded3  
    22static double 
    33form_volume(double r_minor, 
    4         double x_core, 
    5         double thick_rim, 
    6         double thick_face, 
    7         double length) 
     4    double x_core, 
     5    double thick_rim, 
     6    double thick_face, 
     7    double length) 
    88{ 
    99    return M_PI*(r_minor+thick_rim)*(r_minor*x_core+thick_rim)*(length+2.0*thick_face); 
     
    1212static double 
    1313Iq(double q, 
    14         double r_minor, 
    15         double x_core, 
    16         double thick_rim, 
    17         double thick_face, 
    18         double length, 
    19         double sld_core, 
    20         double sld_face, 
    21         double sld_rim, 
    22         double sld_solvent) 
     14    double r_minor, 
     15    double x_core, 
     16    double thick_rim, 
     17    double thick_face, 
     18    double length, 
     19    double sld_core, 
     20    double sld_face, 
     21    double sld_rim, 
     22    double sld_solvent) 
    2323{ 
    2424     // core_shell_bicelle_elliptical, RKH Dec 2016, based on elliptical_cylinder and core_shell_bicelle 
     
    7171 
    7272static double 
    73 Iqxy(double qx, double qy, 
    74           double r_minor, 
    75           double x_core, 
    76           double thick_rim, 
    77           double thick_face, 
    78           double length, 
    79           double sld_core, 
    80           double sld_face, 
    81           double sld_rim, 
    82           double sld_solvent, 
    83           double theta, 
    84           double phi, 
    85           double psi) 
     73Iqxy(double qa, double qb, double qc, 
     74    double r_minor, 
     75    double x_core, 
     76    double thick_rim, 
     77    double thick_face, 
     78    double length, 
     79    double sld_core, 
     80    double sld_face, 
     81    double sld_rim, 
     82    double sld_solvent) 
    8683{ 
    87     double q, xhat, yhat, zhat; 
    88     ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 
    89     const double qa = q*xhat; 
    90     const double qb = q*yhat; 
    91     const double qc = q*zhat; 
    92  
    9384    const double dr1 = sld_core-sld_face; 
    9485    const double dr2 = sld_rim-sld_solvent; 
  • sasmodels/models/core_shell_cylinder.c

    r2a0b2b1 rbecded3  
    4848 
    4949 
    50 double Iqxy(double qx, double qy, 
     50double Iqxy(double qab, double qc, 
    5151    double core_sld, 
    5252    double shell_sld, 
     
    5454    double radius, 
    5555    double thickness, 
    56     double length, 
    57     double theta, 
    58     double phi) 
     56    double length) 
    5957{ 
    60     double q, sin_alpha, cos_alpha; 
    61     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    62     const double qab = q*sin_alpha; 
    63     const double qc = q*cos_alpha; 
    64  
    6558    const double core_r = radius; 
    6659    const double core_h = 0.5*length; 
  • sasmodels/models/core_shell_ellipsoid.c

    r2a0b2b1 rbecded3  
    7575 
    7676static double 
    77 Iqxy(double qx, double qy, 
     77Iqxy(double qab, double qc, 
    7878    double radius_equat_core, 
    7979    double x_core, 
     
    8282    double core_sld, 
    8383    double shell_sld, 
    84     double solvent_sld, 
    85     double theta, 
    86     double phi) 
     84    double solvent_sld) 
    8785{ 
    88     double q, sin_alpha, cos_alpha; 
    89     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    90     const double qab = q*sin_alpha; 
    91     const double qc = q*cos_alpha; 
    92  
    9386    const double sld_core_shell = core_sld - shell_sld; 
    9487    const double sld_shell_solvent = shell_sld - solvent_sld; 
  • sasmodels/models/core_shell_parallelepiped.c

    r2a0b2b1 rbecded3  
    1 double form_volume(double length_a, double length_b, double length_c, 
    2                    double thick_rim_a, double thick_rim_b, double thick_rim_c); 
    3 double Iq(double q, double core_sld, double arim_sld, double brim_sld, double crim_sld, 
    4           double solvent_sld, double length_a, double length_b, double length_c, 
    5           double thick_rim_a, double thick_rim_b, double thick_rim_c); 
    6 double Iqxy(double qx, double qy, double core_sld, double arim_sld, double brim_sld, 
    7             double crim_sld, double solvent_sld, double length_a, double length_b, 
    8             double length_c, double thick_rim_a, double thick_rim_b, 
    9             double thick_rim_c, double theta, double phi, double psi); 
    10  
    11 double form_volume(double length_a, double length_b, double length_c, 
    12                    double thick_rim_a, double thick_rim_b, double thick_rim_c) 
     1static double 
     2form_volume(double length_a, double length_b, double length_c, 
     3    double thick_rim_a, double thick_rim_b, double thick_rim_c) 
    134{ 
    145    //return length_a * length_b * length_c; 
     
    1910} 
    2011 
    21 double Iq(double q, 
     12static double 
     13Iq(double q, 
    2214    double core_sld, 
    2315    double arim_sld, 
     
    118110} 
    119111 
    120 double Iqxy(double qx, double qy, 
     112static double 
     113Iqxy(double qa, double qb, double qc, 
    121114    double core_sld, 
    122115    double arim_sld, 
     
    129122    double thick_rim_a, 
    130123    double thick_rim_b, 
    131     double thick_rim_c, 
    132     double theta, 
    133     double phi, 
    134     double psi) 
     124    double thick_rim_c) 
    135125{ 
    136     double q, zhat, yhat, xhat; 
    137     ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 
    138     const double qa = q*xhat; 
    139     const double qb = q*yhat; 
    140     const double qc = q*zhat; 
    141  
    142126    // cspkernel in csparallelepiped recoded here 
    143127    const double dr0 = core_sld-solvent_sld; 
  • sasmodels/models/cylinder.c

    rb34fc77 rbecded3  
    4545 
    4646static double 
    47 Iqxy(double qx, double qy, 
     47Iqxy(double qab, double qc, 
    4848    double sld, 
    4949    double solvent_sld, 
    5050    double radius, 
    51     double length, 
    52     double theta, 
    53     double phi) 
     51    double length) 
    5452{ 
    55     double q, sin_alpha, cos_alpha; 
    56     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    57     const double qab = q*sin_alpha; 
    58     const double qc = q*cos_alpha; 
    59  
    6053    const double s = (sld-solvent_sld) * form_volume(radius, length); 
    6154    const double form = fq(qab, qc, radius, length); 
  • sasmodels/models/ellipsoid.c

    r2a0b2b1 rbecded3  
    3939 
    4040static double 
    41 Iqxy(double qx, double qy, 
     41Iqxy(double qab, double qc, 
    4242    double sld, 
    4343    double sld_solvent, 
    4444    double radius_polar, 
    45     double radius_equatorial, 
    46     double theta, 
    47     double phi) 
     45    double radius_equatorial) 
    4846{ 
    49     double q, sin_alpha, cos_alpha; 
    50     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    51     const double qab = q*sin_alpha; 
    52     const double qc = q*cos_alpha; 
    53  
    5447    const double qr = sqrt(square(radius_equatorial*qab) + square(radius_polar*qc)); 
    5548    const double f = sas_3j1x_x(qr); 
  • sasmodels/models/elliptical_cylinder.c

    r2a0b2b1 rbecded3  
    5555 
    5656static double 
    57 Iqxy(double qx, double qy, 
     57Iqxy(double qa, double qb, double qc, 
    5858     double radius_minor, double r_ratio, double length, 
    59      double sld, double solvent_sld, 
    60      double theta, double phi, double psi) 
     59     double sld, double solvent_sld) 
    6160{ 
    62     double q, xhat, yhat, zhat; 
    63     ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 
    64     const double qa = q*xhat; 
    65     const double qb = q*yhat; 
    66     const double qc = q*zhat; 
    67  
    6861    // Compute:  r = sqrt((radius_major*cos_nu)^2 + (radius_minor*cos_mu)^2) 
    6962    // Given:    radius_major = r_ratio * radius_minor 
  • sasmodels/models/fcc_paracrystal.c

    r7e0b281 rbecded3  
    8282 
    8383 
    84 static double Iqxy(double qx, double qy, 
     84static double Iqxy(double qa, double qb, double qc, 
    8585    double dnn, double d_factor, double radius, 
    86     double sld, double solvent_sld, 
    87     double theta, double phi, double psi) 
     86    double sld, double solvent_sld) 
    8887{ 
    89     double q, zhat, yhat, xhat; 
    90     ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 
    91     const double qa = q*xhat; 
    92     const double qb = q*yhat; 
    93     const double qc = q*zhat; 
    94  
    95     q = sqrt(qa*qa + qb*qb + qc*qc); 
     88    const double q = sqrt(qa*qa + qb*qb + qc*qc); 
    9689    const double Pq = sphere_form(q, radius, sld, solvent_sld); 
    9790    const double Zq = fcc_Zq(qa, qb, qc, dnn, d_factor); 
  • sasmodels/models/hollow_cylinder.c

    r2a0b2b1 rbecded3  
    1 double form_volume(double radius, double thickness, double length); 
    2 double Iq(double q, double radius, double thickness, double length, double sld, 
    3     double solvent_sld); 
    4 double Iqxy(double qx, double qy, double radius, double thickness, double length, double sld, 
    5     double solvent_sld, double theta, double phi); 
    6  
    71//#define INVALID(v) (v.radius_core >= v.radius) 
    82 
     
    2822} 
    2923 
    30 double 
     24static double 
    3125form_volume(double radius, double thickness, double length) 
    3226{ 
     
    3630 
    3731 
    38 double 
     32static double 
    3933Iq(double q, double radius, double thickness, double length, 
    4034    double sld, double solvent_sld) 
     
    5751} 
    5852 
    59 double 
    60 Iqxy(double qx, double qy, 
     53static double 
     54Iqxy(double qab, double qc, 
    6155    double radius, double thickness, double length, 
    62     double sld, double solvent_sld, double theta, double phi) 
     56    double sld, double solvent_sld) 
    6357{ 
    64     double q, sin_alpha, cos_alpha; 
    65     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    66     const double qab = q*sin_alpha; 
    67     const double qc = q*cos_alpha; 
    68  
    6958    const double form = _fq(qab, qc, radius, thickness, length); 
    7059 
  • sasmodels/models/parallelepiped.c

    r2a0b2b1 rbecded3  
    1 double form_volume(double length_a, double length_b, double length_c); 
    2 double Iq(double q, double sld, double solvent_sld, 
    3     double length_a, double length_b, double length_c); 
    4 double Iqxy(double qx, double qy, double sld, double solvent_sld, 
    5     double length_a, double length_b, double length_c, 
    6     double theta, double phi, double psi); 
    7  
    8 double form_volume(double length_a, double length_b, double length_c) 
     1static double 
     2form_volume(double length_a, double length_b, double length_c) 
    93{ 
    104    return length_a * length_b * length_c; 
     
    126 
    137 
    14 double Iq(double q, 
     8static double 
     9Iq(double q, 
    1510    double sld, 
    1611    double solvent_sld, 
     
    5752 
    5853 
    59 double Iqxy(double qx, double qy, 
     54static double 
     55Iq2d(double qa, double qb, double qc, 
    6056    double sld, 
    6157    double solvent_sld, 
    6258    double length_a, 
    6359    double length_b, 
    64     double length_c, 
    65     double theta, 
    66     double phi, 
    67     double psi) 
     60    double length_c) 
    6861{ 
    69     double q, xhat, yhat, zhat; 
    70     ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 
    71     const double qa = q*xhat; 
    72     const double qb = q*yhat; 
    73     const double qc = q*zhat; 
    74  
    7562    const double siA = sas_sinx_x(0.5*length_a*qa); 
    7663    const double siB = sas_sinx_x(0.5*length_b*qb); 
  • sasmodels/models/sc_paracrystal.c

    r7e0b281 rbecded3  
    3636 
    3737 
    38 static double Iq(double q, double dnn, 
    39   double d_factor, double radius, 
    40   double sld, double solvent_sld) 
     38static double 
     39Iq(double q, double dnn, 
     40    double d_factor, double radius, 
     41    double sld, double solvent_sld) 
    4142{ 
    4243    // translate a point in [-1,1] to a point in [0, 2 pi] 
     
    7677 
    7778 
    78 static double Iqxy(double qx, double qy, 
     79static double 
     80Iqxy(double qa, double qb, double qc, 
    7981    double dnn, double d_factor, double radius, 
    80     double sld, double solvent_sld, 
    81     double theta, double phi, double psi) 
     82    double sld, double solvent_sld) 
    8283{ 
    83     double q, zhat, yhat, xhat; 
    84     ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 
    85     const double qa = q*xhat; 
    86     const double qb = q*yhat; 
    87     const double qc = q*zhat; 
    88  
    89     q = sqrt(qa*qa + qb*qb + qc*qc); 
     84    const double q = sqrt(qa*qa + qb*qb + qc*qc); 
    9085    const double Pq = sphere_form(q, radius, sld, solvent_sld); 
    9186    const double Zq = sc_Zq(qa, qb, qc, dnn, d_factor); 
  • sasmodels/models/stacked_disks.c

    rb34fc77 rbecded3  
    1 static double stacked_disks_kernel( 
     1static double 
     2stacked_disks_kernel( 
    23    double qab, 
    34    double qc, 
     
    6061 
    6162 
    62 static double stacked_disks_1d( 
     63static double 
     64stacked_disks_1d( 
    6365    double q, 
    6466    double thick_core, 
     
    102104} 
    103105 
    104 static double form_volume( 
     106static double 
     107form_volume( 
    105108    double thick_core, 
    106109    double thick_layer, 
     
    113116} 
    114117 
    115 static double Iq( 
     118static double 
     119Iq( 
    116120    double q, 
    117121    double thick_core, 
     
    137141 
    138142 
    139 static double Iqxy(double qx, double qy, 
     143static double 
     144Iqxy(double qab, double qc, 
    140145    double thick_core, 
    141146    double thick_layer, 
     
    145150    double core_sld, 
    146151    double layer_sld, 
    147     double solvent_sld, 
    148     double theta, 
    149     double phi) 
     152    double solvent_sld) 
    150153{ 
    151     double q, sin_alpha, cos_alpha; 
    152     ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    153     const double qab = q*sin_alpha; 
    154     const double qc = q*cos_alpha; 
    155  
    156154    int n_stacking = (int)(fp_n_stacking + 0.5); 
    157155    double d = 2.0 * thick_layer + thick_core; 
  • sasmodels/models/triaxial_ellipsoid.c

    r2a0b2b1 rbecded3  
    4646 
    4747static double 
    48 Iqxy(double qx, double qy, 
     48Iqxy(double qa, double qb, double qc, 
    4949    double sld, 
    5050    double sld_solvent, 
    5151    double radius_equat_minor, 
    5252    double radius_equat_major, 
    53     double radius_polar, 
    54     double theta, 
    55     double phi, 
    56     double psi) 
     53    double radius_polar) 
    5754{ 
    58     double q, xhat, yhat, zhat; 
    59     ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat); 
    60     const double qa = q*xhat; 
    61     const double qb = q*yhat; 
    62     const double qc = q*zhat; 
    63  
    6455    const double qr = sqrt(square(radius_equat_minor*qa) 
    6556                           + square(radius_equat_major*qb) 
Note: See TracChangeset for help on using the changeset viewer.