Changeset 71b751d in sasmodels for sasmodels/models/fuzzy_sphere.py


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/fuzzy_sphere.py

    r2d81cfe r71b751d  
    8383 
    8484source = ["lib/sas_3j1x_x.c"] 
     85have_Fq = True 
    8586 
    86 # No volume normalization despite having a volume parameter 
    87 # This should perhaps be volume normalized? 
    88 form_volume = """ 
     87c_code = """ 
     88static double form_volume(double radius) 
     89{ 
    8990    return M_4PI_3*cube(radius); 
    90     """ 
     91} 
    9192 
    92 Iq = """ 
     93static void Fq(double q, double *F1, double *F2, double sld, double sld_solvent, 
     94               double radius, double fuzziness) 
     95{ 
    9396    const double qr = q*radius; 
    9497    const double bes = sas_3j1x_x(qr); 
    95     const double qf = q*fuzziness; 
    96     const double fq = bes * (sld - sld_solvent) * form_volume(radius) * exp(-0.5*qf*qf); 
    97     return 1.0e-4*fq*fq; 
    98     """ 
     98    const double qf = exp(-0.5*square(q*fuzziness)); 
     99    const double contrast = (sld - sld_solvent); 
     100    const double form = contrast * form_volume(radius) * bes * qf; 
     101    *F1 = 1.0e-2*form; 
     102    *F2 = 1.0e-4*form*form; 
     103} 
     104""" 
    99105 
    100106def ER(radius): 
Note: See TracChangeset for help on using the changeset viewer.