Changeset 71b751d in sasmodels for sasmodels/models/barbell.c


Ignore:
Timestamp:
Aug 14, 2018 10:09:34 AM (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:
86aa992
Parents:
2f8cbb9
Message:

update remaining form factors to use Fq interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/barbell.c

    r108e70e r71b751d  
    6262} 
    6363 
    64 static double 
    65 Iq(double q, double sld, double solvent_sld, 
     64static void 
     65Fq(double q,double *F1, double *F2, double sld, double solvent_sld, 
    6666    double radius_bell, double radius, double length) 
    6767{ 
     
    7272    const double zm = M_PI_4; 
    7373    const double zb = M_PI_4; 
    74     double total = 0.0; 
     74    double total_F1 = 0.0; 
     75    double total_F2 = 0.0; 
    7576    for (int i = 0; i < GAUSS_N; i++){ 
    7677        const double alpha= GAUSS_Z[i]*zm + zb; 
     
    7879        SINCOS(alpha, sin_alpha, cos_alpha); 
    7980        const double Aq = _fq(q*sin_alpha, q*cos_alpha, h, radius_bell, radius, half_length); 
    80         total += GAUSS_W[i] * Aq * Aq * sin_alpha; 
     81        total_F1 += GAUSS_W[i] * Aq * sin_alpha; 
     82        total_F2 += GAUSS_W[i] * Aq * Aq * sin_alpha; 
    8183    } 
    8284    // translate dx in [-1,1] to dx in [lower,upper] 
    83     const double form = total*zm; 
     85    const double form_avg = total_F1*zm; 
     86    const double form_squared_avg = total_F2*zm; 
    8487 
    8588    //Contrast 
    8689    const double s = (sld - solvent_sld); 
    87     return 1.0e-4 * s * s * form; 
     90    *F1 = 1.0e-2 * s * form_avg; 
     91    *F2 = 1.0e-4 * s * s * form_squared_avg; 
    8892} 
    89  
    9093 
    9194static double 
Note: See TracChangeset for help on using the changeset viewer.