Changeset 925ad6e in sasmodels


Ignore:
Timestamp:
Jan 11, 2017 8:27:54 AM (6 years ago)
Author:
wojciech
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
592343f
Parents:
1e7b0db0
Message:

sph_j1c translated to sas_3j1x_x

Location:
sasmodels/models
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/bcc_paracrystal.py

    rb0c4271 r925ad6e  
    128128# pylint: enable=bad-whitespace, line-too-long 
    129129 
    130 source = ["lib/sph_j1c.c", "lib/gauss150.c", "lib/sphere_form.c", "bcc_paracrystal.c"] 
     130source = ["lib/sas_3j1x_x.c", "lib/gauss150.c", "lib/sphere_form.c", "bcc_paracrystal.c"] 
    131131 
    132132# parameters for demo 
  • sasmodels/models/binary_hard_sphere.c

    r4f79d94 r925ad6e  
    5858    qr2 = r2*q; 
    5959 
    60     sc1 = sph_j1c(qr1); 
    61     sc2 = sph_j1c(qr2); 
     60    sc1 = sas_3j1x_x(qr1); 
     61    sc2 = sas_3j1x_x(qr2); 
    6262    b1 = r1*r1*r1*(rho1-rhos)*M_4PI_3*sc1; 
    6363    b2 = r2*r2*r2*(rho2-rhos)*M_4PI_3*sc2; 
  • sasmodels/models/binary_hard_sphere.py

    rb0c4271 r925ad6e  
    108108             ] 
    109109 
    110 source = ["lib/sph_j1c.c", "binary_hard_sphere.c"] 
     110source = ["lib/sas_3j1x_x.c", "binary_hard_sphere.c"] 
    111111 
    112112# parameters for demo and documentation 
  • sasmodels/models/core_multi_shell.c

    rc5ac2b2 r925ad6e  
    33f_constant(double q, double r, double sld) 
    44{ 
    5   const double bes = sph_j1c(q * r); 
     5  const double bes = sas_3j1x_x(q * r); 
    66  const double vol = M_4PI_3 * cube(r); 
    77  return sld * vol * bes; 
     
    3333  f = 0.; 
    3434  for (int i=0; i<n; i++) { 
    35     f += M_4PI_3 * cube(r) * (sld[i] - last_sld) * sph_j1c(q*r); 
     35    f += M_4PI_3 * cube(r) * (sld[i] - last_sld) * sas_3j1x_x(q*r); 
    3636    last_sld = sld[i]; 
    3737    r += thickness[i]; 
    3838  } 
    39   f += M_4PI_3 * cube(r) * (solvent_sld - last_sld) * sph_j1c(q*r); 
     39  f += M_4PI_3 * cube(r) * (solvent_sld - last_sld) * sas_3j1x_x(q*r); 
    4040  return f * f * 1.0e-4; 
    4141} 
  • sasmodels/models/core_multi_shell.py

    r2d73a53 r925ad6e  
    101101             ] 
    102102 
    103 source = ["lib/sph_j1c.c", "core_multi_shell.c"] 
     103source = ["lib/sas_3j1x_x.c", "core_multi_shell.c"] 
    104104 
    105105def profile(sld_core, radius, sld_solvent, n, sld, thickness): 
  • sasmodels/models/core_shell_ellipsoid.py

    rfcb33e4 r925ad6e  
    137137# pylint: enable=bad-whitespace, line-too-long 
    138138 
    139 source = ["lib/sph_j1c.c", "lib/gfn.c", "lib/gauss76.c", 
     139source = ["lib/sas_3j1x_x.c", "lib/gfn.c", "lib/gauss76.c", 
    140140          "core_shell_ellipsoid.c"] 
    141141 
  • sasmodels/models/core_shell_sphere.py

    r4962519 r925ad6e  
    7575# pylint: enable=bad-whitespace, line-too-long 
    7676 
    77 source = ["lib/sph_j1c.c", "lib/core_shell.c", "core_shell_sphere.c"] 
     77source = ["lib/sas_3j1x_x.c", "lib/core_shell.c", "core_shell_sphere.c"] 
    7878 
    7979demo = dict(scale=1, background=0, radius=60, thickness=10, 
  • sasmodels/models/ellipsoid.c

    r73e08ae r925ad6e  
    1818    const double r = radius_equatorial 
    1919                     * sqrt(1.0 + sin_alpha*sin_alpha*(ratio*ratio - 1.0)); 
    20     const double f = sph_j1c(q*r); 
     20    const double f = sas_3j1x_x(q*r); 
    2121 
    2222    return f*f; 
  • sasmodels/models/ellipsoid.py

    r0d6e865 r925ad6e  
    135135             ] 
    136136 
    137 source = ["lib/sph_j1c.c", "lib/gauss76.c", "ellipsoid.c"] 
     137source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "ellipsoid.c"] 
    138138 
    139139def ER(radius_polar, radius_equatorial): 
  • sasmodels/models/fcc_paracrystal.py

    r0bef47b r925ad6e  
    116116# pylint: enable=bad-whitespace, line-too-long 
    117117 
    118 source = ["lib/sph_j1c.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc_paracrystal.c"] 
     118source = ["lib/sas_3j1x_x.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc_paracrystal.c"] 
    119119 
    120120# parameters for demo 
  • sasmodels/models/fractal.c

    r217590b r925ad6e  
    1414    //calculate P(q) for the spherical subunits 
    1515    const double V = M_4PI_3*cube(radius); 
    16     const double pq = V * square((sld_block-sld_solvent)*sph_j1c(q*radius)); 
     16    const double pq = V * square((sld_block-sld_solvent)*sas_3j1x_x(q*radius)); 
    1717 
    1818    // scale to units cm-1 sr-1 (assuming data on absolute scale) 
  • sasmodels/models/fractal.py

    rfef353f r925ad6e  
    9797# pylint: enable=bad-whitespace, line-too-long 
    9898 
    99 source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "lib/fractal_sq.c", "fractal.c"] 
     99source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "lib/fractal_sq.c", "fractal.c"] 
    100100 
    101101demo = dict(volfraction=0.05, 
  • sasmodels/models/fractal_core_shell.py

    rd6f60c3 r925ad6e  
    9595# pylint: enable=bad-whitespace, line-too-long 
    9696 
    97 source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "lib/core_shell.c", 
     97source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "lib/core_shell.c", 
    9898          "lib/fractal_sq.c", "fractal_core_shell.c"] 
    9999 
  • sasmodels/models/fuzzy_sphere.py

    r3a48772 r925ad6e  
    8181# pylint: enable=bad-whitespace,line-too-long 
    8282 
    83 source = ["lib/sph_j1c.c"] 
     83source = ["lib/sas_3j1x_x.c"] 
    8484 
    8585# No volume normalization despite having a volume parameter 
     
    9191Iq = """ 
    9292    const double qr = q*radius; 
    93     const double bes = sph_j1c(qr); 
     93    const double bes = sas_3j1x_x(qr); 
    9494    const double qf = q*fuzziness; 
    9595    const double fq = bes * (sld - sld_solvent) * form_volume(radius) * exp(-0.5*qf*qf); 
  • sasmodels/models/lib/core_shell.c

    r3a48772 r925ad6e  
    1616    const double core_qr = q * radius; 
    1717    const double core_contrast = core_sld - shell_sld; 
    18     const double core_bes = sph_j1c(core_qr); 
     18    const double core_bes = sas_3j1x_x(core_qr); 
    1919    const double core_volume = M_4PI_3 * cube(radius); 
    2020    double f = core_volume * core_bes * core_contrast; 
     
    2323    const double shell_qr = q * (radius + thickness); 
    2424    const double shell_contrast = shell_sld - solvent_sld; 
    25     const double shell_bes = sph_j1c(shell_qr); 
     25    const double shell_bes = sas_3j1x_x(shell_qr); 
    2626    const double shell_volume = M_4PI_3 * cube(radius + thickness); 
    2727    f += shell_volume * shell_bes * shell_contrast; 
  • sasmodels/models/lib/gfn.c

    r3a48772 r925ad6e  
    1818    // changing to more accurate sph_j1c since the following inexplicably fails on Radeon Nano. 
    1919    //const double siq = (uq == 0.0 ? 1.0 : 3.0*(sin(uq)/uq/uq - cos(uq)/uq)/uq); 
    20     const double siq = sph_j1c(uq); 
     20    const double siq = sas_3j1x_x(uq); 
    2121    const double vc = M_4PI_3*aa*aa*bb; 
    2222    const double gfnc = siq*vc*delpc; 
     
    2626    const double vt = M_4PI_3*trmaj*trmaj*trmin; 
    2727    //const double sit = (ut == 0.0 ? 1.0 : 3.0*(sin(ut)/ut/ut - cos(ut)/ut)/ut); 
    28     const double sit = sph_j1c(ut); 
     28    const double sit = sas_3j1x_x(ut); 
    2929    const double gfnt = sit*vt*delps; 
    3030 
  • sasmodels/models/lib/sphere_form.c

    rba32cdd r925ad6e  
    99double sphere_form(double q, double radius, double sld, double solvent_sld) 
    1010{ 
    11     const double fq = sphere_volume(radius) * sph_j1c(q*radius); 
     11    const double fq = sphere_volume(radius) * sas_3j1x_x(q*radius); 
    1212    const double contrast = (sld - solvent_sld); 
    1313    return 1.0e-4*square(contrast * fq); 
  • sasmodels/models/linear_pearls.c

    r1e7b0db0 r925ad6e  
    4444 
    4545    //sine functions of a pearl 
    46     double psi = sph_j1c(q * radius); 
     46    double psi = sas_3j1x_x(q * radius); 
    4747 
    4848    // N pearls contribution 
  • sasmodels/models/linear_pearls.py

    r4962519 r925ad6e  
    6363single = False 
    6464 
    65 source = ["lib/sph_j1c.c", "linear_pearls.c"] 
     65source = ["lib/sas_3j1x_x.c", "linear_pearls.c"] 
    6666 
    6767demo = dict(scale=1.0, background=0.0, 
  • sasmodels/models/mass_fractal.c

    r6d96b66 r925ad6e  
    55{ 
    66    //calculate P(q) 
    7     const double pq = square(sph_j1c(q*radius)); 
     7    const double pq = square(sas_3j1x_x(q*radius)); 
    88 
    99    //calculate S(q) 
  • sasmodels/models/mass_fractal.py

    r6d96b66 r925ad6e  
    8686# pylint: enable=bad-whitespace, line-too-long 
    8787 
    88 source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "mass_fractal.c"] 
     88source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "mass_fractal.c"] 
    8989 
    9090demo = dict(scale=1, background=0, 
  • sasmodels/models/multilayer_vesicle.c

    r3a48772 r925ad6e  
    2020        // layer 1 
    2121        voli = M_4PI_3*ri*ri*ri; 
    22         fval += voli*sldi*sph_j1c(ri*q); 
     22        fval += voli*sldi*sas_3j1x_x(ri*q); 
    2323 
    2424        ri += thick_shell; 
     
    2626        // layer 2 
    2727        voli = M_4PI_3*ri*ri*ri; 
    28         fval -= voli*sldi*sph_j1c(ri*q); 
     28        fval -= voli*sldi*sas_3j1x_x(ri*q); 
    2929 
    3030        //do 2 layers at a time 
  • sasmodels/models/multilayer_vesicle.py

    r041bc75 r925ad6e  
    107107# pylint: enable=bad-whitespace, line-too-long 
    108108 
    109 source = ["lib/sph_j1c.c", "multilayer_vesicle.c"] 
     109source = ["lib/sas_3j1x_x.c", "multilayer_vesicle.c"] 
    110110 
    111111polydispersity = ["radius", "n_pairs"] 
  • sasmodels/models/onion.c

    r9762341 r925ad6e  
    66  const double vol = M_4PI_3 * cube(r); 
    77  const double qr = q * r; 
    8   const double bes = sph_j1c(qr); 
     8  const double bes = sas_3j1x_x(qr); 
    99  const double alpha = A * r/thickness; 
    1010  double result; 
  • sasmodels/models/onion.py

    r9762341 r925ad6e  
    314314# pylint: enable=bad-whitespace, line-too-long 
    315315 
    316 source = ["lib/sph_j1c.c", "onion.c"] 
     316source = ["lib/sas_3j1x_x.c", "onion.c"] 
    317317single = False 
    318318 
  • sasmodels/models/pearl_necklace.c

    r1e7b0db0 r925ad6e  
    3636    const double beta = (Si(q*(A_s-radius)) - Si(q*radius)) / q_edge; 
    3737    const double gamma = Si(q_edge) / q_edge; 
    38     const double psi = sph_j1c(q*radius); 
     38    const double psi = sas_3j1x_x(q*radius); 
    3939 
    4040    // Precomputed sinc terms 
  • sasmodels/models/pearl_necklace.py

    r2126131 r925ad6e  
    9292             ] 
    9393 
    94 source = ["lib/Si.c", "lib/sph_j1c.c", "pearl_necklace.c"] 
     94source = ["lib/Si.c", "lib/sas_3j1x_x.c", "pearl_necklace.c"] 
    9595single = False  # use double precision unless told otherwise 
    9696 
  • sasmodels/models/polymer_micelle.c

    r1e7b0db0 r925ad6e  
    3131 
    3232    // Self-correlation term of the core 
    33     const double bes_core = sph_j1c(q*radius_core); 
     33    const double bes_core = sas_3j1x_x(q*radius_core); 
    3434    const double term1 = square(n_aggreg*beta_core*bes_core); 
    3535 
  • sasmodels/models/polymer_micelle.py

    rbba9361 r925ad6e  
    104104single = False 
    105105 
    106 source = ["lib/sph_j1c.c", "polymer_micelle.c"] 
     106source = ["lib/sas_3j1x_x.c", "polymer_micelle.c"] 
    107107 
    108108demo = dict(scale=1, background=0, 
  • sasmodels/models/raspberry.c

    r1e7b0db0 r925ad6e  
    5151 
    5252    //Form factors for each particle 
    53     psiL = sph_j1c(q*rL); 
    54     psiS = sph_j1c(q*rS); 
     53    psiL = sas_3j1x_x(q*rL); 
     54    psiS = sas_3j1x_x(q*rS); 
    5555 
    5656    //Cross term between large and small particles 
  • sasmodels/models/raspberry.py

    r40a87fa r925ad6e  
    152152             ] 
    153153 
    154 source = ["lib/sph_j1c.c", "raspberry.c"] 
     154source = ["lib/sas_3j1x_x.c", "raspberry.c"] 
    155155 
    156156# parameters for demo 
  • sasmodels/models/sc_paracrystal.py

    r0bef47b r925ad6e  
    133133# pylint: enable=bad-whitespace, line-too-long 
    134134 
    135 source = ["lib/sph_j1c.c", "lib/sphere_form.c", "lib/gauss150.c", "sc_paracrystal.c"] 
     135source = ["lib/sas_3j1x_x.c", "lib/sphere_form.c", "lib/gauss150.c", "sc_paracrystal.c"] 
    136136 
    137137demo = dict(scale=1, background=0, 
  • sasmodels/models/sphere.py

    r7e6bea81 r925ad6e  
    6666             ] 
    6767 
    68 source = ["lib/sph_j1c.c", "lib/sphere_form.c"] 
     68source = ["lib/sas_3j1x_x.c", "lib/sphere_form.c"] 
    6969 
    7070# No volume normalization despite having a volume parameter 
  • sasmodels/models/spherical_sld.c

    r54bcd4a r925ad6e  
    3434    const double qr = q * r; 
    3535    const double qrsq = qr * qr; 
    36     const double bes = sph_j1c(qr); 
     36    const double bes = sas_3j1x_x(qr); 
    3737    double sinqr, cosqr; 
    3838    SINCOS(qr, sinqr, cosqr); 
     
    6060 
    6161        // uniform shell; r=0 => r^3=0 => f=0, so works for core as well. 
    62         f -= M_4PI_3 * cube(r) * sld_l * sph_j1c(q*r); 
     62        f -= M_4PI_3 * cube(r) * sld_l * sas_3j1x_x(q*r); 
    6363        r += thickness[shell]; 
    64         f += M_4PI_3 * cube(r) * sld_l * sph_j1c(q*r); 
     64        f += M_4PI_3 * cube(r) * sld_l * sas_3j1x_x(q*r); 
    6565 
    6666        // iterate over sub_shells in the interface 
     
    9292    } 
    9393    // add in solvent effect 
    94     f -= M_4PI_3 * cube(r) * sld_solvent * sph_j1c(q*r); 
     94    f -= M_4PI_3 * cube(r) * sld_solvent * sas_3j1x_x(q*r); 
    9595 
    9696    const double f2 = f * f * 1.0e-4; 
  • sasmodels/models/spherical_sld.py

    r2d65d51 r925ad6e  
    214214             ] 
    215215# pylint: enable=bad-whitespace, line-too-long 
    216 source = ["lib/polevl.c", "lib/sas_erf.c", "lib/sph_j1c.c", "spherical_sld.c"] 
     216source = ["lib/polevl.c", "lib/sas_erf.c", "lib/sas_3j1x_x.c", "spherical_sld.c"] 
    217217single = False  # TODO: fix low q behaviour 
    218218 
  • sasmodels/models/surface_fractal.c

    rb716cc6 r925ad6e  
    1515{ 
    1616    // calculate P(q) 
    17     const double pq = square(sph_j1c(q*radius)); 
     17    const double pq = square(sas_3j1x_x(q*radius)); 
    1818 
    1919    // calculate S(q) 
  • sasmodels/models/surface_fractal.py

    r5c94f41 r925ad6e  
    7272# pylint: enable=bad-whitespace, line-too-long 
    7373 
    74 source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "surface_fractal.c"] 
     74source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "surface_fractal.c"] 
    7575 
    7676demo = dict(scale=1, background=1e-5, 
  • sasmodels/models/triaxial_ellipsoid.c

    r3a48772 r925ad6e  
    3737            const double ysq = square(Gauss76Z[j]*zm + zb); 
    3838            const double t = q*sqrt(acosx2 + bsinx2*(1.0-ysq) + c2*ysq); 
    39             const double fq = sph_j1c(t); 
     39            const double fq = sas_3j1x_x(t); 
    4040            inner += Gauss76Wt[j] * fq * fq ; 
    4141        } 
     
    6464                          + radius_equat_major*radius_equat_major*cmu*cmu 
    6565                          + radius_polar*radius_polar*calpha*calpha); 
    66     const double fq = sph_j1c(t); 
     66    const double fq = sas_3j1x_x(t); 
    6767    const double s = (sld - sld_solvent) * form_volume(radius_equat_minor, radius_equat_major, radius_polar); 
    6868 
  • sasmodels/models/triaxial_ellipsoid.py

    r416f5c7 r925ad6e  
    104104             ] 
    105105 
    106 source = ["lib/sph_j1c.c", "lib/gauss76.c", "triaxial_ellipsoid.c"] 
     106source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "triaxial_ellipsoid.c"] 
    107107 
    108108def ER(radius_equat_minor, radius_equat_major, radius_polar): 
  • sasmodels/models/vesicle.c

    r3a48772 r925ad6e  
    3030    contrast = sld_solvent-sld; 
    3131    vol = M_4PI_3*cube(radius); 
    32     f = vol * sph_j1c(q*radius) * contrast; 
     32    f = vol * sas_3j1x_x(q*radius) * contrast; 
    3333  
    3434    //now the shell. No volume normalization as this is done by the caller 
    3535    contrast = sld-sld_solvent; 
    3636    vol = M_4PI_3*cube(radius+thickness); 
    37     f += vol * sph_j1c(q*(radius+thickness)) * contrast; 
     37    f += vol * sas_3j1x_x(q*(radius+thickness)) * contrast; 
    3838 
    3939    //rescale to [cm-1].  
  • sasmodels/models/vesicle.py

    r3a48772 r925ad6e  
    9494             ] 
    9595 
    96 source = ["lib/sph_j1c.c", "vesicle.c"] 
     96source = ["lib/sas_3j1x_x.c", "vesicle.c"] 
    9797 
    9898def ER(radius, thickness): 
Note: See TracChangeset for help on using the changeset viewer.