[27a0771] | 1 | /** |
---|
| 2 | * Scattering model for a lamellar |
---|
| 3 | * TODO: Add 2D analysis |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | #include "lamellarPS_HG.h" |
---|
| 7 | #include <math.h> |
---|
| 8 | #include "libCylinder.h" |
---|
| 9 | #include <stdio.h> |
---|
| 10 | #include <stdlib.h> |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | /** |
---|
| 14 | * Function to evaluate 1D scattering function |
---|
| 15 | * @param pars: parameters of the lamellar |
---|
| 16 | * @param q: q-value |
---|
| 17 | * @return: function value |
---|
| 18 | */ |
---|
| 19 | double lamellarPS_HG_analytical_1D(LamellarPSHGParameters *pars, double q) { |
---|
| 20 | double dp[10]; |
---|
| 21 | |
---|
| 22 | // Fill paramater array |
---|
| 23 | dp[0] = pars->scale; |
---|
| 24 | dp[1] = pars->spacing; |
---|
| 25 | dp[2] = pars->deltaT; |
---|
| 26 | dp[3] = pars->deltaH; |
---|
| 27 | dp[4] = pars->sld_tail; |
---|
| 28 | dp[5] = pars->sld_head; |
---|
| 29 | dp[6] = pars->sld_solvent; |
---|
| 30 | dp[7] = pars->n_plates; |
---|
| 31 | dp[8] = pars->caille; |
---|
| 32 | dp[9] = pars->background; |
---|
| 33 | |
---|
| 34 | // Call library function to evaluate model |
---|
| 35 | return LamellarPS_HG(dp, q); |
---|
| 36 | } |
---|
| 37 | /** |
---|
| 38 | * Function to evaluate 2D scattering function |
---|
| 39 | * @param pars: parameters of the lamellar |
---|
| 40 | * @param q: q-value |
---|
| 41 | * @return: function value |
---|
| 42 | */ |
---|
| 43 | double lamellarPS_HG_analytical_2DXY(LamellarPSHGParameters *pars, double qx, double qy) { |
---|
| 44 | double q; |
---|
| 45 | q = sqrt(qx*qx+qy*qy); |
---|
| 46 | return lamellarPS_HG_analytical_2D_scaled(pars, q, qx/q, qy/q); |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | /** |
---|
| 51 | * Function to evaluate 2D scattering function |
---|
| 52 | * @param pars: parameters of the lamellar |
---|
| 53 | * @param q: q-value |
---|
| 54 | * @param phi: angle phi |
---|
| 55 | * @return: function value |
---|
| 56 | */ |
---|
| 57 | double lamellarPS_HG_analytical_2D(LamellarPSHGParameters *pars, double q, double phi) { |
---|
| 58 | return lamellarPS_HG_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | /** |
---|
| 62 | * Function to evaluate 2D scattering function |
---|
| 63 | * @param pars: parameters of the lamellar |
---|
| 64 | * @param q: q-value |
---|
| 65 | * @param q_x: q_x / q |
---|
| 66 | * @param q_y: q_y / q |
---|
| 67 | * @return: function value |
---|
| 68 | */ |
---|
| 69 | double lamellarPS_HG_analytical_2D_scaled(LamellarPSHGParameters *pars, double q, double q_x, double q_y) { |
---|
| 70 | return 1.0; |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | |
---|