Changeset ff1fff5 in sasmodels for sasmodels/models/binary_hard_sphere.c


Ignore:
Timestamp:
Oct 16, 2016 2:14:15 PM (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:
7fcdc9f
Parents:
4f79d94 (diff), a0d75ce (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

allow comparison of different models, such as 'sascomp sphere:ellipsoid radius_polar=:radius radius_equatorial=:radius -mono'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/binary_hard_sphere.c

    re481a39 r4f79d94  
    77    ); 
    88     
    9 double Iqxy(double qx, double qy, 
    10     double lg_radius, double sm_radius, 
    11     double lg_vol_frac, double sm_vol_frac, 
    12     double lg_sld, double sm_sld, double solvent_sld 
    13     ); 
    14  
    159void calculate_psfs(double qval, 
    1610    double r2, double nf2, 
     
    5549    // /* do form factor calculations  */ 
    5650     
    57     v1 = 4.0*M_PI/3.0*r1*r1*r1; 
    58     v2 = 4.0*M_PI/3.0*r2*r2*r2; 
     51    v1 = M_4PI_3*r1*r1*r1; 
     52    v2 = M_4PI_3*r2*r2*r2; 
    5953     
    6054    n1 = phi1/v1; 
     
    6458    qr2 = r2*q; 
    6559 
    66     //if (qr1 == 0){ 
    67         //sc1 = 1.0/3.0; 
    68     //}else{ 
    69         //sc1 = (sin(qr1)-qr1*cos(qr1))/qr1/qr1/qr1; 
    70     //} 
    71     //if (qr2 == 0){ 
    72         //sc2 = 1.0/3.0; 
    73     //}else{ 
    74         //sc2 = (sin(qr2)-qr2*cos(qr2))/qr2/qr2/qr2; 
    75     //} 
    7660    sc1 = sph_j1c(qr1); 
    7761    sc2 = sph_j1c(qr2); 
    78     b1 = r1*r1*r1*(rho1-rhos)*4.0/3.0*M_PI*sc1; 
    79     b2 = r2*r2*r2*(rho2-rhos)*4.0/3.0*M_PI*sc2; 
     62    b1 = r1*r1*r1*(rho1-rhos)*M_4PI_3*sc1; 
     63    b2 = r2*r2*r2*(rho2-rhos)*M_4PI_3*sc2; 
    8064    inten = n1*b1*b1*psf11; 
    8165    inten += sqrt(n1*n2)*2.0*b1*b2*psf12; 
     
    8872} 
    8973 
    90  
    91 double Iqxy(double qx, double qy, 
    92     double lg_radius, double sm_radius, 
    93     double lg_vol_frac, double sm_vol_frac, 
    94     double lg_sld, double sm_sld, double solvent_sld) 
    95      
    96 { 
    97     double q = sqrt(qx*qx + qy*qy); 
    98     return Iq(q, 
    99         lg_radius, sm_radius, 
    100         lg_vol_frac, sm_vol_frac, 
    101         lg_sld, sm_sld, solvent_sld); 
    102 } 
    10374 
    10475void calculate_psfs(double qval, 
Note: See TracChangeset for help on using the changeset viewer.