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 c09ace41 was
f10063e,
checked in by Jae Cho <jhjcho@…>, 15 years ago
|
Updated the definition of SLD params according to new libigor functions
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[5068697] | 1 | /** |
---|
| 2 | * Scattering model for a parallelepiped |
---|
| 3 | * TODO: Add 2D analysis |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | #include "flexible_cylinder.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 flexible cylinder |
---|
| 16 | * @param q: q-value |
---|
| 17 | * @return: function value |
---|
| 18 | */ |
---|
| 19 | double flexible_cylinder_analytical_1D(FlexibleCylinderParameters *pars, double q) { |
---|
[f10063e] | 20 | double dp[7]; |
---|
[ea07075] | 21 | |
---|
[5068697] | 22 | // Fill paramater array |
---|
| 23 | dp[0] = pars->scale; |
---|
| 24 | dp[1] = pars->length; |
---|
| 25 | dp[2] = pars->kuhn_length; |
---|
| 26 | dp[3] = pars->radius; |
---|
[f10063e] | 27 | dp[4] = pars->sldCyl; |
---|
| 28 | dp[5] = pars->sldSolv; |
---|
| 29 | dp[6] = pars->background; |
---|
[5068697] | 30 | |
---|
| 31 | // Call library function to evaluate model |
---|
[ea07075] | 32 | return FlexExclVolCyl(dp, q); |
---|
[5068697] | 33 | } |
---|
| 34 | /** |
---|
| 35 | * Function to evaluate 2D scattering function |
---|
| 36 | * @param pars: parameters of the flexible cylinder |
---|
| 37 | * @param q: q-value |
---|
| 38 | * @return: function value |
---|
| 39 | */ |
---|
| 40 | double flexible_cylinder_analytical_2DXY(FlexibleCylinderParameters *pars, double qx, double qy) { |
---|
| 41 | double q; |
---|
| 42 | q = sqrt(qx*qx+qy*qy); |
---|
[ea07075] | 43 | return flexible_cylinder_analytical_1D(pars, q); |
---|
| 44 | } |
---|
[5068697] | 45 | |
---|
| 46 | |
---|
| 47 | /** |
---|
| 48 | * Function to evaluate 2D scattering function |
---|
| 49 | * @param pars: parameters of the flexible cylinder |
---|
| 50 | * @param q: q-value |
---|
| 51 | * @param phi: angle phi |
---|
| 52 | * @return: function value |
---|
| 53 | */ |
---|
| 54 | double flexible_cylinder_analytical_2D(FlexibleCylinderParameters *pars, double q, double phi) { |
---|
[ea07075] | 55 | return flexible_cylinder_analytical_1D(pars, q); |
---|
[5068697] | 56 | } |
---|
[ea07075] | 57 | |
---|
[5068697] | 58 | |
---|
Note: See
TracBrowser
for help on using the repository browser.