source: sasmodels/sasmodels/models/core_multi_shell.c @ 71b751d

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 71b751d was 71b751d, checked in by Paul Kienzle <pkienzle@…>, 6 years ago

update remaining form factors to use Fq interface

  • Property mode set to 100644
File size: 918 bytes
Line 
1
2static double
3f_constant(double q, double r, double sld)
4{
5  const double bes = sas_3j1x_x(q * r);
6  const double vol = M_4PI_3 * cube(r);
7  return sld * vol * bes;
8}
9
10static double
11form_volume(double core_radius, double fp_n, double thickness[])
12{
13  double r = core_radius;
14  int n = (int)(fp_n+0.5);
15  for (int i=0; i < n; i++) {
16    r += thickness[i];
17  }
18  return M_4PI_3 * cube(r);
19}
20
21static void
22Fq(double q, double *F1, double *F2, double core_sld, double core_radius,
23   double solvent_sld, double fp_n, double sld[], double thickness[])
24{
25  const int n = (int)(fp_n+0.5);
26  double f, r, last_sld;
27  r = core_radius;
28  last_sld = core_sld;
29  f = 0.;
30  for (int i=0; i<n; i++) {
31    f += M_4PI_3 * cube(r) * (sld[i] - last_sld) * sas_3j1x_x(q*r);
32    last_sld = sld[i];
33    r += thickness[i];
34  }
35  f += M_4PI_3 * cube(r) * (solvent_sld - last_sld) * sas_3j1x_x(q*r);
36  *F1 = 1e-2 * f;
37  *F2 = 1e-4 * f * f;
38}
Note: See TracBrowser for help on using the repository browser.