Changeset 86aa992 in sasmodels for sasmodels/models/capped_cylinder.c


Ignore:
Timestamp:
Aug 14, 2018 12:09:49 PM (6 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:
6d90684
Parents:
71b751d (diff), d089a00 (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:

Merge branch 'master' into beta_approx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/capped_cylinder.c

    r108e70e r71b751d  
    8484} 
    8585 
    86 static double 
    87 Iq(double q, double sld, double solvent_sld, 
     86static void 
     87Fq(double q,double *F1, double *F2, double sld, double solvent_sld, 
    8888    double radius, double radius_cap, double length) 
    8989{ 
     
    9494    const double zm = M_PI_4; 
    9595    const double zb = M_PI_4; 
    96     double total = 0.0; 
     96    double total_F1 = 0.0; 
     97    double total_F2 = 0.0; 
    9798    for (int i=0; i<GAUSS_N ;i++) { 
    9899        const double theta = GAUSS_Z[i]*zm + zb; 
     
    103104        const double Aq = _fq(qab, qc, h, radius_cap, radius, half_length); 
    104105        // scale by sin_theta for spherical coord integration 
    105         total += GAUSS_W[i] * Aq * Aq * sin_theta; 
     106        total_F1 += GAUSS_W[i] * Aq * sin_theta; 
     107        total_F2 += GAUSS_W[i] * Aq * Aq * sin_theta; 
    106108    } 
    107109    // translate dx in [-1,1] to dx in [lower,upper] 
    108     const double form = total * zm; 
     110    const double form_avg = total_F1 * zm; 
     111    const double form_squared_avg = total_F2 * zm; 
    109112 
    110113    // Contrast 
    111114    const double s = (sld - solvent_sld); 
    112     return 1.0e-4 * s * s * form; 
     115    *F1 = 1.0e-2 * s * form_avg; 
     116    *F2 = 1.0e-4 * s * s * form_squared_avg; 
    113117} 
    114118 
Note: See TracChangeset for help on using the changeset viewer.