source: sasview/sansmodels/src/sans/models/c_extensions/SquareWell.c @ 1aaa579

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 1aaa579 was 5eb9154, checked in by Jae Cho <jhjcho@…>, 15 years ago

calculation of the effective radius are added

  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[25579e8]1/**
[5eb9154]2 * SquareWell Structure factor
[25579e8]3 * @author: Jae Hie Cho / UTK
4 */
5
6#include "SquareWell.h"
7#include "libStructureFactor.h"
8#include <math.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 SquareWellStruct
16 * @param q: q-value
17 * @return: function value
18 */
19double SquareWell_analytical_1D(SquareWellParameters *pars, double q) {
20        double dp[4];
21
[5eb9154]22        dp[0] = pars->effect_radius;
[25579e8]23        dp[1] = pars->volfraction;
24        dp[2] = pars->welldepth;
25        dp[3] = pars->wellwidth;
[5eb9154]26
[25579e8]27        return SquareWellStruct(dp, q);
28}
[5eb9154]29
[25579e8]30/**
31 * Function to evaluate 2D scattering function
32 * @param pars: parameters of the SquareWellStruct
33 * @param q: q-value
34 * @return: function value
35 */
36double SquareWell_analytical_2D(SquareWellParameters *pars, double q, double phi) {
37        return SquareWell_analytical_1D(pars,q);
38}
39
40double SquareWell_analytical_2DXY(SquareWellParameters *pars, double qx, double qy){
[5eb9154]41        return SquareWell_analytical_1D(pars,sqrt(qx*qx+qy*qy));
[25579e8]42}
Note: See TracBrowser for help on using the repository browser.