source: sasview/sansmodels/src/sans/models/c_extensions/onion.h @ 01de557

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 01de557 was 339ce67, checked in by Jae Cho <jhjcho@…>, 14 years ago

added some models and tests

  • Property mode set to 100644
File size: 5.6 KB
Line 
1#if !defined(o_h)
2#define onion_h
3
4/**
5 * Structure definition for sphere parameters
6 */
7 //[PYTHONCLASS] = OnionModel
8 //[DISP_PARAMS] = rad_core0, thick_shell1,thick_shell2,thick_shell3,thick_shell4, thick_shell5,thick_shell6,thick_shell7,thick_shell8,thick_shell9,thick_shell10
9 //[DESCRIPTION] =<text>Form factor of mutishells normalized by the volume. Here each shell is described
10 //                                              by an exponential function;
11 //                                                     I)
12 //                                                     For A_shell != 0,
13 //                                                     f(r) = B*exp(A_shell*(r-r_in)/thick_shell)+C
14 //                         where
15 //                                                             B=(sld_out-sld_in)/(exp(A_shell)-1)
16 //                                                             C=sld_in-B.
17 //                                                     Note that in the above case,
18 //                                                             the function becomes a linear function
19 //                                                             as A_shell --> 0+ or 0-.
20 //                                                     II)
21 //                                                     For the exact point of A_shell == 0,
22 //                                                     f(r) = sld_in ,i.e., it crosses over flat function
23 //                                                     Note that the 'sld_out' becaomes NULL in this case.
24 //
25 //                             background:background,
26 //                             rad_core0: radius of sphere(core)
27 //                             thick_shell#:the thickness of the shell#
28 //                             sld_core0: the SLD of the sphere
29 //                             sld_solv: the SLD of the solvent
30 //                             sld_shell: the SLD of the shell#
31 //                             A_shell#: the coefficient in the exponential function
32 //             </text>
33 //[FIXED]=  <text>rad_core0.width;thick_shell1.width;thick_shell2.width;thick_shell3.width;thick_shell4.width;thick_shell5.width;thick_shell6.width;thick_shell7.width;thick_shell8.width;thick_shell9.width;thick_shell10.width</text>
34 //[ORIENTATION_PARAMS]= <text> </text>
35
36typedef struct {
37        /// number of shells
38        //  [DEFAULT]=n_shells=1
39        int n_shells;
40    /// Scale factor
41    //  [DEFAULT]=scale= 1.0
42        double scale;
43    /// Radius of sphere [A]
44    //  [DEFAULT]=rad_core0=200.0 [A]
45        double rad_core0;
46        ///     sld_core [1/A^(2)]
47        //  [DEFAULT]=sld_core0= 1.0e-6 [1/A^(2)]
48        double sld_core0;
49        ///     sld_solv [1/A^(2)]
50        //  [DEFAULT]=sld_solv= 6.4e-6 [1/A^(2)]
51        double sld_solv;
52        /// Incoherent Background [1/cm]
53        //  [DEFAULT]=background=0 [1/cm]
54        double background;
55
56    //  [DEFAULT]=sld_out_shell1=2.0e-06 [1/A^(2)]
57    double sld_out_shell1;
58    //  [DEFAULT]=sld_out_shell2=2.5e-06 [1/A^(2)]
59    double sld_out_shell2;
60    //  [DEFAULT]=sld_out_shell3=3.0e-06 [1/A^(2)]
61    double sld_out_shell3;
62    //  [DEFAULT]=sld_out_shell4=3.5e-06 [1/A^(2)]
63    double sld_out_shell4;
64    //  [DEFAULT]=sld_out_shell5=4.0e-06 [1/A^(2)]
65    double sld_out_shell5;
66    //  [DEFAULT]=sld_out_shell6=4.5e-06 [1/A^(2)]
67    double sld_out_shell6;
68    //  [DEFAULT]=sld_out_shell7=5.0e-06 [1/A^(2)]
69    double sld_out_shell7;
70    //  [DEFAULT]=sld_out_shell8=5.5e-06 [1/A^(2)]
71    double sld_out_shell8;
72    //  [DEFAULT]=sld_out_shell9=6.0e-06 [1/A^(2)]
73    double sld_out_shell9;
74    //  [DEFAULT]=sld_out_shell10=6.2e-06 [1/A^(2)]
75    double sld_out_shell10;
76
77    //  [DEFAULT]=sld_in_shell1=1.7e-06 [1/A^(2)]
78    double sld_in_shell1;
79    //  [DEFAULT]=sld_in_shell2=2.2e-06 [1/A^(2)]
80    double sld_in_shell2;
81    //  [DEFAULT]=sld_in_shell3=2.7e-06 [1/A^(2)]
82    double sld_in_shell3;
83    //  [DEFAULT]=sld_in_shell4=3.2e-06 [1/A^(2)]
84    double sld_in_shell4;
85    //  [DEFAULT]=sld_in_shell5=3.7e-06 [1/A^(2)]
86    double sld_in_shell5;
87    //  [DEFAULT]=sld_in_shell6=4.2e-06 [1/A^(2)]
88    double sld_in_shell6;
89    //  [DEFAULT]=sld_in_shell7=4.7e-06 [1/A^(2)]
90    double sld_in_shell7;
91    //  [DEFAULT]=sld_in_shell8=5.2e-06 [1/A^(2)]
92    double sld_in_shell8;
93    //  [DEFAULT]=sld_in_shell9=5.7e-06 [1/A^(2)]
94    double sld_in_shell9;
95    //  [DEFAULT]=sld_in_shell10=6.0e-06 [1/A^(2)]
96    double sld_in_shell10;
97
98    //  [DEFAULT]=A_shell1=1.0
99    double A_shell1;
100    //  [DEFAULT]=A_shell2=1.0
101    double A_shell2;
102    //  [DEFAULT]=A_shell3=1.0
103    double A_shell3;
104    //  [DEFAULT]=A_shell4=1.0
105    double A_shell4;
106    //  [DEFAULT]=A_shell5=1.0
107    double A_shell5;
108    //  [DEFAULT]=A_shell6=1.0
109    double A_shell6;
110    //  [DEFAULT]=A_shell7=1.0
111    double A_shell7;
112    //  [DEFAULT]=A_shell8=1.0
113    double A_shell8;
114    //  [DEFAULT]=A_shell9=1.0
115    double A_shell9;
116    //  [DEFAULT]=A_shell10=1.0
117    double A_shell10;
118
119    //  [DEFAULT]=thick_shell1=50.0 [A]
120    double thick_shell1;
121    //  [DEFAULT]=thick_shell2=50.0 [A]
122    double thick_shell2;
123    //  [DEFAULT]=thick_shell3=50.0 [A]
124    double thick_shell3;
125    //  [DEFAULT]=thick_shell4=50.0 [A]
126    double thick_shell4;
127    //  [DEFAULT]=thick_shell5=50.0 [A]
128    double thick_shell5;
129    //  [DEFAULT]=thick_shell6=50.0 [A]
130    double thick_shell6;
131    //  [DEFAULT]=thick_shell7=50.0 [A]
132    double thick_shell7;
133    //  [DEFAULT]=thick_shell8=50.0 [A]
134    double thick_shell8;
135    //  [DEFAULT]=thick_shell9=50.0 [A]
136    double thick_shell9;
137    //  [DEFAULT]=thick_shell10=50.0 [A]
138    double thick_shell10;
139
140    //  [DEFAULT]=func_shell1=2
141    int func_shell1;
142    //  [DEFAULT]=func_shell2=2
143    int func_shell2;
144    //  [DEFAULT]=func_shell3=2
145    int func_shell3;
146    //  [DEFAULT]=func_shell4=2
147    int func_shell4;
148    //  [DEFAULT]=func_shell5=2
149    int func_shell5;
150    //  [DEFAULT]=func_shell6=2
151    int func_shell6;
152    //  [DEFAULT]=func_shell7=2
153    int func_shell7;
154    //  [DEFAULT]=func_shell8=2
155    int func_shell8;
156    //  [DEFAULT]=func_shell9=2
157    int func_shell9;
158    //  [DEFAULT]=func_shell10=2
159    int func_shell10;
160} OnionParameters;
161
162double so_kernel(double dq[], double q);
163
164/// 1D scattering function
165double onion_analytical_1D(OnionParameters *pars, double q);
166
167/// 2D scattering function
168double onion_analytical_2D(OnionParameters *pars, double q, double phi);
169double onion_analytical_2DXY(OnionParameters *pars, double qx, double qy);
170
171#endif
Note: See TracBrowser for help on using the repository browser.