Changeset 86aa992 in sasmodels for sasmodels/models/sphere.py


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

    ref07e95 r71b751d  
    6767             ] 
    6868 
    69 source = ["lib/sas_3j1x_x.c", "lib/sphere_form.c"] 
     69source = ["lib/sas_3j1x_x.c"] 
     70have_Fq = True 
    7071 
    71 # No volume normalization despite having a volume parameter 
    72 # This should perhaps be volume normalized? 
    73 form_volume = """ 
    74     return sphere_volume(radius); 
    75     """ 
     72c_code = """ 
     73static double form_volume(double radius) 
     74{ 
     75    return M_4PI_3*cube(radius); 
     76} 
    7677 
    77 Iq = """ 
    78     return sphere_form(q, radius, sld, sld_solvent); 
    79     """ 
     78static void Fq(double q, double *f1, double *f2, double sld, double sld_solvent, double radius) 
     79{ 
     80    const double bes = sas_3j1x_x(q*radius); 
     81    const double contrast = (sld - sld_solvent); 
     82    const double form = contrast * form_volume(radius) * bes; 
     83    *f1 = 1.0e-2*form; 
     84    *f2 = 1.0e-4*form*form; 
     85} 
     86""" 
    8087 
    8188def ER(radius): 
Note: See TracChangeset for help on using the changeset viewer.