Changeset 0c2389e in sasview for sansmodels/src/c_extensions


Ignore:
Timestamp:
Jan 4, 2012 6:00:52 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:
8343e18
Parents:
dbddbf5
Message:

refactored capped cylinder

Location:
sansmodels/src/c_extensions
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/c_extensions/capcyl.h

    r67424cd r0c2389e  
    11#if !defined(capcyl_h) 
    22#define capcyl_h 
     3#include "parameters.hh" 
    34 
    45/** 
     
    2728 //[ORIENTATION_PARAMS]= <text> phi; theta; phi.width; theta.width</text> 
    2829 
    29 typedef struct { 
    30     /// Scale factor 
    31     //  [DEFAULT]=scale= 1.0 
    32     double scale; 
     30class CappedCylinderModel{ 
     31public: 
     32  // Model parameters 
     33  /// Scale factor 
     34  //  [DEFAULT]=scale= 1.0 
     35  Parameter scale; 
    3336 
    34     /// rad_cyl [A] 
    35     //  [DEFAULT]=rad_cyl=20.0 [A] 
    36     double rad_cyl; 
     37  /// rad_cyl [A] 
     38  //  [DEFAULT]=rad_cyl=20.0 [A] 
     39  Parameter rad_cyl; 
    3740 
    38     /// length of the cylinder 
    39     //  [DEFAULT]=len_cyl=400.0 [A] 
    40     double len_cyl; 
     41  /// length of the cylinder 
     42  //  [DEFAULT]=len_cyl=400.0 [A] 
     43  Parameter len_cyl; 
    4144 
    42     /// Radius of sphere [A] 
    43     //  [DEFAULT]=rad_cap=40.0 [A] 
    44     double rad_cap; 
     45  /// Radius of sphere [A] 
     46  //  [DEFAULT]=rad_cap=40.0 [A] 
     47  Parameter rad_cap; 
    4548 
    46     /// sld_capcyl [1/A^(2)] 
    47     //  [DEFAULT]=sld_capcyl= 1.0e-6 [1/A^(2)] 
    48     double sld_capcyl; 
     49  /// sld_capcyl [1/A^(2)] 
     50  //  [DEFAULT]=sld_capcyl= 1.0e-6 [1/A^(2)] 
     51  Parameter sld_capcyl; 
    4952 
    50     /// sld_solv [1/A^(2)] 
    51     //  [DEFAULT]=sld_solv= 6.3e-6 [1/A^(2)] 
    52     double sld_solv; 
     53  /// sld_solv [1/A^(2)] 
     54  //  [DEFAULT]=sld_solv= 6.3e-6 [1/A^(2)] 
     55  Parameter sld_solv; 
    5356 
    54         /// Incoherent Background [1/cm] 
    55         //  [DEFAULT]=background=0.0 [1/cm] 
    56         double background; 
     57  /// Incoherent Background [1/cm] 
     58  //  [DEFAULT]=background=0.0 [1/cm] 
     59  Parameter background; 
    5760 
    58     /// Angle of the main axis against z-axis in detector plane [deg] 
    59     //  [DEFAULT]=theta=0.0 [deg] 
    60     double theta; 
    61     /// Azimuthal angle around z-axis in detector plane [deg] 
    62     //  [DEFAULT]=phi=0.0 [deg] 
    63     double phi; 
     61  /// Angle of the main axis against z-axis in detector plane [deg] 
     62  //  [DEFAULT]=theta=0.0 [deg] 
     63  Parameter theta; 
    6464 
    65 } CapCylParameters; 
     65  /// Azimuthal angle around z-axis in detector plane [deg] 
     66  //  [DEFAULT]=phi=0.0 [deg] 
     67  Parameter phi; 
    6668 
     69  // Constructor 
     70  CappedCylinderModel(); 
    6771 
    68  
    69 /// 1D scattering function 
    70 double capcyl_analytical_1D(CapCylParameters *pars, double q); 
    71  
    72 /// 2D scattering function 
    73 double capcyl_analytical_2D(CapCylParameters *pars, double q, double phi); 
    74 double capcyl_analytical_2DXY(CapCylParameters *pars, double qx, double qy); 
    75 double capcyl_analytical_2D_scaled(CapCylParameters *pars, double q, double q_x, double q_y); 
     72  // Operators to get I(Q) 
     73  double operator()(double q); 
     74  double operator()(double qx, double qy); 
     75  double calculate_ER(); 
     76  double evaluate_rphi(double q, double phi); 
     77}; 
    7678 
    7779#endif 
Note: See TracChangeset for help on using the changeset viewer.