Ignore:
Timestamp:
Jan 5, 2012 6:24:51 PM (13 years ago)
Author:
Mathieu Doucet <doucetm@…>
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
Message:

refactored bunch of models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/c_models/lamellar.cpp

    r67424cd r82c11d3  
    1818 *   sansmodels/src/libigor 
    1919 * 
    20  *      TODO: refactor so that we pull in the old sansmodels.c_extensions 
    2120 */ 
    2221 
    2322#include <math.h> 
    24 #include "models.hh" 
    2523#include "parameters.hh" 
    2624#include <stdio.h> 
    2725using namespace std; 
     26#include "lamellar.h" 
    2827 
    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*/ 
     31static 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); 
    3255} 
    3356 
     
    3962        sld_sol    = Parameter(6.3e-6); 
    4063        background = Parameter(0.0); 
    41  
    4264} 
    4365 
Note: See TracChangeset for help on using the changeset viewer.