core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 8c6fbbc was
2c74c11,
checked in by Paul Kienzle <pkienzle@…>, 8 years ago
|
implicit Iqxy; fix divide by 0 for q=0
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[5c1d341] | 1 | double form_volume(double radius); |
---|
| 2 | |
---|
| 3 | double Iq(double q, |
---|
| 4 | double radius, |
---|
| 5 | double mass_dim, |
---|
| 6 | double cutoff_length); |
---|
| 7 | |
---|
| 8 | static double _mass_fractal_kernel(double q, |
---|
| 9 | double radius, |
---|
| 10 | double mass_dim, |
---|
| 11 | double cutoff_length) |
---|
| 12 | { |
---|
[61fd21d] | 13 | // Actively check the argument. |
---|
| 14 | if (mass_dim <= 1.0){ |
---|
| 15 | return 0.0; |
---|
| 16 | } |
---|
| 17 | |
---|
[9c461c7] | 18 | //calculate P(q) |
---|
| 19 | double pq = sph_j1c(q*radius); |
---|
| 20 | pq = pq*pq; |
---|
[5c1d341] | 21 | |
---|
| 22 | //calculate S(q) |
---|
| 23 | double mmo = mass_dim-1.0; |
---|
[6794301] | 24 | double sq = sas_gamma(mmo)*sin((mmo)*atan(q*cutoff_length)); |
---|
[5c1d341] | 25 | sq *= pow(cutoff_length, mmo); |
---|
| 26 | sq /= pow((1.0 + (q*cutoff_length)*(q*cutoff_length)),(mmo/2.0)); |
---|
| 27 | sq /= q; |
---|
| 28 | |
---|
| 29 | //combine and return |
---|
| 30 | double result = pq * sq; |
---|
| 31 | |
---|
| 32 | return result; |
---|
| 33 | } |
---|
| 34 | double form_volume(double radius){ |
---|
| 35 | |
---|
| 36 | return 1.333333333333333*M_PI*radius*radius*radius; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | double Iq(double q, |
---|
| 40 | double radius, |
---|
| 41 | double mass_dim, |
---|
| 42 | double cutoff_length) |
---|
| 43 | { |
---|
| 44 | return _mass_fractal_kernel(q, |
---|
| 45 | radius, |
---|
| 46 | mass_dim, |
---|
| 47 | cutoff_length); |
---|
| 48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.