core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since d42dd4a was
d42dd4a,
checked in by pkienzle, 5 years ago
|
fix compiler warnings for CUDA
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[f7930be] | 1 | |
---|
| 2 | static double |
---|
| 3 | f_constant(double q, double r, double sld) |
---|
| 4 | { |
---|
[925ad6e] | 5 | const double bes = sas_3j1x_x(q * r); |
---|
[c5ac2b2] | 6 | const double vol = M_4PI_3 * cube(r); |
---|
[f7930be] | 7 | return sld * vol * bes; |
---|
| 8 | } |
---|
| 9 | |
---|
[21fbab1] | 10 | static double |
---|
[ee60aa7] | 11 | outer_radius(double core_radius, double fp_n, double thickness[]) |
---|
[f7930be] | 12 | { |
---|
| 13 | double r = core_radius; |
---|
[21fbab1] | 14 | int n = (int)(fp_n+0.5); |
---|
[c5ac2b2] | 15 | for (int i=0; i < n; i++) { |
---|
[f7930be] | 16 | r += thickness[i]; |
---|
| 17 | } |
---|
[ee60aa7] | 18 | return r; |
---|
[f7930be] | 19 | } |
---|
| 20 | |
---|
[d277229] | 21 | static double |
---|
[ee60aa7] | 22 | form_volume(double core_radius, double fp_n, double thickness[]) |
---|
[d277229] | 23 | { |
---|
[ee60aa7] | 24 | return M_4PI_3 * cube(outer_radius(core_radius, fp_n, thickness)); |
---|
[d277229] | 25 | } |
---|
| 26 | |
---|
| 27 | static double |
---|
| 28 | effective_radius(int mode, double core_radius, double fp_n, double thickness[]) |
---|
| 29 | { |
---|
[ee60aa7] | 30 | switch (mode) { |
---|
[d42dd4a] | 31 | default: |
---|
[ee60aa7] | 32 | case 1: // outer radius |
---|
| 33 | return outer_radius(core_radius, fp_n, thickness); |
---|
| 34 | case 2: // core radius |
---|
| 35 | return core_radius; |
---|
| 36 | } |
---|
[d277229] | 37 | } |
---|
| 38 | |
---|
[71b751d] | 39 | static void |
---|
| 40 | Fq(double q, double *F1, double *F2, double core_sld, double core_radius, |
---|
[21fbab1] | 41 | double solvent_sld, double fp_n, double sld[], double thickness[]) |
---|
[f7930be] | 42 | { |
---|
[21fbab1] | 43 | const int n = (int)(fp_n+0.5); |
---|
[c5ac2b2] | 44 | double f, r, last_sld; |
---|
[f7930be] | 45 | r = core_radius; |
---|
[c5ac2b2] | 46 | last_sld = core_sld; |
---|
| 47 | f = 0.; |
---|
| 48 | for (int i=0; i<n; i++) { |
---|
[925ad6e] | 49 | f += M_4PI_3 * cube(r) * (sld[i] - last_sld) * sas_3j1x_x(q*r); |
---|
[c5ac2b2] | 50 | last_sld = sld[i]; |
---|
[f7930be] | 51 | r += thickness[i]; |
---|
| 52 | } |
---|
[925ad6e] | 53 | f += M_4PI_3 * cube(r) * (solvent_sld - last_sld) * sas_3j1x_x(q*r); |
---|
[71b751d] | 54 | *F1 = 1e-2 * f; |
---|
| 55 | *F2 = 1e-4 * f * f; |
---|
[f7930be] | 56 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.