Changeset dbddbf5 in sasview for sansmodels/src/c_extensions


Ignore:
Timestamp:
Jan 4, 2012 5:43:34 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:
0c2389e
Parents:
d62f422
Message:

refactored cylinder model

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

Legend:

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

    r67424cd rdbddbf5  
    11#if !defined(cylinder_h) 
    22#define cylinder_h 
     3#include "parameters.hh" 
     4 
    35/** Structure definition for cylinder parameters 
    46 * [PYTHONCLASS] = CylinderModel 
     
    2325 
    2426 **/ 
    25 typedef struct { 
    26     /// Scale factor 
    27     //  [DEFAULT]=scale=1.0 
    28     double scale; 
    29     /// Radius of the cylinder [A] 
    30     //  [DEFAULT]=radius=20.0 [A] 
    31     double radius; 
    32     /// Length of the cylinder [A] 
    33     //  [DEFAULT]=length=400.0 [A] 
    34     double length; 
    35     /// Contrast [1/A^(2)] 
    36     //  [DEFAULT]=sldCyl=4.0e-6 [1/A^(2)] 
    37     double sldCyl; 
    38     /// sldCyl [1/A^(2)] 
    39     //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] 
    40     double sldSolv; 
    41         /// Incoherent Background [1/cm] 0.00 
    42         //  [DEFAULT]=background=0.0 [1/cm] 
    43         double background; 
    44     /// Orientation of the cylinder axis w/respect incoming beam [deg] 
    45     //  [DEFAULT]=cyl_theta=60.0 [deg] 
    46     double cyl_theta; 
    47     /// Orientation of the cylinder in the plane of the detector [deg] 
    48     //  [DEFAULT]=cyl_phi=60.0 [deg] 
    49     double cyl_phi; 
     27class CylinderModel{ 
     28public: 
     29  // Model parameters 
    5030 
    51 } CylinderParameters; 
     31  /// Scale factor 
     32  //  [DEFAULT]=scale=1.0 
     33  Parameter scale; 
    5234 
     35  /// Radius of the cylinder [A] 
     36  //  [DEFAULT]=radius=20.0 [A] 
     37  Parameter radius; 
    5338 
     39  /// Length of the cylinder [A] 
     40  //  [DEFAULT]=length=400.0 [A] 
     41  Parameter length; 
    5442 
    55 /// 1D scattering function 
    56 double cylinder_analytical_1D(CylinderParameters *pars, double q); 
     43  /// Contrast [1/A^(2)] 
     44  //  [DEFAULT]=sldCyl=4.0e-6 [1/A^(2)] 
     45  Parameter sldCyl; 
    5746 
    58 /// 2D scattering function 
    59 double cylinder_analytical_2D(CylinderParameters *pars, double q, double phi); 
    60 double cylinder_analytical_2DXY(CylinderParameters *pars, double qx, double qy); 
    61 double cylinder_analytical_2D_scaled(CylinderParameters *pars, double q, double q_x, double q_y); 
     47  /// sldCyl [1/A^(2)] 
     48  //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] 
     49  Parameter sldSolv; 
     50 
     51  /// Incoherent Background [1/cm] 0.00 
     52  //  [DEFAULT]=background=0.0 [1/cm] 
     53  Parameter background; 
     54 
     55  /// Orientation of the cylinder axis w/respect incoming beam [deg] 
     56  //  [DEFAULT]=cyl_theta=60.0 [deg] 
     57  Parameter cyl_theta; 
     58 
     59  /// Orientation of the cylinder in the plane of the detector [deg] 
     60  //  [DEFAULT]=cyl_phi=60.0 [deg] 
     61  Parameter cyl_phi; 
     62 
     63  // Constructor 
     64  CylinderModel(); 
     65 
     66  // Operators to get I(Q) 
     67  double operator()(double q); 
     68  double operator()(double qx, double qy); 
     69  double calculate_ER(); 
     70  double evaluate_rphi(double q, double phi); 
     71}; 
    6272 
    6373#endif 
Note: See TracChangeset for help on using the changeset viewer.