source: sasmodels/sasmodels/models/multilayer_vesicle.c @ c3ccaec

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since c3ccaec was c3ccaec, checked in by GitHub <noreply@…>, 3 years ago

Merge branch 'master' into ticket-815

  • Property mode set to 100644
File size: 1.4 KB
Line 
1static
2double multilayer_vesicle_kernel(double q,
3          double volfraction,
4          double radius,
5          double thick_shell,
6          double thick_solvent,
7          double sld_solvent,
8          double sld,
9          int n_pairs)
10{
11    //calculate with a loop, two shells at a time
12    int ii = 0;
13    double fval = 0.0;
14    double voli = 0.0;
15    const double sldi = sld_solvent-sld;
16
17    do {
18        double ri = radius + (double)ii*(thick_shell + thick_solvent);
19
20        // layer 1
21        voli = M_4PI_3*ri*ri*ri;
22        fval += voli*sldi*sas_3j1x_x(ri*q);
23
24        ri += thick_shell;
25
26        // layer 2
27        voli = M_4PI_3*ri*ri*ri;
28        fval -= voli*sldi*sas_3j1x_x(ri*q);
29
30        //do 2 layers at a time
31        ii += 1;
32
33    } while(ii <= n_pairs-1);  //change to make 0 < n_pairs < 2 correspond to
34                               //unilamellar vesicles (C. Glinka, 11/24/03)
35
36    fval *= volfraction*1.0e-4*fval/voli;
37
38    return(fval);
39}
40
41static
42double Iq(double q,
43          double volfraction,
44          double radius,
45          double thick_shell,
46          double thick_solvent,
47          double sld_solvent,
48          double sld,
49          double fp_n_pairs)
50{
51    int n_pairs = (int)(fp_n_pairs + 0.5);
52    return multilayer_vesicle_kernel(q,
53           volfraction,
54           radius,
55           thick_shell,
56           thick_solvent,
57           sld_solvent,
58           sld,
59           n_pairs);
60}
61
Note: See TracBrowser for help on using the repository browser.