source: sasview/sansmodels/src/sans/models/c_extensions/onion.h @ 31f9c172

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 31f9c172 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
RevLine 
[e096270]1#if !defined(o_h)
2#define onion_h
3
4/**
5 * Structure definition for sphere parameters
6 */
7 //[PYTHONCLASS] = OnionModel
[339ce67]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
[e096270]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,
[339ce67]26 //                             rad_core0: radius of sphere(core)
[e096270]27 //                             thick_shell#:the thickness of the shell#
[339ce67]28 //                             sld_core0: the SLD of the sphere
[e096270]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>
[339ce67]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>
[e096270]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]
[339ce67]44    //  [DEFAULT]=rad_core0=200.0 [A]
45        double rad_core0;
[e096270]46        ///     sld_core [1/A^(2)]
[339ce67]47        //  [DEFAULT]=sld_core0= 1.0e-6 [1/A^(2)]
48        double sld_core0;
[e096270]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
[7381f34]56    //  [DEFAULT]=sld_out_shell1=2.0e-06 [1/A^(2)]
[e096270]57    double sld_out_shell1;
[7381f34]58    //  [DEFAULT]=sld_out_shell2=2.5e-06 [1/A^(2)]
[e096270]59    double sld_out_shell2;
[7381f34]60    //  [DEFAULT]=sld_out_shell3=3.0e-06 [1/A^(2)]
[e096270]61    double sld_out_shell3;
[7381f34]62    //  [DEFAULT]=sld_out_shell4=3.5e-06 [1/A^(2)]
[e096270]63    double sld_out_shell4;
[7381f34]64    //  [DEFAULT]=sld_out_shell5=4.0e-06 [1/A^(2)]
[e096270]65    double sld_out_shell5;
[7381f34]66    //  [DEFAULT]=sld_out_shell6=4.5e-06 [1/A^(2)]
[e096270]67    double sld_out_shell6;
[7381f34]68    //  [DEFAULT]=sld_out_shell7=5.0e-06 [1/A^(2)]
[e096270]69    double sld_out_shell7;
[7381f34]70    //  [DEFAULT]=sld_out_shell8=5.5e-06 [1/A^(2)]
[e096270]71    double sld_out_shell8;
[7381f34]72    //  [DEFAULT]=sld_out_shell9=6.0e-06 [1/A^(2)]
[e096270]73    double sld_out_shell9;
[7381f34]74    //  [DEFAULT]=sld_out_shell10=6.2e-06 [1/A^(2)]
[e096270]75    double sld_out_shell10;
76
[7381f34]77    //  [DEFAULT]=sld_in_shell1=1.7e-06 [1/A^(2)]
[e096270]78    double sld_in_shell1;
[7381f34]79    //  [DEFAULT]=sld_in_shell2=2.2e-06 [1/A^(2)]
[e096270]80    double sld_in_shell2;
[7381f34]81    //  [DEFAULT]=sld_in_shell3=2.7e-06 [1/A^(2)]
[e096270]82    double sld_in_shell3;
[7381f34]83    //  [DEFAULT]=sld_in_shell4=3.2e-06 [1/A^(2)]
[e096270]84    double sld_in_shell4;
[7381f34]85    //  [DEFAULT]=sld_in_shell5=3.7e-06 [1/A^(2)]
[e096270]86    double sld_in_shell5;
[7381f34]87    //  [DEFAULT]=sld_in_shell6=4.2e-06 [1/A^(2)]
[e096270]88    double sld_in_shell6;
[7381f34]89    //  [DEFAULT]=sld_in_shell7=4.7e-06 [1/A^(2)]
[e096270]90    double sld_in_shell7;
[7381f34]91    //  [DEFAULT]=sld_in_shell8=5.2e-06 [1/A^(2)]
[e096270]92    double sld_in_shell8;
[7381f34]93    //  [DEFAULT]=sld_in_shell9=5.7e-06 [1/A^(2)]
[e096270]94    double sld_in_shell9;
[7381f34]95    //  [DEFAULT]=sld_in_shell10=6.0e-06 [1/A^(2)]
[e096270]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
[7381f34]119    //  [DEFAULT]=thick_shell1=50.0 [A]
[e096270]120    double thick_shell1;
[7381f34]121    //  [DEFAULT]=thick_shell2=50.0 [A]
[e096270]122    double thick_shell2;
[7381f34]123    //  [DEFAULT]=thick_shell3=50.0 [A]
[e096270]124    double thick_shell3;
[7381f34]125    //  [DEFAULT]=thick_shell4=50.0 [A]
[e096270]126    double thick_shell4;
[7381f34]127    //  [DEFAULT]=thick_shell5=50.0 [A]
[e096270]128    double thick_shell5;
[7381f34]129    //  [DEFAULT]=thick_shell6=50.0 [A]
[e096270]130    double thick_shell6;
[7381f34]131    //  [DEFAULT]=thick_shell7=50.0 [A]
[e096270]132    double thick_shell7;
[7381f34]133    //  [DEFAULT]=thick_shell8=50.0 [A]
[e096270]134    double thick_shell8;
[7381f34]135    //  [DEFAULT]=thick_shell9=50.0 [A]
[e096270]136    double thick_shell9;
[7381f34]137    //  [DEFAULT]=thick_shell10=50.0 [A]
[e096270]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.