source: sasview/sansmodels/src/sans/models/c_extensions/StickyHS.c @ f99a6b1

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 f99a6b1 was 25579e8, checked in by Jae Cho <jhjcho@…>, 16 years ago

Enable structure factors

  • Property mode set to 100644
File size: 986 bytes
RevLine 
[25579e8]1/**
2 * Structure factor for a hardsphere
3 * @author: Jae Hie Cho / UTK
4 */
5
6#include "StickyHS.h"
7#include "libStructureFactor.h"
8#include <math.h>
9
10
11/**
12 * Function to evaluate 1D scattering function
13 * @param pars: parameters of the StickyHS_struct
14 * @param q: q-value
15 * @return: function value
16 */
17double StickyHS_analytical_1D(StickyHSParameters *pars, double q) {
18        double dp[4];
19       
20        dp[0] = pars->radius;
21        dp[1] = pars->volfraction;     
22        dp[2] = pars->perturb;
23        dp[3] = pars->stickiness;       
24        return StickyHS_Struct(dp, q);
25}
26   
27/**
28 * Function to evaluate 2D scattering function
29 * @param pars: parameters of the StickyHS_struct
30 * @param q: q-value
31 * @return: function value
32 */
33double StickyHS_analytical_2D(StickyHSParameters *pars, double q, double phi) {
34        return StickyHS_analytical_1D(pars,q);
35}
36
37double StickyHS_analytical_2DXY(StickyHSParameters *pars, double qx, double qy){
38        return StickyHS_analytical_1D(pars,sqrt(qx*qx+qy*qy)); 
39}
Note: See TracBrowser for help on using the repository browser.