[96656e3] | 1 | // The original code, of which work was not DANSE funded, |
---|
| 2 | // was provided by J. Cho. |
---|
| 3 | #if !defined(o_h) |
---|
| 4 | #define refl_adv_h |
---|
| 5 | |
---|
| 6 | /** |
---|
| 7 | * Structure definition for sphere parameters |
---|
| 8 | */ |
---|
| 9 | //[PYTHONCLASS] = ReflAdvModel |
---|
| 10 | //[DISP_PARAMS] = thick_inter0 |
---|
| 11 | //[DESCRIPTION] =<text>Calculate neutron reflectivity using the Parratt iterative formula |
---|
| 12 | // Parameters: |
---|
| 13 | // background:background |
---|
| 14 | // scale: scale factor |
---|
| 15 | // sld_bottom0: the SLD of the substrate |
---|
| 16 | // sld_medium: the SLD of the incident medium |
---|
| 17 | // or superstrate |
---|
| 18 | // sld_flatN: the SLD of the flat region of |
---|
| 19 | // the N'th layer |
---|
| 20 | // thick_flatN: the thickness of the flat |
---|
| 21 | // region of the N'th layer |
---|
| 22 | // func_interN: the function used to describe |
---|
| 23 | // the interface of the N'th layer |
---|
| 24 | // nu_interN: the coefficient for the func_interN |
---|
| 25 | // thick_interN: the thickness of the interface |
---|
| 26 | // of the N'th layer |
---|
| 27 | // Note: the layer number starts to increase |
---|
| 28 | // from the bottom (substrate) to the top. |
---|
| 29 | // </text> |
---|
| 30 | //[FIXED]= <text></text> |
---|
| 31 | //[NON_FITTABLE_PARAMS]= <text>n_layers;func_inter0;func_inter1;func_inter2;func_inter3;func_inter4;func_inter5;func_inter5;func_inter7;func_inter8;func_inter9;func_inter10 </text> |
---|
| 32 | //[ORIENTATION_PARAMS]= <text> </text> |
---|
| 33 | |
---|
| 34 | typedef struct { |
---|
| 35 | /// number of layers |
---|
| 36 | // [DEFAULT]=n_layers=1 |
---|
| 37 | int n_layers; |
---|
| 38 | /// Scale factor |
---|
| 39 | // [DEFAULT]=scale= 1.0 |
---|
| 40 | double scale; |
---|
| 41 | /// thick_inter0 [A] |
---|
| 42 | // [DEFAULT]=thick_inter0=50.0 [A] |
---|
| 43 | double thick_inter0; |
---|
| 44 | /// func_inter0 |
---|
| 45 | // [DEFAULT]=func_inter0= 0 |
---|
| 46 | double func_inter0; |
---|
| 47 | /// sld_bottom0 [1/A^(2)] |
---|
| 48 | // [DEFAULT]=sld_bottom0= 2.07e-6 [1/A^(2)] |
---|
| 49 | double sld_bottom0; |
---|
| 50 | /// sld_medium [1/A^(2)] |
---|
| 51 | // [DEFAULT]=sld_medium= 1.0e-6 [1/A^(2)] |
---|
| 52 | double sld_medium; |
---|
| 53 | /// Background |
---|
| 54 | // [DEFAULT]=background=0 |
---|
| 55 | double background; |
---|
| 56 | |
---|
| 57 | // [DEFAULT]=sld_flat1=4.0e-06 [1/A^(2)] |
---|
| 58 | double sld_flat1; |
---|
| 59 | // [DEFAULT]=sld_flat2=3.5e-06 [1/A^(2)] |
---|
| 60 | double sld_flat2; |
---|
| 61 | // [DEFAULT]=sld_flat3=4.0e-06 [1/A^(2)] |
---|
| 62 | double sld_flat3; |
---|
| 63 | // [DEFAULT]=sld_flat4=3.5e-06 [1/A^(2)] |
---|
| 64 | double sld_flat4; |
---|
| 65 | // [DEFAULT]=sld_flat5=4.0e-06 [1/A^(2)] |
---|
| 66 | double sld_flat5; |
---|
| 67 | // [DEFAULT]=sld_flat6=3.5e-06 [1/A^(2)] |
---|
| 68 | double sld_flat6; |
---|
| 69 | // [DEFAULT]=sld_flat7=4.0e-06 [1/A^(2)] |
---|
| 70 | double sld_flat7; |
---|
| 71 | // [DEFAULT]=sld_flat8=3.5e-06 [1/A^(2)] |
---|
| 72 | double sld_flat8; |
---|
| 73 | // [DEFAULT]=sld_flat9=4.0e-06 [1/A^(2)] |
---|
| 74 | double sld_flat9; |
---|
| 75 | // [DEFAULT]=sld_flat10=3.5e-06 [1/A^(2)] |
---|
| 76 | double sld_flat10; |
---|
| 77 | |
---|
| 78 | // [DEFAULT]=thick_inter1=50 [A] |
---|
| 79 | double thick_inter1; |
---|
| 80 | // [DEFAULT]=thick_inter2=50 [A] |
---|
| 81 | double thick_inter2; |
---|
| 82 | // [DEFAULT]=thick_inter3=50 [A] |
---|
| 83 | double thick_inter3; |
---|
| 84 | // [DEFAULT]=thick_inter4=50 [A] |
---|
| 85 | double thick_inter4; |
---|
| 86 | // [DEFAULT]=thick_inter5=50 [A] |
---|
| 87 | double thick_inter5; |
---|
| 88 | // [DEFAULT]=thick_inter6=50 [A] |
---|
| 89 | double thick_inter6; |
---|
| 90 | // [DEFAULT]=thick_inter7=50 [A] |
---|
| 91 | double thick_inter7; |
---|
| 92 | // [DEFAULT]=thick_inter8=50 [A] |
---|
| 93 | double thick_inter8; |
---|
| 94 | // [DEFAULT]=thick_inter9=50 [A] |
---|
| 95 | double thick_inter9; |
---|
| 96 | // [DEFAULT]=thick_inter10=50 [A] |
---|
| 97 | double thick_inter10; |
---|
| 98 | |
---|
| 99 | // [DEFAULT]=thick_flat1=100 [A] |
---|
| 100 | double thick_flat1; |
---|
| 101 | // [DEFAULT]=thick_flat2=100 [A] |
---|
| 102 | double thick_flat2; |
---|
| 103 | // [DEFAULT]=thick_flat3=100 [A] |
---|
| 104 | double thick_flat3; |
---|
| 105 | // [DEFAULT]=thick_flat4=100 [A] |
---|
| 106 | double thick_flat4; |
---|
| 107 | // [DEFAULT]=thick_flat5=100 [A] |
---|
| 108 | double thick_flat5; |
---|
| 109 | // [DEFAULT]=thick_flat6=100 [A] |
---|
| 110 | double thick_flat6; |
---|
| 111 | // [DEFAULT]=thick_flat7=100 [A] |
---|
| 112 | double thick_flat7; |
---|
| 113 | // [DEFAULT]=thick_flat8=100 [A] |
---|
| 114 | double thick_flat8; |
---|
| 115 | // [DEFAULT]=thick_flat9=100 [A] |
---|
| 116 | double thick_flat9; |
---|
| 117 | // [DEFAULT]=thick_flat10=100 [A] |
---|
| 118 | double thick_flat10; |
---|
| 119 | |
---|
| 120 | // [DEFAULT]=func_inter1=0 |
---|
| 121 | double func_inter1; |
---|
| 122 | // [DEFAULT]=func_inter2=0 |
---|
| 123 | double func_inter2; |
---|
| 124 | // [DEFAULT]=func_inter3=0 |
---|
| 125 | double func_inter3; |
---|
| 126 | // [DEFAULT]=func_inter4=0 |
---|
| 127 | double func_inter4; |
---|
| 128 | // [DEFAULT]=func_inter5=0 |
---|
| 129 | double func_inter5; |
---|
| 130 | // [DEFAULT]=func_inter6=0 |
---|
| 131 | double func_inter6; |
---|
| 132 | // [DEFAULT]=func_inter7=0 |
---|
| 133 | double func_inter7; |
---|
| 134 | // [DEFAULT]=func_inter8=0 |
---|
| 135 | double func_inter8; |
---|
| 136 | // [DEFAULT]=func_inter9=0 |
---|
| 137 | double func_inter9; |
---|
| 138 | // [DEFAULT]=func_inter10=0 |
---|
| 139 | double func_inter10; |
---|
| 140 | |
---|
| 141 | // [DEFAULT]=sldIM_flat1=0 [1/A^(2)] |
---|
| 142 | double sldIM_flat1; |
---|
| 143 | // [DEFAULT]=sldIM_flat2=0 [1/A^(2)] |
---|
| 144 | double sldIM_flat2; |
---|
| 145 | // [DEFAULT]=sldIM_flat3=0 [1/A^(2)] |
---|
| 146 | double sldIM_flat3; |
---|
| 147 | // [DEFAULT]=sldIM_flat4=0 [1/A^(2)] |
---|
| 148 | double sldIM_flat4; |
---|
| 149 | // [DEFAULT]=sldIM_flat5=0 [1/A^(2)] |
---|
| 150 | double sldIM_flat5; |
---|
| 151 | // [DEFAULT]=sldIM_flat6=0 [1/A^(2)] |
---|
| 152 | double sldIM_flat6; |
---|
| 153 | // [DEFAULT]=sldIM_flat7=0 [1/A^(2)] |
---|
| 154 | double sldIM_flat7; |
---|
| 155 | // [DEFAULT]=sldIM_flat8=0 [1/A^(2)] |
---|
| 156 | double sldIM_flat8; |
---|
| 157 | // [DEFAULT]=sldIM_flat9=0 [1/A^(2)] |
---|
| 158 | double sldIM_flat9; |
---|
| 159 | // [DEFAULT]=sldIM_flat10=0 [1/A^(2)] |
---|
| 160 | double sldIM_flat10; |
---|
| 161 | |
---|
| 162 | // [DEFAULT]=nu_inter1=2.5 |
---|
| 163 | double nu_inter1; |
---|
| 164 | // [DEFAULT]=nu_inter2=2.5 |
---|
| 165 | double nu_inter2; |
---|
| 166 | // [DEFAULT]=nu_inter3=2.5 |
---|
| 167 | double nu_inter3; |
---|
| 168 | // [DEFAULT]=nu_inter4=2.5 |
---|
| 169 | double nu_inter4; |
---|
| 170 | // [DEFAULT]=nu_inter5=2.5 |
---|
| 171 | double nu_inter5; |
---|
| 172 | // [DEFAULT]=nu_inter6=2.5 |
---|
| 173 | double nu_inter6; |
---|
| 174 | // [DEFAULT]=nu_inter7=2.5 |
---|
| 175 | double nu_inter7; |
---|
| 176 | // [DEFAULT]=nu_inter8=2.5 |
---|
| 177 | double nu_inter8; |
---|
| 178 | // [DEFAULT]=nu_inter9=2.5 |
---|
| 179 | double nu_inter9; |
---|
| 180 | // [DEFAULT]=nu_inter10=2.5 |
---|
| 181 | double nu_inter10; |
---|
| 182 | |
---|
| 183 | |
---|
| 184 | // [DEFAULT]=sldIM_sub0=0 |
---|
| 185 | double sldIM_sub0; |
---|
| 186 | // [DEFAULT]=sldIM_medium=0 |
---|
| 187 | double sldIM_medium; |
---|
| 188 | // [DEFAULT]=npts_inter=21.0 |
---|
| 189 | double npts_inter; |
---|
| 190 | // [DEFAULT]=nu_inter0=2.5 |
---|
| 191 | double nu_inter0; |
---|
| 192 | } ReflAdvParameters; |
---|
| 193 | |
---|
| 194 | double re_adv_kernel(double dq[], double q); |
---|
| 195 | |
---|
| 196 | /// 1D scattering function |
---|
| 197 | double refl_adv_analytical_1D(ReflAdvParameters *pars, double q); |
---|
| 198 | |
---|
| 199 | /// 2D scattering function |
---|
| 200 | double refl_adv_analytical_2D(ReflAdvParameters *pars, double q, double phi); |
---|
| 201 | double refl_adv_analytical_2DXY(ReflAdvParameters *pars, double qx, double qy); |
---|
| 202 | |
---|
| 203 | #endif |
---|