Changeset 82c11d3 in sasview for sansmodels/src/c_models/lamellar.cpp
- Timestamp:
- Jan 5, 2012 6:24:51 PM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 20d91bd
- Parents:
- 98fdccd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/c_models/lamellar.cpp
r67424cd r82c11d3 18 18 * sansmodels/src/libigor 19 19 * 20 * TODO: refactor so that we pull in the old sansmodels.c_extensions21 20 */ 22 21 23 22 #include <math.h> 24 #include "models.hh"25 23 #include "parameters.hh" 26 24 #include <stdio.h> 27 25 using namespace std; 26 #include "lamellar.h" 28 27 29 extern "C" { 30 // #include "libCylinder.h" 31 #include "lamellar.h" 28 /* LamellarFFX : calculates the form factor of a lamellar structure - no S(q) effects included 29 -NO polydispersion included 30 */ 31 static double lamellar_kernel(double dp[], double q){ 32 double scale,del,sld_bi,sld_sol,contr,bkg; //local variables of coefficient wave 33 double inten, qval,Pq; 34 double Pi; 35 36 37 Pi = 4.0*atan(1.0); 38 scale = dp[0]; 39 del = dp[1]; 40 sld_bi = dp[2]; 41 sld_sol = dp[3]; 42 bkg = dp[4]; 43 qval = q; 44 contr = sld_bi -sld_sol; 45 46 Pq = 2.0*contr*contr/qval/qval*(1.0-cos(qval*del)); 47 48 inten = 2.0*Pi*scale*Pq/(qval*qval); //this is now dimensionless... 49 50 inten /= del; //normalize by the thickness (in A) 51 52 inten *= 1.0e8; // 1/A to 1/cm 53 54 return(inten+bkg); 32 55 } 33 56 … … 39 62 sld_sol = Parameter(6.3e-6); 40 63 background = Parameter(0.0); 41 42 64 } 43 65
Note: See TracChangeset
for help on using the changeset viewer.