source: sasview/sansmodels/src/sans/models/c_extensions/lamellarPC.c @ 74b1770

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 74b1770 was d5b6a9d, checked in by Jae Cho <jhjcho@…>, 14 years ago

new models

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/**
2 * Scattering model for a lamellar ParaCrystal
3 */
4
5#include "lamellarPC.h"
6#include <math.h>
7#include "libCylinder.h"
8#include <stdio.h>
9#include <stdlib.h>
10
11
12/**
13 * Function to evaluate 1D scattering function
14 * @param pars: parameters of a lamellar ParaCrystal Model
15 * @param q: q-value
16 * @return: function value
17 */
18double lamellarPC_analytical_1D(LamellarPCParameters *pars, double q) {
19        double dp[8];
20
21        // Fill paramater array
22        dp[0] = pars->scale;
23        dp[1] = pars->thickness;
24        dp[2] = pars->Nlayers;
25        dp[3] = pars->spacing;
26        dp[4] = pars->pd_spacing;
27        dp[5] = pars->sld_layer;
28        dp[6] = pars->sld_solvent;
29        dp[7] = pars->background;
30
31        // Call library function to evaluate model
32        return Lamellar_ParaCrystal(dp, q);
33}
34
35double lamellarPC_analytical_2D(LamellarPCParameters *pars, double q, double phi){
36        return lamellarPC_analytical_1D(pars,q);
37}
38double lamellarPC_analytical_2DXY(LamellarPCParameters *pars, double qx, double qy){
39        return lamellarPC_analytical_1D(pars,sqrt(qx*qx+qy*qy));
40}
Note: See TracBrowser for help on using the repository browser.