source: sasmodels/sasmodels/models/vesicle.c @ 12f4c19

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 12f4c19 was 12f4c19, checked in by Paul Kienzle <pkienzle@…>, 10 months ago

remove cuda variable conflict errors

  • Property mode set to 100644
File size: 1.7 KB
Line 
1static double
2shell_volume(double radius, double thickness)
3{
4    return M_4PI_3 * (cube(radius+thickness) - cube(radius));
5}
6
7static double
8form_volume(double radius, double thickness)
9{
10    return M_4PI_3 * cube(radius+thickness);
11}
12
13
14static double
15effective_radius(int mode, double radius, double thickness)
16{
17    // case 1: outer radius
18    return radius + thickness;
19}
20
21static void
22Fq(double q,
23    double *F1,
24    double *F2,
25    double sld,
26    double sld_solvent,
27    double volfraction,
28    double radius,
29    double thickness)
30
31/*
32   scattering from a unilamellar vesicle.
33   same functional form as the core-shell sphere, but more intuitive for
34   a vesicle
35*/
36
37{
38    double vol,contrast,f;
39
40    // core first, then add in shell
41    contrast = sld_solvent-sld;
42    vol = M_4PI_3*cube(radius);
43    f = vol * sas_3j1x_x(q*radius) * contrast;
44
45    //now the shell. No volume normalization as this is done by the caller
46    contrast = sld-sld_solvent;
47    vol = M_4PI_3*cube(radius+thickness);
48    f += vol * sas_3j1x_x(q*(radius+thickness)) * contrast;
49
50    //rescale to [cm-1].
51    // With volume fraction as part of the model in the dilute limit need
52    // to return F2 = Vf <fq^2>.  In order for beta approx. to work correctly
53    // need F1^2/F2 equal to <fq>^2 / <fq^2>.  By returning F1 = sqrt(Vf) <fq>
54    // and F2 = Vf <fq^2> both conditions are satisfied.
55    // Since Vf is the volume fraction of vesicles of all radii, it is
56    // constant when averaging F1 and F2 over radii and so pops out of the
57    // polydispersity loop, so it is safe to apply it inside the model
58    // (albeit conceptually ugly).
59    *F1 = 1e-2 * sqrt(volfraction) * f;
60    *F2 = 1.0e-4 * volfraction * f * f;
61}
Note: See TracBrowser for help on using the repository browser.