Changeset 86aa992 in sasmodels for sasmodels/models/core_shell_bicelle.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/core_shell_bicelle.c

    r108e70e r71b751d  
    3636} 
    3737 
    38 static double 
    39 Iq(double q, 
     38static void 
     39Fq(double q, 
     40    double *F1, 
     41    double *F2, 
    4042    double radius, 
    4143    double thick_radius, 
     
    5153    const double halflength = 0.5*length; 
    5254 
    53     double total = 0.0; 
     55    double total_F1 = 0.0; 
     56    double total_F2 = 0.0; 
    5457    for(int i=0;i<GAUSS_N;i++) { 
    5558        double theta = (GAUSS_Z[i] + 1.0)*uplim; 
    5659        double sin_theta, cos_theta; // slots to hold sincos function output 
    5760        SINCOS(theta, sin_theta, cos_theta); 
    58         double fq = bicelle_kernel(q*sin_theta, q*cos_theta, radius, thick_radius, thick_face, 
     61        double form = bicelle_kernel(q*sin_theta, q*cos_theta, radius, thick_radius, thick_face, 
    5962                                   halflength, sld_core, sld_face, sld_rim, sld_solvent); 
    60         total += GAUSS_W[i]*fq*fq*sin_theta; 
     63        total_F1 += GAUSS_W[i]*form*sin_theta; 
     64        total_F2 += GAUSS_W[i]*form*form*sin_theta; 
    6165    } 
     66    // Correct for integration range 
     67    total_F1 *= uplim; 
     68    total_F2 *= uplim; 
    6269 
    63     // calculate value of integral to return 
    64     double answer = total*uplim; 
    65     return 1.0e-4*answer; 
     70    *F1 = 1.0e-2*total_F1; 
     71    *F2 = 1.0e-4*total_F2; 
    6672} 
    6773 
Note: See TracChangeset for help on using the changeset viewer.