Ignore:
Timestamp:
Jan 5, 2012 12:16:29 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:
011e0e4
Parents:
bbbed8c
Message:

refactored bunch of models

File:
1 edited

Legend:

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

    r67424cd r0ba3b08  
    11#if !defined(Hardsphere_h) 
    22#define Hardsphere_h 
     3#include "parameters.hh" 
    34 
    45/** 
    56 * Structure definition for HardsphereStructure (factor) parameters 
    67 */ 
    7  //[PYTHONCLASS] = HardsphereStructure 
    8  //[DISP_PARAMS] = effect_radius 
    9  //[DESCRIPTION] =<text>Structure factor for interacting particles:                   . 
    10  // 
    11  //  The interparticle potential is 
    12  // 
    13  //                     U(r)= inf   , r < 2R 
    14  //                         = 0     , r >= 2R 
    15  // 
    16  //                                             R: effective radius of the Hardsphere particle 
    17  //                                             V:The volume fraction 
    18  // 
    19  //    Ref: Percus., J. K.,etc., J. Phy. 
    20  //     Rev. 1958, 110, 1. 
    21  //      </text> 
    22  //[FIXED]= effect_radius.width 
     8//[PYTHONCLASS] = HardsphereStructure 
     9//[DISP_PARAMS] = effect_radius 
     10//[DESCRIPTION] =<text>Structure factor for interacting particles:                   . 
     11// 
     12//  The interparticle potential is 
     13// 
     14//                     U(r)= inf   , r < 2R 
     15//                         = 0     , r >= 2R 
     16// 
     17//                                              R: effective radius of the Hardsphere particle 
     18//                                              V:The volume fraction 
     19// 
     20//    Ref: Percus., J. K.,etc., J. Phy. 
     21//     Rev. 1958, 110, 1. 
     22//       </text> 
     23//[FIXED]= effect_radius.width 
    2324 
     25class HardsphereStructure{ 
     26public: 
     27  // Model parameters 
     28  /// effect radius of hardsphere [A] 
     29  //  [DEFAULT]=effect_radius=50.0 [A] 
     30  Parameter effect_radius; 
    2431 
    25 typedef struct { 
    26     /// effect radius of hardsphere [A] 
    27     //  [DEFAULT]=effect_radius=50.0 [A] 
    28     double effect_radius; 
     32  /// Volume fraction 
     33  //  [DEFAULT]=volfraction= 0.2 
     34  Parameter volfraction; 
    2935 
    30     /// Volume fraction 
    31     //  [DEFAULT]=volfraction= 0.2 
    32     double volfraction; 
    33 } HardsphereParameters; 
     36  // Constructor 
     37  HardsphereStructure(); 
    3438 
    35  
    36  
    37 /// 1D scattering function 
    38 //double Hardsphere_analytical_1D(HardsphereParameters *pars, double q); 
    39  
    40 /// 2D scattering function 
    41 //double Hardsphere_analytical_2D(HardsphereParameters *pars, double q, double phi); 
    42 //double Hardsphere_analytical_2DXY(HardsphereParameters *pars, double qx, double qy); 
     39  // Operators to get I(Q) 
     40  double operator()(double q); 
     41  double operator()(double qx, double qy); 
     42  double calculate_ER(); 
     43  double evaluate_rphi(double q, double phi); 
     44}; 
    4345 
    4446#endif 
Note: See TracChangeset for help on using the changeset viewer.