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/core_shell_bicelle_elliptical.c

    r108e70e r71b751d  
    1010} 
    1111 
    12 static double 
    13 Iq(double q, 
     12static void 
     13Fq(double q, 
     14    double *F1, 
     15    double *F2, 
    1416    double r_minor, 
    1517    double x_core, 
     
    3638 
    3739    //initialize integral 
    38     double outer_sum = 0.0; 
     40    double outer_total_F1 = 0.0; 
     41    double outer_total_F2 = 0.0; 
    3942    for(int i=0;i<GAUSS_N;i++) { 
    4043        //setup inner integral over the ellipsoidal cross-section 
    41         //const double va = 0.0; 
    42         //const double vb = 1.0; 
    4344        //const double cos_theta = ( GAUSS_Z[i]*(vb-va) + va + vb )/2.0; 
    4445        const double cos_theta = ( GAUSS_Z[i] + 1.0 )/2.0; 
     
    4849        const double si1 = sas_sinx_x(halfheight*qc); 
    4950        const double si2 = sas_sinx_x((halfheight+thick_face)*qc); 
    50         double inner_sum=0.0; 
     51        double inner_total_F1 = 0; 
     52        double inner_total_F2 = 0; 
    5153        for(int j=0;j<GAUSS_N;j++) { 
    5254            //76 gauss points for the inner integral (WAS 20 points,so this may make unecessarily slow, but playing safe) 
    53             // inner integral limits 
    54             //const double vaj=0.0; 
    55             //const double vbj=M_PI; 
    56             //const double phi = ( GAUSS_Z[j]*(vbj-vaj) + vaj + vbj )/2.0; 
    57             const double phi = ( GAUSS_Z[j] +1.0)*M_PI_2; 
    58             const double rr = sqrt(r2A - r2B*cos(phi)); 
     55            //const double beta = ( GAUSS_Z[j]*(vbj-vaj) + vaj + vbj )/2.0; 
     56            const double beta = ( GAUSS_Z[j] +1.0)*M_PI_2; 
     57            const double rr = sqrt(r2A - r2B*cos(beta)); 
    5958            const double be1 = sas_2J1x_x(rr*qab); 
    6059            const double be2 = sas_2J1x_x((rr+thick_rim)*qab); 
    61             const double fq = dr1*si1*be1 + dr2*si2*be2 + dr3*si2*be1; 
     60            const double f = dr1*si1*be1 + dr2*si2*be2 + dr3*si2*be1; 
    6261 
    63             inner_sum += GAUSS_W[j] * fq * fq; 
     62            inner_total_F1 += GAUSS_W[j] * f; 
     63            inner_total_F2 += GAUSS_W[j] * f * f; 
    6464        } 
    6565        //now calculate outer integral 
    66         outer_sum += GAUSS_W[i] * inner_sum; 
     66        outer_total_F1 += GAUSS_W[i] * inner_total_F1; 
     67        outer_total_F2 += GAUSS_W[i] * inner_total_F2; 
    6768    } 
     69    // now complete change of integration variables (1-0)/(1-(-1))= 0.5 
     70    outer_total_F1 *= 0.25; 
     71    outer_total_F2 *= 0.25; 
    6872 
    69     return outer_sum*2.5e-05; 
     73    //convert from [1e-12 A-1] to [cm-1] 
     74    *F1 = 1e-2*outer_total_F1; 
     75    *F2 = 1e-4*outer_total_F2; 
    7076} 
    7177 
Note: See TracChangeset for help on using the changeset viewer.