source: sasview/sansmodels/src/sans/models/c_models/sld_cal.cpp @ 57ca7f3

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 57ca7f3 was 0164899a, checked in by Jae Cho <jhjcho@…>, 14 years ago

new models and some bug fixes

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/**
2 * Scattering model classes
3 * The classes use the IGOR library found in
4 *   sansmodels/c_extensions/libmultifunc/librefl.h
5 */
6
7#include <math.h>
8#include "models.hh"
9#include "parameters.hh"
10#include <stdio.h>
11using namespace std;
12
13extern "C" {
14        #include "sld_cal.h"
15}
16
17SLDCalFunc :: SLDCalFunc() {
18        fun_type     = Parameter(0);
19        npts_inter   = Parameter(21);
20        shell_num        = Parameter(1);
21        nu_inter         = Parameter(2.5);
22        sld_left         = Parameter(1.0e-06);
23        sld_right        = Parameter(2.0e-06);
24}
25
26/**
27 * Function to evaluate 1D scattering function
28 * @param q: q-value
29 * @return: function value
30 */
31double SLDCalFunc :: operator()(double q) {
32        SLDCalParameters dp;
33
34        dp.fun_type = fun_type();
35        dp.npts_inter = npts_inter();
36        dp.shell_num = shell_num();
37        dp.nu_inter = nu_inter();
38        dp.sld_left = sld_left();
39        dp.sld_right = sld_right();
40
41        return sld_cal_analytical_1D(&dp, q);
42}
43
44/**
45 * Function to evaluate 2D scattering function
46 * @param q_x: value of Q along x
47 * @param q_y: value of Q along y
48 * @return: function value
49 */
50double SLDCalFunc :: operator()(double qx, double qy) {
51        double q = sqrt(qx*qx + qy*qy);
52                return (*this).operator()(q);
53}
54
55/**
56 * Function to evaluate 2D scattering function
57 * @param pars: parameters of the cylinder
58 * @param q: q-value
59 * @param phi: angle phi
60 * @return: function value
61 */
62double SLDCalFunc :: evaluate_rphi(double q, double phi) {
63        return (*this).operator()(q);
64}
65/**
66 * Function to calculate effective radius
67 * @return: effective radius value
68 */
69double SLDCalFunc :: calculate_ER() {
70//NOT implemented yet!!!
71}
Note: See TracBrowser for help on using the repository browser.