Changeset 0f5bc9f in sasview for sansmodels/src/sans/models


Ignore:
Timestamp:
Aug 19, 2008 12:42:22 PM (16 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:
d30fdde
Parents:
a86bbe9
Message:

Update of all C models to the new style of C++ models

Location:
sansmodels/src/sans/models
Files:
12 added
16 edited
1 moved

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/CoreShellCylinderModel.py

    rae3ce4e r0f5bc9f  
    11#!/usr/bin/env python 
     2""" 
     3        This software was developed by the University of Tennessee as part of the 
     4        Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     5        project funded by the US National Science Foundation. 
     6 
     7        If you use DANSE applications to do scientific research that leads to 
     8        publication, we ask that you acknowledge the use of the software with the 
     9        following sentence: 
     10 
     11        "This work benefited from DANSE software developed under NSF award DMR-0520547." 
     12 
     13        copyright 2008, University of Tennessee 
     14""" 
     15 
    216""" Provide functionality for a C extension model 
    317 
    418        WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    5                  DO NOT MODIFY THIS FILE, MODIFY core_shell_cylinder.h 
     19                 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/core_shell_cylinder.h 
    620                 AND RE-RUN THE GENERATOR SCRIPT 
    721 
    8     @author: Mathieu Doucet / UTK 
    9     @contact: mathieu.doucet@nist.gov 
    1022""" 
    1123 
     
    1628class CoreShellCylinderModel(CCoreShellCylinderModel, BaseComponent): 
    1729    """ Class that evaluates a CoreShellCylinderModel model.  
    18         This file was auto-generated from core_shell_cylinder.h. 
     30        This file was auto-generated from ../c_extensions/core_shell_cylinder.h. 
    1931        Refer to that file and the structure it contains 
    2032        for details of the model. 
     
    7890         
    7991        return CCoreShellCylinderModel.runXY(self, x) 
     92         
     93    def set_dispersion(self, parameter, dispersion): 
     94        """ 
     95            Set the dispersion object for a model parameter 
     96            @param parameter: name of the parameter [string] 
     97            @dispersion: dispersion object of type DispersionModel 
     98        """ 
     99        return CCoreShellCylinderModel.set_dispersion(self, parameter, dispersion.cdisp) 
     100         
    80101    
    81102# End of file 
  • sansmodels/src/sans/models/CoreShellModel.py

    rae3ce4e r0f5bc9f  
    11#!/usr/bin/env python 
     2""" 
     3        This software was developed by the University of Tennessee as part of the 
     4        Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     5        project funded by the US National Science Foundation. 
     6 
     7        If you use DANSE applications to do scientific research that leads to 
     8        publication, we ask that you acknowledge the use of the software with the 
     9        following sentence: 
     10 
     11        "This work benefited from DANSE software developed under NSF award DMR-0520547." 
     12 
     13        copyright 2008, University of Tennessee 
     14""" 
     15 
    216""" Provide functionality for a C extension model 
    317 
    418        WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    5                  DO NOT MODIFY THIS FILE, MODIFY core_shell.h 
     19                 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/core_shell.h 
    620                 AND RE-RUN THE GENERATOR SCRIPT 
    721 
    8     @author: Mathieu Doucet / UTK 
    9     @contact: mathieu.doucet@nist.gov 
    1022""" 
    1123 
     
    1628class CoreShellModel(CCoreShellModel, BaseComponent): 
    1729    """ Class that evaluates a CoreShellModel model.  
    18         This file was auto-generated from core_shell.h. 
     30        This file was auto-generated from ../c_extensions/core_shell.h. 
    1931        Refer to that file and the structure it contains 
    2032        for details of the model. 
     
    7284         
    7385        return CCoreShellModel.runXY(self, x) 
     86         
     87    def set_dispersion(self, parameter, dispersion): 
     88        """ 
     89            Set the dispersion object for a model parameter 
     90            @param parameter: name of the parameter [string] 
     91            @dispersion: dispersion object of type DispersionModel 
     92        """ 
     93        return CCoreShellModel.set_dispersion(self, parameter, dispersion.cdisp) 
     94         
    7495    
    7596# End of file 
  • sansmodels/src/sans/models/EllipsoidModel.py

    rae3ce4e r0f5bc9f  
    11#!/usr/bin/env python 
     2""" 
     3        This software was developed by the University of Tennessee as part of the 
     4        Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     5        project funded by the US National Science Foundation. 
     6 
     7        If you use DANSE applications to do scientific research that leads to 
     8        publication, we ask that you acknowledge the use of the software with the 
     9        following sentence: 
     10 
     11        "This work benefited from DANSE software developed under NSF award DMR-0520547." 
     12 
     13        copyright 2008, University of Tennessee 
     14""" 
     15 
    216""" Provide functionality for a C extension model 
    317 
    418        WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    5                  DO NOT MODIFY THIS FILE, MODIFY ellipsoid.h 
     19                 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/ellipsoid.h 
    620                 AND RE-RUN THE GENERATOR SCRIPT 
    721 
    8     @author: Mathieu Doucet / UTK 
    9     @contact: mathieu.doucet@nist.gov 
    1022""" 
    1123 
     
    1628class EllipsoidModel(CEllipsoidModel, BaseComponent): 
    1729    """ Class that evaluates a EllipsoidModel model.  
    18         This file was auto-generated from ellipsoid.h. 
     30        This file was auto-generated from ../c_extensions/ellipsoid.h. 
    1931        Refer to that file and the structure it contains 
    2032        for details of the model. 
     
    7284         
    7385        return CEllipsoidModel.runXY(self, x) 
     86         
     87    def set_dispersion(self, parameter, dispersion): 
     88        """ 
     89            Set the dispersion object for a model parameter 
     90            @param parameter: name of the parameter [string] 
     91            @dispersion: dispersion object of type DispersionModel 
     92        """ 
     93        return CEllipsoidModel.set_dispersion(self, parameter, dispersion.cdisp) 
     94         
    7495    
    7596# End of file 
  • sansmodels/src/sans/models/EllipticalCylinderModel.py

    rae3ce4e r0f5bc9f  
    11#!/usr/bin/env python 
     2""" 
     3        This software was developed by the University of Tennessee as part of the 
     4        Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     5        project funded by the US National Science Foundation. 
     6 
     7        If you use DANSE applications to do scientific research that leads to 
     8        publication, we ask that you acknowledge the use of the software with the 
     9        following sentence: 
     10 
     11        "This work benefited from DANSE software developed under NSF award DMR-0520547." 
     12 
     13        copyright 2008, University of Tennessee 
     14""" 
     15 
    216""" Provide functionality for a C extension model 
    317 
    418        WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    5                  DO NOT MODIFY THIS FILE, MODIFY elliptical_cylinder.h 
     19                 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/elliptical_cylinder.h 
    620                 AND RE-RUN THE GENERATOR SCRIPT 
    721 
    8     @author: Mathieu Doucet / UTK 
    9     @contact: mathieu.doucet@nist.gov 
    1022""" 
    1123 
     
    1628class EllipticalCylinderModel(CEllipticalCylinderModel, BaseComponent): 
    1729    """ Class that evaluates a EllipticalCylinderModel model.  
    18         This file was auto-generated from elliptical_cylinder.h. 
     30        This file was auto-generated from ../c_extensions/elliptical_cylinder.h. 
    1931        Refer to that file and the structure it contains 
    2032        for details of the model. 
     
    7688         
    7789        return CEllipticalCylinderModel.runXY(self, x) 
     90         
     91    def set_dispersion(self, parameter, dispersion): 
     92        """ 
     93            Set the dispersion object for a model parameter 
     94            @param parameter: name of the parameter [string] 
     95            @dispersion: dispersion object of type DispersionModel 
     96        """ 
     97        return CEllipticalCylinderModel.set_dispersion(self, parameter, dispersion.cdisp) 
     98         
    7899    
    79100# End of file 
  • sansmodels/src/sans/models/SphereModel.py

    rae3ce4e r0f5bc9f  
    11#!/usr/bin/env python 
     2""" 
     3        This software was developed by the University of Tennessee as part of the 
     4        Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     5        project funded by the US National Science Foundation. 
     6 
     7        If you use DANSE applications to do scientific research that leads to 
     8        publication, we ask that you acknowledge the use of the software with the 
     9        following sentence: 
     10 
     11        "This work benefited from DANSE software developed under NSF award DMR-0520547." 
     12 
     13        copyright 2008, University of Tennessee 
     14""" 
     15 
    216""" Provide functionality for a C extension model 
    317 
    418        WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    5                  DO NOT MODIFY THIS FILE, MODIFY sphere.h 
     19                 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/sphere.h 
    620                 AND RE-RUN THE GENERATOR SCRIPT 
    721 
    8     @author: Mathieu Doucet / UTK 
    9     @contact: mathieu.doucet@nist.gov 
    1022""" 
    1123 
     
    1628class SphereModel(CSphereModel, BaseComponent): 
    1729    """ Class that evaluates a SphereModel model.  
    18         This file was auto-generated from sphere.h. 
     30        This file was auto-generated from ../c_extensions/sphere.h. 
    1931        Refer to that file and the structure it contains 
    2032        for details of the model. 
     
    6678         
    6779        return CSphereModel.runXY(self, x) 
     80         
     81    def set_dispersion(self, parameter, dispersion): 
     82        """ 
     83            Set the dispersion object for a model parameter 
     84            @param parameter: name of the parameter [string] 
     85            @dispersion: dispersion object of type DispersionModel 
     86        """ 
     87        return CSphereModel.set_dispersion(self, parameter, dispersion.cdisp) 
     88         
    6889    
    6990# End of file 
  • sansmodels/src/sans/models/c_extensions/c_models.cpp

    raf03ddd r0f5bc9f  
    99 
    1010void addCCylinderModel(PyObject *module); 
     11void addCSphereModel(PyObject *module); 
     12void addCCoreShellModel(PyObject *module); 
     13void addCCoreShellCylinderModel(PyObject *module); 
     14void addCEllipsoidModel(PyObject *module); 
     15void addCEllipticalCylinderModel(PyObject *module); 
     16 
    1117extern "C" { 
    12         void addCCoreShellCylinderModel(PyObject *module); 
    13         void addCCoreShellModel(PyObject *module); 
    14         void addCEllipsoidModel(PyObject *module); 
    15         void addCSphereModel(PyObject *module); 
    16         void addCEllipticalCylinderModel(PyObject *module); 
     18        //void addCCoreShellCylinderModel(PyObject *module); 
     19        //void addCCoreShellModel(PyObject *module); 
     20        //void addCEllipsoidModel(PyObject *module); 
     21        //void addCSphereModel(PyObject *module); 
     22        //void addCEllipticalCylinderModel(PyObject *module); 
    1723        void addDisperser(PyObject *module); 
    1824        void addCGaussian(PyObject *module); 
  • sansmodels/src/sans/models/c_extensions/core_shell.h

    rae3ce4e r0f5bc9f  
    22#define core_shell_h 
    33 
    4 /**  
    5  * Structure definition for core-shell parameters  
     4/** 
     5 * Structure definition for core-shell parameters 
    66 */ 
    77 //[PYTHONCLASS] = CoreShellModel 
     8 //[DISP_PARAMS] = radius, thickness 
    89typedef struct { 
    9     /// Scale factor  
     10    /// Scale factor 
    1011    //  [DEFAULT]=scale=1.0 
    1112    double scale; 
     
    2728        /// Incoherent Background (cm-1) 0.000 
    2829        //  [DEFAULT]=background=0 cm-1 
    29         double background;     
     30        double background; 
    3031} CoreShellParameters; 
    3132 
  • sansmodels/src/sans/models/c_extensions/core_shell_cylinder.h

    rae3ce4e r0f5bc9f  
    22#define core_shell_cylinder_h 
    33 
    4 /**  
    5  * Structure definition for core-shell cylinder parameters  
     4/** 
     5 * Structure definition for core-shell cylinder parameters 
    66 */ 
    77 //[PYTHONCLASS] = CoreShellCylinderModel 
     8 //[DISP_PARAMS] = radius, thickness, length, axis_theta, axis_phi 
    89typedef struct { 
    9     /// Scale factor  
     10    /// Scale factor 
    1011    //  [DEFAULT]=scale=1.0 
    1112    double scale; 
    12      
     13 
    1314    /// Core radius [A] 
    1415    //  [DEFAULT]=radius=20.0 A 
    1516    double radius; 
    16      
     17 
    1718    /// Shell thickness [A] 
    1819    //  [DEFAULT]=thickness=10.0 A 
    1920    double thickness; 
    20      
     21 
    2122    /// Core length [A] 
    2223    //  [DEFAULT]=length=400.0 A 
    2324    double length; 
    24      
     25 
    2526    /// Core SLD [A-2] 
    2627    //  [DEFAULT]=core_sld=1.0e-6 A-2 
    2728    double core_sld; 
    28      
     29 
    2930    /// Shell SLD [A-2] 
    3031    //  [DEFAULT]=shell_sld=4.0e-6 A-2 
    3132    double shell_sld; 
    32      
     33 
    3334    /// Solvent SLD [A-2] 
    3435    //  [DEFAULT]=solvent_sld=1.0e-6 A-2 
    3536    double solvent_sld; 
    36      
     37 
    3738        /// Incoherent Background [cm-1] 
    3839        //  [DEFAULT]=background=0 cm-1 
    39         double background;     
    40          
     40        double background; 
     41 
    4142    /// Orientation of the long axis of the core-shell cylinder w/respect incoming beam [rad] 
    4243    //  [DEFAULT]=axis_theta=1.57 rad 
    4344    double axis_theta; 
    44      
     45 
    4546    /// Orientation of the long axis of the core-shell cylinder in the plane of the detector [rad] 
    4647    //  [DEFAULT]=axis_phi=0.0 rad 
    47     double axis_phi;     
    48          
     48    double axis_phi; 
     49 
    4950} CoreShellCylinderParameters; 
    5051 
  • sansmodels/src/sans/models/c_extensions/ellipsoid.h

    rae3ce4e r0f5bc9f  
    22#define ellipsoid_h 
    33 
    4 /**  
    5  * Structure definition for ellipsoid parameters  
     4/** 
     5 * Structure definition for ellipsoid parameters 
    66 * The ellipsoid has axes radius_b, radius_b, radius_a. 
    77 * Ref: Jan Skov Pedersen, Advances in Colloid and Interface Science, 70 (1997) 171-210 
    88 */ 
    99 //[PYTHONCLASS] = EllipsoidModel 
     10 //[DISP_PARAMS] = radius_a, radius_b, axis_theta, axis_phi 
    1011typedef struct { 
    11     /// Scale factor  
     12    /// Scale factor 
    1213    //  [DEFAULT]=scale=1.0 
    1314    double scale; 
    14      
    15     /// Rotation axis radius_a [A]  
     15 
     16    /// Rotation axis radius_a [A] 
    1617    //  [DEFAULT]=radius_a=20.0 A 
    1718    double radius_a; 
    18      
    19     /// Radius_b [A]  
     19 
     20    /// Radius_b [A] 
    2021    //  [DEFAULT]=radius_b=400 A 
    2122    double radius_b; 
    22      
    23     /// Contrast [Å-2]  
     23 
     24    /// Contrast [Å-2] 
    2425    //  [DEFAULT]=contrast=3.0e-6 A-2 
    2526    double contrast; 
    26      
     27 
    2728        /// Incoherent Background [cm-1] 
    2829        //  [DEFAULT]=background=0 cm-1 
    29         double background;     
    30          
     30        double background; 
     31 
    3132    /// Orientation of the long axis of the ellipsoid w/respect incoming beam [rad] 
    3233    //  [DEFAULT]=axis_theta=1.57 rad 
     
    3435    /// Orientation of the long axis of the ellipsoid in the plane of the detector [rad] 
    3536    //  [DEFAULT]=axis_phi=0.0 rad 
    36     double axis_phi;     
     37    double axis_phi; 
    3738} EllipsoidParameters; 
    3839 
  • sansmodels/src/sans/models/c_extensions/elliptical_cylinder.h

    rae3ce4e r0f5bc9f  
    22#define ell_cylinder_h 
    33 
    4 /** Structure definition for cylinder parameters  
     4/** Structure definition for cylinder parameters 
    55 * [PYTHONCLASS] = EllipticalCylinderModel 
     6 * [DISP_PARAMS] = r_minor, r_ratio, length, cyl_theta, cyl_phi, cyl_psi 
     7 * 
    68 * */ 
    79typedef struct { 
    8     /// Scale factor  
     10    /// Scale factor 
    911    //  [DEFAULT]=scale=1.0 
    1012    double scale; 
     
    2325        /// Incoherent Background (cm-1) 0.000 
    2426        //  [DEFAULT]=background=0 cm-1 
    25         double background;     
     27        double background; 
    2628    /// Orientation of the cylinder axis w/respect incoming beam [rad] 
    2729    //  [DEFAULT]=cyl_theta=1.57 rad 
     
    2931    /// Orientation of the cylinder in the plane of the detector [rad] 
    3032    //  [DEFAULT]=cyl_phi=0.0 rad 
    31     double cyl_phi;     
     33    double cyl_phi; 
    3234    /// Orientation of major radius of the cross-section w/respect vector q [rad] 
    3335    //  [DEFAULT]=cyl_psi=0.0 rad 
    34     double cyl_psi;     
     36    double cyl_psi; 
    3537} EllipticalCylinderParameters; 
    3638 
  • sansmodels/src/sans/models/c_extensions/sphere.h

    rae3ce4e r0f5bc9f  
    22#define sphere_h 
    33 
    4 /**  
    5  * Structure definition for sphere parameters  
     4/** 
     5 * Structure definition for sphere parameters 
    66 */ 
    77 //[PYTHONCLASS] = SphereModel 
     8 //[DISP_PARAMS] = radius 
    89typedef struct { 
    9     /// Scale factor  
     10    /// Scale factor 
    1011    //  [DEFAULT]=scale=1.0e-6 
    1112    double scale; 
    12      
    13     /// Radius of sphere [A]  
     13 
     14    /// Radius of sphere [A] 
    1415    //  [DEFAULT]=radius=60.0 A 
    1516    double radius; 
    16      
    17     /// Contrast [Å-2]  
     17 
     18    /// Contrast [Å-2] 
    1819    //  [DEFAULT]=contrast=1.0 A-2 
    1920    double contrast; 
    20      
     21 
    2122        /// Incoherent Background [cm-1] 
    2223        //  [DEFAULT]=background=0 cm-1 
    23         double background;     
     24        double background; 
    2425} SphereParameters; 
    2526 
  • sansmodels/src/sans/models/c_models/CCylinderModel.cpp

    raf03ddd r0f5bc9f  
    8383         
    8484        // Initialize parameter dictionary 
    85         PyDict_SetItemString(self->params,"scale",Py_BuildValue("d", self->model->scale())); 
    86         PyDict_SetItemString(self->params,"length",Py_BuildValue("d", self->model->length())); 
    87         PyDict_SetItemString(self->params,"cyl_theta",Py_BuildValue("d", self->model->cyl_theta())); 
    88         PyDict_SetItemString(self->params,"background",Py_BuildValue("d", self->model->background())); 
    89         PyDict_SetItemString(self->params,"radius",Py_BuildValue("d", self->model->radius())); 
    90         PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d", self->model->contrast())); 
    91         PyDict_SetItemString(self->params,"cyl_phi",Py_BuildValue("d", self->model->cyl_phi())); 
     85        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000)); 
     86        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000)); 
     87        PyDict_SetItemString(self->params,"cyl_theta",Py_BuildValue("d",1.000000)); 
     88        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000)); 
     89        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",20.000000)); 
     90        PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000003)); 
     91        PyDict_SetItemString(self->params,"cyl_phi",Py_BuildValue("d",1.000000)); 
    9292        // Initialize dispersion / averaging parameter dict 
    9393        DispersionVisitor* visitor = new DispersionVisitor(); 
  • sansmodels/src/sans/models/c_models/WrapperGenerator.py

    raf03ddd r0f5bc9f  
    213213            param_str = "// Initialize parameter dictionary\n"             
    214214            for par in self.params: 
    215                 param_str += "        PyDict_SetItemString(self->params,\"%s\",Py_BuildValue(\"d\", self->model->%s()));\n" % \ 
    216                     (par, par) 
     215                param_str += "        PyDict_SetItemString(self->params,\"%s\",Py_BuildValue(\"d\",%f));\n" % \ 
     216                    (par, self.params[par]) 
    217217 
    218218            param_str += "        // Initialize dispersion / averaging parameter dict\n" 
  • sansmodels/src/sans/models/c_models/cylinder.cpp

    raf03ddd r0f5bc9f  
    189189 
    190190        printf("Length = %g\n", c.length()); 
     191        printf("I(Qx=%g,Qy=%g) = %g\n", 0.001, 0.001, c(0.001, 0.001)); 
    191192        printf("I(Q=%g) = %g\n", 0.001, c(0.001)); 
    192193        c.radius.dispersion = new GaussianDispersion(); 
  • sansmodels/src/sans/models/c_models/models.hh

    raf03ddd r0f5bc9f  
    2424 
    2525class CylinderModel{ 
    26  
    2726public: 
    2827        // Model parameters 
     
    3433        Parameter cyl_theta; 
    3534        Parameter cyl_phi; 
    36         // TODO: replace this by an array of parameters 
    3735 
    3836        // Constructor 
     
    4543}; 
    4644 
     45class SphereModel{ 
     46public: 
     47        // Model parameters 
     48        Parameter radius; 
     49        Parameter scale; 
     50        Parameter contrast; 
     51        Parameter background; 
     52 
     53        // Constructor 
     54        SphereModel(); 
     55 
     56        // Operators to get I(Q) 
     57        double operator()(double q); 
     58        double operator()(double qx, double qy); 
     59        double evaluate_rphi(double q, double phi); 
     60}; 
     61 
     62class CoreShellModel{ 
     63public: 
     64        // Model parameters 
     65        Parameter radius; 
     66        Parameter scale; 
     67        Parameter thickness; 
     68        Parameter core_sld; 
     69        Parameter shell_sld; 
     70        Parameter solvent_sld; 
     71        Parameter background; 
     72 
     73        // Constructor 
     74        CoreShellModel(); 
     75 
     76        // Operators to get I(Q) 
     77        double operator()(double q); 
     78        double operator()(double qx, double qy); 
     79        double evaluate_rphi(double q, double phi); 
     80}; 
     81 
     82class CoreShellCylinderModel{ 
     83public: 
     84        // Model parameters 
     85        Parameter radius; 
     86        Parameter scale; 
     87        Parameter thickness; 
     88        Parameter length; 
     89        Parameter core_sld; 
     90        Parameter shell_sld; 
     91        Parameter solvent_sld; 
     92        Parameter background; 
     93        Parameter axis_theta; 
     94        Parameter axis_phi; 
     95 
     96        // Constructor 
     97        CoreShellCylinderModel(); 
     98 
     99        // Operators to get I(Q) 
     100        double operator()(double q); 
     101        double operator()(double qx, double qy); 
     102        double evaluate_rphi(double q, double phi); 
     103}; 
     104 
     105class EllipsoidModel{ 
     106public: 
     107        // Model parameters 
     108        Parameter radius_a; 
     109        Parameter scale; 
     110        Parameter radius_b; 
     111        Parameter contrast; 
     112        Parameter background; 
     113        Parameter axis_theta; 
     114        Parameter axis_phi; 
     115 
     116        // Constructor 
     117        EllipsoidModel(); 
     118 
     119        // Operators to get I(Q) 
     120        double operator()(double q); 
     121        double operator()(double qx, double qy); 
     122        double evaluate_rphi(double q, double phi); 
     123}; 
     124 
     125class EllipticalCylinderModel{ 
     126public: 
     127        // Model parameters 
     128        Parameter r_minor; 
     129        Parameter scale; 
     130        Parameter r_ratio; 
     131        Parameter length; 
     132        Parameter contrast; 
     133        Parameter background; 
     134        Parameter cyl_theta; 
     135        Parameter cyl_phi; 
     136        Parameter cyl_psi; 
     137 
     138        // Constructor 
     139        EllipticalCylinderModel(); 
     140 
     141        // Operators to get I(Q) 
     142        double operator()(double q); 
     143        double operator()(double qx, double qy); 
     144        double evaluate_rphi(double q, double phi); 
     145}; 
     146 
    47147#endif 
  • sansmodels/src/sans/models/c_models/notes.txt

    rfca6936 r0f5bc9f  
    1111        parameters and the C++ Parameter class. 
    1212          
    13   
     13 Length = 400 
     14I(Q=0.001) = 450.355 
     15I(Q=0.001) = 472.332 
     16I(Q=0.001) = 4723.32 
     17I(Qx=0.001, Qy=0.001) = 4743.56 
     18I(Q=0.00447,  Phi=0.7854) = 4733 
     19pi=3.14159 
     20 
     21I(Qx=0.01, Qy=0.01) = 2299 
     22I(Q=0.0141421)         = 2326.75 
     23ratio 0.988074 1.01207 
     24 
     25Cyl (python):  450.35506578 
     26Disp(pyhton):  472.332213339 
     27 
     28-------------- 
     29Hello cylinder 
     30450.35506578 
     31449.358988524 
     32446.344929175 
     33 
     34{'npts': 1, 'type': 'gaussian', 'nsigmas': 2, 'width': 0.0} 
     35{'npts': 1, 'type': 'flat', 'width': 0.0} 
     36 
     37 q= 0.001 
     38New Cyl :  450.35506578 
     39New Disp:  472.332213339 
     40 
     41cyl(0.01, 0.01) =96.8691 
     42cyl(0.0141421) =232.675 
     43{'type': 'array'} 
     44cyl(0.01, 0.01) =229.9 
     45Hello cylinder 
     46 
     47Old Cyl :  450.35506578 
     48Old Disp:  472.332213339 
Note: See TracChangeset for help on using the changeset viewer.