Changeset ad90df9 in sasmodels for sasmodels/models/sc_crystal.c


Ignore:
Timestamp:
Mar 1, 2016 8:23:21 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
e6f1410, 7d4b2ae
Parents:
50e1e40
Message:

refactor sphere/fcc/bcc/sc_crystal to use common code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/sc_crystal.c

    r9aac25d rad90df9  
    2020double form_volume(double radius) 
    2121{ 
    22     return 1.333333333333333*M_PI*radius*radius*radius; 
     22    return sphere_volume(radius); 
    2323} 
    2424 
     
    9595 
    9696        //Volume fraction calculated from lattice symmetry and sphere radius 
    97         const double latticeScale = (4.0/3.0)*M_PI*(radius*radius*radius)/pow(dnn,3); 
    98  
    99         //answer *= sphere_form_paracrystal(q, radius,contrast)*latticeScale; 
     97        // NB: 4/3 pi r^3 / dnn^3 = 4/3 pi(r/dnn)^3 
     98        const double latticeScale = sphere_volume(radius/dnn); 
     99 
    100100        answer *= sphere_form(q, radius, sphere_sld, solvent_sld)*latticeScale; 
    101101 
     
    180180 
    181181    //consider scales 
    182     const double latticeScale = (4.0/3.0)*M_PI*(radius*radius*radius)/pow(dnn,3.0); 
     182    const double latticeScale = sphere_volume(radius/dnn); 
    183183    answer *= latticeScale; 
    184184 
Note: See TracChangeset for help on using the changeset viewer.