source: sasmodels/sasmodels/models/lib/core_shell.c @ 925ad6e

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 925ad6e was 925ad6e, checked in by wojciech, 6 years ago

sph_j1c translated to sas_3j1x_x

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*******************************************************************
2
3core_shell_kernel
4
5Form factor used in core_shell and fractal_core_shell
6
7********************************************************************/
8static
9double core_shell_kernel(double q,
10                         double radius,
11                         double thickness,
12                         double core_sld,
13                         double shell_sld,
14                         double solvent_sld) {
15    // Core first, then add in shell
16    const double core_qr = q * radius;
17    const double core_contrast = core_sld - shell_sld;
18    const double core_bes = sas_3j1x_x(core_qr);
19    const double core_volume = M_4PI_3 * cube(radius);
20    double f = core_volume * core_bes * core_contrast;
21
22    // Now the shell
23    const double shell_qr = q * (radius + thickness);
24    const double shell_contrast = shell_sld - solvent_sld;
25    const double shell_bes = sas_3j1x_x(shell_qr);
26    const double shell_volume = M_4PI_3 * cube(radius + thickness);
27    f += shell_volume * shell_bes * shell_contrast;
28    return f * f * 1.0e-4;
29}
Note: See TracBrowser for help on using the repository browser.