source: sasmodels/sasmodels/models/lib/sphere_form.c @ 9aac25d

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 9aac25d was 9aac25d, checked in by piotr, 8 years ago

Converted SCCrystalModel

  • Property mode set to 100644
File size: 848 bytes
Line 
1double
2sphere_form(double q, double radius, double sld, double solvent_sld)
3{
4    const double qr = q*radius;
5    double sn, cn;
6    SINCOS(qr, sn, cn);
7    const double vol = 1.333333333333333*M_PI*radius*radius*radius;
8    const double bes = (qr == 0.0 ? 1.0 : 3.0*(sn-qr*cn)/(qr*qr*qr));
9    const double fq = bes * (sld - solvent_sld)*vol;
10    return 1.0e-4*fq*fq;
11}
12
13// Do we even need the paracrystal form?
14// The only difference is the return value at r=0
15double
16sphere_form_paracrystal(double q, double radius, double delrho)
17{
18    const double qr = q*radius;
19    const double vol = 1.333333333333333*M_PI*radius*radius*radius;
20        const double f = vol*delrho*delrho*1.0e-4;
21    double sn, cn;
22    SINCOS(qr, sn, cn);
23        const double bes = (qr == 0.0 ? f : 3.0*(sn-qr*cn)/(qr*qr*qr));
24        const double fq = bes*delrho*vol;
25        return fq*fq * 1.0e-4;
26}
Note: See TracBrowser for help on using the repository browser.