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


Ignore:
Timestamp:
Aug 14, 2018 12:09:34 PM (23 months 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/vesicle.c

    r925ad6e r71b751d  
    1 double form_volume(double radius, double thickness); 
    2  
    3 double Iq(double q,  
    4           double sld, double sld_solvent, double volfraction, 
    5           double radius, double thickness); 
    6  
    7 double form_volume(double radius, double thickness) 
     1static double 
     2form_volume(double radius, double thickness) 
    83{ 
    94    //note that for the vesicle model, the volume is ONLY the shell volume 
     
    116} 
    127 
    13 double Iq(double q, 
     8 
     9static void 
     10Fq(double q, 
     11    double *F1, 
     12    double *F2, 
    1413    double sld, 
    1514    double sld_solvent, 
     
    3130    vol = M_4PI_3*cube(radius); 
    3231    f = vol * sas_3j1x_x(q*radius) * contrast; 
    33   
     32 
    3433    //now the shell. No volume normalization as this is done by the caller 
    3534    contrast = sld-sld_solvent; 
     
    3736    f += vol * sas_3j1x_x(q*(radius+thickness)) * contrast; 
    3837 
    39     //rescale to [cm-1].  
    40     f2 = volfraction * f*f*1.0e-4; 
    41      
    42     return f2; 
     38    //rescale to [cm-1]. 
     39    // With volume fraction as part of the model in the dilute limit need 
     40    // to return F2 = Vf <fq^2>.  In order for beta approx. to work correctly 
     41    // need F1^2/F2 equal to <fq>^2 / <fq^2>.  By returning F1 = sqrt(Vf) <fq> 
     42    // and F2 = Vf <fq^2> both conditions are satisfied. 
     43    // Since Vf is the volume fraction of vesicles of all radii, it is 
     44    // constant when averaging F1 and F2 over radii and so pops out of the 
     45    // polydispersity loop, so it is safe to apply it inside the model 
     46    // (albeit conceptually ugly). 
     47    *F1 = 1e-2 * sqrt(volfraction) * f; 
     48    *F2 = 1.0e-4 * volfraction * f * f; 
    4349} 
Note: See TracChangeset for help on using the changeset viewer.