Changeset f9bf661 in sasview


Ignore:
Timestamp:
Sep 11, 2009 10:38:53 AM (15 years ago)
Author:
Jae Cho <jhjcho@…>
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:
c1e865a
Parents:
72f719b
Message:

updated documents

Location:
sansmodels/src/sans/models
Files:
58 edited

Legend:

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

    r9ce41c6 rf9bf661  
    5656    def run(self, x): return NotImplemented 
    5757    def runXY(self, x): return NotImplemented   
    58     def calculate_ER(self, x): return NotImplemented   
     58    def calculate_ER(self): return NotImplemented   
    5959    def evalDistribution(self, qdist): 
    6060        """ 
  • sansmodels/src/sans/models/BaseModel.py

    r5eb9154 rf9bf661  
    7474    def run(self, x=0):  return NotImplemented 
    7575    def runXY(self, x=0):  return NotImplemented 
    76     def calculate_ER(self, x=0):  return NotImplemented 
     76    def calculate_ER(self):  return NotImplemented 
    7777    def __call__(self, x=0): 
    7878        """      
  • sansmodels/src/sans/models/BinaryHSModel.py

    r9ce41c6 rf9bf661  
    1717 
    1818        WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    19                  DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHs.h 
     19                 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHS.h 
    2020                 AND RE-RUN THE GENERATOR SCRIPT 
    2121 
     
    2828class BinaryHSModel(CBinaryHSModel, BaseComponent): 
    2929    """ Class that evaluates a BinaryHSModel model.  
    30         This file was auto-generated from ..\c_extensions\binaryHs.h. 
     30        This file was auto-generated from ..\c_extensions\binaryHS.h. 
    3131        Refer to that file and the structure it contains 
    3232        for details of the model. 
     
    108108    def calculate_ER(self): 
    109109        """ Calculate the effective radius for P(q)*S(q) 
    110             @param x: input q, or [q,phi] 
    111110            @return: the value of the effective radius 
    112111        """        
  • sansmodels/src/sans/models/BinaryHSPSF11Model.py

    r5eb9154 rf9bf661  
    111111    def calculate_ER(self): 
    112112        """ Calculate the effective radius for P(q)*S(q) 
    113             @param x: input q, or [q,phi] 
    114113            @return: the value of the effective radius 
    115114        """        
  • sansmodels/src/sans/models/CoreShellCylinderModel.py

    r5eb9154 rf9bf661  
    128128    def calculate_ER(self): 
    129129        """ Calculate the effective radius for P(q)*S(q) 
    130             @param x: input q, or [q,phi] 
    131130            @return: the value of the effective radius 
    132131        """        
  • sansmodels/src/sans/models/CoreShellEllipsoidModel.py

    r5eb9154 rf9bf661  
    123123    def calculate_ER(self): 
    124124        """ Calculate the effective radius for P(q)*S(q) 
    125             @param x: input q, or [q,phi] 
    126125            @return: the value of the effective radius 
    127126        """        
  • sansmodels/src/sans/models/CylinderModel.py

    r5eb9154 rf9bf661  
    111111    def calculate_ER(self): 
    112112        """ Calculate the effective radius for P(q)*S(q) 
    113             @param x: input q, or [q,phi] 
    114113            @return: the value of the effective radius 
    115114        """        
  • sansmodels/src/sans/models/DiamCylFunc.py

    r5eb9154 rf9bf661  
    9292    def calculate_ER(self): 
    9393        """ Calculate the effective radius for P(q)*S(q) 
    94             @param x: input q, or [q,phi] 
    9594            @return: the value of the effective radius 
    9695        """        
  • sansmodels/src/sans/models/DiamEllipFunc.py

    r5eb9154 rf9bf661  
    9696    def calculate_ER(self): 
    9797        """ Calculate the effective radius for P(q)*S(q) 
    98             @param x: input q, or [q,phi] 
    9998            @return: the value of the effective radius 
    10099        """        
  • sansmodels/src/sans/models/EllipsoidModel.py

    r5eb9154 rf9bf661  
    115115    def calculate_ER(self): 
    116116        """ Calculate the effective radius for P(q)*S(q) 
    117             @param x: input q, or [q,phi] 
    118117            @return: the value of the effective radius 
    119118        """        
  • sansmodels/src/sans/models/EllipticalCylinderModel.py

    r5eb9154 rf9bf661  
    103103    def calculate_ER(self): 
    104104        """ Calculate the effective radius for P(q)*S(q) 
    105             @param x: input q, or [q,phi] 
    106105            @return: the value of the effective radius 
    107106        """        
  • sansmodels/src/sans/models/FlexibleCylinderModel.py

    r5eb9154 rf9bf661  
    100100    def calculate_ER(self): 
    101101        """ Calculate the effective radius for P(q)*S(q) 
    102             @param x: input q, or [q,phi] 
    103102            @return: the value of the effective radius 
    104103        """        
  • sansmodels/src/sans/models/Gaussian.py

    r5eb9154 rf9bf661  
    9191    def calculate_ER(self): 
    9292        """ Calculate the effective radius for P(q)*S(q) 
    93             @param x: input q, or [q,phi] 
    9493            @return: the value of the effective radius 
    9594        """        
  • sansmodels/src/sans/models/HardsphereStructure.py

    r9ce41c6 rf9bf661  
    100100    def calculate_ER(self): 
    101101        """ Calculate the effective radius for P(q)*S(q) 
    102             @param x: input q, or [q,phi] 
    103102            @return: the value of the effective radius 
    104103        """        
  • sansmodels/src/sans/models/HayterMSAStructure.py

    r42ae1d9 rf9bf661  
    110110    def calculate_ER(self): 
    111111        """ Calculate the effective radius for P(q)*S(q) 
    112             @param x: input q, or [q,phi] 
    113112            @return: the value of the effective radius 
    114113        """        
  • sansmodels/src/sans/models/HollowCylinderModel.py

    r5eb9154 rf9bf661  
    101101    def calculate_ER(self): 
    102102        """ Calculate the effective radius for P(q)*S(q) 
    103             @param x: input q, or [q,phi] 
    104103            @return: the value of the effective radius 
    105104        """        
  • sansmodels/src/sans/models/LamellarFFHGModel.py

    r5eb9154 rf9bf661  
    106106    def calculate_ER(self): 
    107107        """ Calculate the effective radius for P(q)*S(q) 
    108             @param x: input q, or [q,phi] 
    109108            @return: the value of the effective radius 
    110109        """        
  • sansmodels/src/sans/models/LamellarModel.py

    r5eb9154 rf9bf661  
    103103    def calculate_ER(self): 
    104104        """ Calculate the effective radius for P(q)*S(q) 
    105             @param x: input q, or [q,phi] 
    106105            @return: the value of the effective radius 
    107106        """        
  • sansmodels/src/sans/models/LamellarPSHGModel.py

    r5eb9154 rf9bf661  
    123123    def calculate_ER(self): 
    124124        """ Calculate the effective radius for P(q)*S(q) 
    125             @param x: input q, or [q,phi] 
    126125            @return: the value of the effective radius 
    127126        """        
  • sansmodels/src/sans/models/LamellarPSModel.py

    r5eb9154 rf9bf661  
    116116    def calculate_ER(self): 
    117117        """ Calculate the effective radius for P(q)*S(q) 
    118             @param x: input q, or [q,phi] 
    119118            @return: the value of the effective radius 
    120119        """        
  • sansmodels/src/sans/models/MultiShellModel.py

    r5eb9154 rf9bf661  
    109109    def calculate_ER(self): 
    110110        """ Calculate the effective radius for P(q)*S(q) 
    111             @param x: input q, or [q,phi] 
    112111            @return: the value of the effective radius 
    113112        """        
  • sansmodels/src/sans/models/OblateModel.py

    r9ce41c6 rf9bf661  
    121121    def calculate_ER(self): 
    122122        """ Calculate the effective radius for P(q)*S(q) 
    123             @param x: input q, or [q,phi] 
    124123            @return: the value of the effective radius 
    125124        """        
  • sansmodels/src/sans/models/ParallelepipedModel.py

    r5eb9154 rf9bf661  
    110110    def calculate_ER(self): 
    111111        """ Calculate the effective radius for P(q)*S(q) 
    112             @param x: input q, or [q,phi] 
    113112            @return: the value of the effective radius 
    114113        """        
  • sansmodels/src/sans/models/ProlateModel.py

    r9ce41c6 rf9bf661  
    117117    def calculate_ER(self): 
    118118        """ Calculate the effective radius for P(q)*S(q) 
    119             @param x: input q, or [q,phi] 
    120119            @return: the value of the effective radius 
    121120        """        
  • sansmodels/src/sans/models/SphereModel.py

    r5eb9154 rf9bf661  
    102102    def calculate_ER(self): 
    103103        """ Calculate the effective radius for P(q)*S(q) 
    104             @param x: input q, or [q,phi] 
    105104            @return: the value of the effective radius 
    106105        """        
  • sansmodels/src/sans/models/SquareWellStructure.py

    r9ce41c6 rf9bf661  
    108108    def calculate_ER(self): 
    109109        """ Calculate the effective radius for P(q)*S(q) 
    110             @param x: input q, or [q,phi] 
    111110            @return: the value of the effective radius 
    112111        """        
  • sansmodels/src/sans/models/StackedDisksModel.py

    r5eb9154 rf9bf661  
    109109    def calculate_ER(self): 
    110110        """ Calculate the effective radius for P(q)*S(q) 
    111             @param x: input q, or [q,phi] 
    112111            @return: the value of the effective radius 
    113112        """        
  • sansmodels/src/sans/models/StickyHSStructure.py

    r9ce41c6 rf9bf661  
    108108    def calculate_ER(self): 
    109109        """ Calculate the effective radius for P(q)*S(q) 
    110             @param x: input q, or [q,phi] 
    111110            @return: the value of the effective radius 
    112111        """        
  • sansmodels/src/sans/models/TriaxialEllipsoidModel.py

    r5eb9154 rf9bf661  
    105105    def calculate_ER(self): 
    106106        """ Calculate the effective radius for P(q)*S(q) 
    107             @param x: input q, or [q,phi] 
    108107            @return: the value of the effective radius 
    109108        """        
  • sansmodels/src/sans/models/VesicleModel.py

    r5eb9154 rf9bf661  
    102102    def calculate_ER(self): 
    103103        """ Calculate the effective radius for P(q)*S(q) 
    104             @param x: input q, or [q,phi] 
    105104            @return: the value of the effective radius 
    106105        """        
  • sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp

    r9ce41c6 rf9bf661  
    1818 * 
    1919 * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    20  *          DO NOT MODIFY THIS FILE, MODIFY binaryHs.h 
     20 *          DO NOT MODIFY THIS FILE, MODIFY binaryHS.h 
    2121 *          AND RE-RUN THE GENERATOR SCRIPT 
    2222 * 
     
    3333#include <math.h> 
    3434#include <time.h> 
    35 #include "binaryHs.h" 
     35#include "binaryHS.h" 
    3636} 
    3737 
  • sansmodels/src/sans/models/c_models/DiamCyl.cpp

    r5eb9154 rf9bf661  
    141141/** 
    142142 * Function to calculate effective radius 
    143  * @param pars: parameters of the sphere 
    144143 * @return: effective radius value 
    145144 */ 
  • sansmodels/src/sans/models/c_models/DiamEllip.cpp

    r5eb9154 rf9bf661  
    139139/** 
    140140 * Function to calculate effective radius 
    141  * @param pars: parameters of the sphere 
    142141 * @return: effective radius value 
    143142 */ 
  • sansmodels/src/sans/models/c_models/Hardsphere.cpp

    r5eb9154 rf9bf661  
    122122/** 
    123123 * Function to calculate effective radius 
    124  * @param pars: parameters of the sphere 
    125124 * @return: effective radius value 
    126125 */ 
  • sansmodels/src/sans/models/c_models/HayterMSA.cpp

    r8b677ec rf9bf661  
    136136/** 
    137137 * Function to calculate effective radius 
    138  * @param pars: parameters of the sphere 
    139138 * @return: effective radius value 
    140139 */ 
  • sansmodels/src/sans/models/c_models/SquareWell.cpp

    r5eb9154 rf9bf661  
    128128/** 
    129129 * Function to calculate effective radius 
    130  * @param pars: parameters of the sphere 
    131130 * @return: effective radius value 
    132131 */ 
  • sansmodels/src/sans/models/c_models/StickyHS.cpp

    r5eb9154 rf9bf661  
    130130/** 
    131131 * Function to calculate effective radius 
    132  * @param pars: parameters of the sphere 
    133132 * @return: effective radius value 
    134133 */ 
  • sansmodels/src/sans/models/c_models/binaryHS.cpp

    r5eb9154 rf9bf661  
    118118/** 
    119119 * Function to calculate effective radius 
    120  * @param pars: parameters of the sphere 
    121120 * @return: effective radius value 
    122121 */ 
  • sansmodels/src/sans/models/c_models/binaryHS_PSF11.cpp

    r5eb9154 rf9bf661  
    116116/** 
    117117 * Function to calculate effective radius 
    118  * @param pars: parameters of the sphere 
    119118 * @return: effective radius value 
    120119 */ 
  • sansmodels/src/sans/models/c_models/coreshellcylinder.cpp

    r5eb9154 rf9bf661  
    216216/** 
    217217 * Function to calculate effective radius 
    218  * @param pars: parameters of the sphere 
    219218 * @return: effective radius value 
    220219 */ 
  • sansmodels/src/sans/models/c_models/coreshellsphere.cpp

    r5eb9154 rf9bf661  
    116116/** 
    117117 * Function to calculate effective radius 
    118  * @param pars: parameters of the sphere 
    119118 * @return: effective radius value 
    120119 */ 
  • sansmodels/src/sans/models/c_models/cylinder.cpp

    r5eb9154 rf9bf661  
    183183        return (*this).operator()(qx, qy); 
    184184} 
    185  
     185/** 
     186 * Function to calculate effective radius 
     187 * @return: effective radius value 
     188 */ 
     189double CylinderModel :: calculate_ER() { 
     190        CylinderParameters dp; 
     191 
     192        dp.radius     = radius(); 
     193        dp.length     = length(); 
     194        double rad_out = 0.0; 
     195 
     196        // Perform the computation, with all weight points 
     197        double sum = 0.0; 
     198        double norm = 0.0; 
     199 
     200        // Get the dispersion points for the major shell 
     201        vector<WeightPoint> weights_length; 
     202        length.get_weights(weights_length); 
     203 
     204        // Get the dispersion points for the minor shell 
     205        vector<WeightPoint> weights_radius ; 
     206        radius.get_weights(weights_radius); 
     207 
     208        // Loop over major shell weight points 
     209        for(int i=0; i< (int)weights_length.size(); i++) { 
     210                dp.length = weights_length[i].value; 
     211                for(int k=0; k< (int)weights_radius.size(); k++) { 
     212                        dp.radius = weights_radius[k].value; 
     213                        //Note: output of "DiamCyl(dp.length,dp.radius)" is DIAMETER. 
     214                        sum +=weights_length[i].weight 
     215                                * weights_radius[k].weight*DiamCyl(dp.length,dp.radius)/2.0; 
     216                        norm += weights_length[i].weight* weights_radius[k].weight; 
     217                } 
     218        } 
     219        if (norm != 0){ 
     220                //return the averaged value 
     221                rad_out =  sum/norm;} 
     222        else{ 
     223                //return normal value 
     224                //Note: output of "DiamCyl(dp.length,dp.radius)" is DIAMETER. 
     225                rad_out = DiamCyl(dp.length,dp.radius)/2.0;} 
     226 
     227        return rad_out; 
     228} 
    186229// Testing code 
    187230int main(void) 
     
    234277        return 0; 
    235278} 
    236 /** 
    237  * Function to calculate effective radius 
    238  * @param pars: parameters of the sphere 
    239  * @return: effective radius value 
    240  */ 
    241 double CylinderModel :: calculate_ER() { 
    242         CylinderParameters dp; 
    243  
    244         dp.radius     = radius(); 
    245         dp.length     = length(); 
    246         double rad_out = 0.0; 
    247  
    248         // Perform the computation, with all weight points 
    249         double sum = 0.0; 
    250         double norm = 0.0; 
    251  
    252         // Get the dispersion points for the major shell 
    253         vector<WeightPoint> weights_length; 
    254         length.get_weights(weights_length); 
    255  
    256         // Get the dispersion points for the minor shell 
    257         vector<WeightPoint> weights_radius ; 
    258         radius.get_weights(weights_radius); 
    259  
    260         // Loop over major shell weight points 
    261         for(int i=0; i< (int)weights_length.size(); i++) { 
    262                 dp.length = weights_length[i].value; 
    263                 for(int k=0; k< (int)weights_radius.size(); k++) { 
    264                         dp.radius = weights_radius[k].value; 
    265                         //Note: output of "DiamCyl(dp.length,dp.radius)" is DIAMETER. 
    266                         sum +=weights_length[i].weight 
    267                                 * weights_radius[k].weight*DiamCyl(dp.length,dp.radius)/2.0; 
    268                         norm += weights_length[i].weight* weights_radius[k].weight; 
    269                 } 
    270         } 
    271         if (norm != 0){ 
    272                 //return the averaged value 
    273                 rad_out =  sum/norm;} 
    274         else{ 
    275                 //return normal value 
    276                 //Note: output of "DiamCyl(dp.length,dp.radius)" is DIAMETER. 
    277                 rad_out = DiamCyl(dp.length,dp.radius)/2.0;} 
    278  
    279         return rad_out; 
    280 } 
     279 
  • sansmodels/src/sans/models/c_models/ellipsoid.cpp

    r5eb9154 rf9bf661  
    186186/** 
    187187 * Function to calculate effective radius 
    188  * @param pars: parameters of the sphere 
    189188 * @return: effective radius value 
    190189 */ 
  • sansmodels/src/sans/models/c_models/ellipticalcylinder.cpp

    r5eb9154 rf9bf661  
    2929extern "C" { 
    3030        #include "libCylinder.h" 
     31        #include "libStructureFactor.h" 
    3132        #include "elliptical_cylinder.h" 
    3233} 
     
    222223/** 
    223224 * Function to calculate effective radius 
    224  * @param pars: parameters of the sphere 
    225225 * @return: effective radius value 
    226226 */ 
    227227double EllipticalCylinderModel :: calculate_ER() { 
    228 //NOT implemented yet!!! 
    229 } 
     228        EllipticalCylinderParameters dp; 
     229        dp.r_minor    = r_minor(); 
     230        dp.r_ratio    = r_ratio(); 
     231        dp.length     = length(); 
     232        double rad_out = 0.0; 
     233        double pi = 4.0*atan(1.0); 
     234        double suf_rad = sqrt(dp.r_minor*dp.r_minor*dp.r_ratio); 
     235 
     236        // Perform the computation, with all weight points 
     237        double sum = 0.0; 
     238        double norm = 0.0; 
     239 
     240        // Get the dispersion points for the r_minor 
     241        vector<WeightPoint> weights_rad; 
     242        r_minor.get_weights(weights_rad); 
     243 
     244        // Get the dispersion points for the r_ratio 
     245        vector<WeightPoint> weights_rat; 
     246        r_ratio.get_weights(weights_rat); 
     247 
     248        // Get the dispersion points for the length 
     249        vector<WeightPoint> weights_len; 
     250        length.get_weights(weights_len); 
     251 
     252        // Loop over minor radius weight points 
     253        for(int i=0; i<weights_rad.size(); i++) { 
     254                dp.r_minor = weights_rad[i].value; 
     255 
     256                // Loop over length weight points 
     257                for(int j=0; j<weights_len.size(); j++) { 
     258                        dp.length = weights_len[j].value; 
     259 
     260                        // Loop over r_ration weight points 
     261                        for(int m=0; m<weights_rat.size(); m++) { 
     262                                dp.r_ratio = weights_rat[m].value; 
     263                                //Calculate surface averaged radius 
     264                                suf_rad = sqrt(dp.r_minor * dp.r_minor * dp.r_ratio); 
     265 
     266                                //Note: output of "DiamCyl(dp.length,dp.radius)" is DIAMETER. 
     267                                sum +=weights_rad[i].weight *weights_len[j].weight 
     268                                        * weights_rat[m].weight*DiamCyl(dp.length, suf_rad)/2.0; 
     269                                norm += weights_rad[i].weight *weights_len[j].weight* weights_rat[m].weight; 
     270                        } 
     271                } 
     272        } 
     273        if (norm != 0){ 
     274                //return the averaged value 
     275                rad_out =  sum/norm;} 
     276        else{ 
     277                //return normal value 
     278                //Note: output of "DiamCyl(dp.length,dp.radius)" is DIAMETER. 
     279                rad_out = DiamCyl(dp.length, suf_rad)/2.0;} 
     280 
     281        return rad_out; 
     282} 
  • sansmodels/src/sans/models/c_models/flexiblecylinder.cpp

    r5eb9154 rf9bf661  
    127127/** 
    128128 * Function to calculate effective radius 
    129  * @param pars: parameters of the sphere 
    130129 * @return: effective radius value 
    131130 */ 
  • sansmodels/src/sans/models/c_models/hollowcylinder.cpp

    r5eb9154 rf9bf661  
    210210/** 
    211211 * Function to calculate effective radius 
    212  * @param pars: parameters of the sphere 
    213212 * @return: effective radius value 
    214213 */ 
  • sansmodels/src/sans/models/c_models/lamellar.cpp

    r5eb9154 rf9bf661  
    102102/** 
    103103 * Function to calculate effective radius 
    104  * @param pars: parameters of the sphere 
    105104 * @return: effective radius value 
    106105 */ 
  • sansmodels/src/sans/models/c_models/lamellarFF_HG.cpp

    r5eb9154 rf9bf661  
    115115/** 
    116116 * Function to calculate effective radius 
    117  * @param pars: parameters of the sphere 
    118117 * @return: effective radius value 
    119118 */ 
  • sansmodels/src/sans/models/c_models/lamellarPS.cpp

    r5eb9154 rf9bf661  
    111111/** 
    112112 * Function to calculate effective radius 
    113  * @param pars: parameters of the sphere 
    114113 * @return: effective radius value 
    115114 */ 
  • sansmodels/src/sans/models/c_models/lamellarPS_HG.cpp

    r5eb9154 rf9bf661  
    131131/** 
    132132 * Function to calculate effective radius 
    133  * @param pars: parameters of the sphere 
    134133 * @return: effective radius value 
    135134 */ 
  • sansmodels/src/sans/models/c_models/modelTemplate.txt

    r5eb9154 rf9bf661  
    8282    def calculate_ER(self): 
    8383        """ Calculate the effective radius for P(q)*S(q) 
    84             @param x: input q, or [q,phi] 
    8584            @return: the value of the effective radius 
    8685        """        
  • sansmodels/src/sans/models/c_models/multishell.cpp

    r5eb9154 rf9bf661  
    122122/** 
    123123 * Function to calculate effective radius 
    124  * @param pars: parameters of the sphere 
    125124 * @return: effective radius value 
    126125 */ 
  • sansmodels/src/sans/models/c_models/parallelepiped.cpp

    r5eb9154 rf9bf661  
    3030extern "C" { 
    3131        #include "libCylinder.h" 
     32        #include "libStructureFactor.h" 
    3233        #include "parallelepiped.h" 
    3334} 
     
    3637        scale      = Parameter(1.0); 
    3738        short_a     = Parameter(35.0, true); 
    38         short_a.set_max(1.0); 
     39        short_a.set_min(1.0); 
    3940        short_b     = Parameter(75.0, true); 
    4041        short_b.set_min(1.0); 
     
    9596                        for(int k=0; k< (int)weights_long_c.size(); k++) { 
    9697                                dp[3] = weights_long_c[k].value; 
    97  
    9898                                sum += weights_short_a[i].weight * weights_short_b[j].weight 
    9999                                        * weights_long_c[k].weight * Parallelepiped(dp, q); 
     
    104104                } 
    105105        } 
     106 
    106107        return sum/norm + background(); 
    107108} 
     
    226227/** 
    227228 * Function to calculate effective radius 
    228  * @param pars: parameters of the sphere 
    229229 * @return: effective radius value 
    230230 */ 
    231231double ParallelepipedModel :: calculate_ER() { 
    232 //NOT implemented yet!!! 
    233 } 
     232        ParallelepipedParameters dp; 
     233        dp.short_a   = short_a(); 
     234        dp.short_b   = short_b(); 
     235        dp.long_c  = long_c(); 
     236        double rad_out = 0.0; 
     237        double pi = 4.0*atan(1.0); 
     238        double suf_rad = sqrt(dp.short_a*dp.short_b/pi); 
     239 
     240        // Perform the computation, with all weight points 
     241        double sum = 0.0; 
     242        double norm = 0.0; 
     243 
     244        // Get the dispersion points for the short_edgeA 
     245        vector<WeightPoint> weights_short_a; 
     246        short_a.get_weights(weights_short_a); 
     247 
     248        // Get the dispersion points for the longer_edgeB 
     249        vector<WeightPoint> weights_short_b; 
     250        short_b.get_weights(weights_short_b); 
     251 
     252        // Get angular averaging for the longuest_edgeC 
     253        vector<WeightPoint> weights_long_c; 
     254        long_c.get_weights(weights_long_c); 
     255 
     256        // Loop over radius weight points 
     257        for(int i=0; i< (int)weights_short_a.size(); i++) { 
     258                dp.short_a = weights_short_a[i].value; 
     259 
     260                // Loop over longer_edgeB weight points 
     261                for(int j=0; j< (int)weights_short_b.size(); j++) { 
     262                        dp.short_b = weights_short_b[j].value; 
     263 
     264                        // Average over longuest_edgeC distribution 
     265                        for(int k=0; k< (int)weights_long_c.size(); k++) { 
     266                                dp.long_c = weights_long_c[k].value; 
     267                                //Calculate surface averaged radius 
     268                                //This is rough approximation. 
     269                                suf_rad = sqrt(dp.short_a*dp.short_b/pi); 
     270 
     271                                //Note: output of "DiamCyl(dp.length,dp.radius)" is DIAMETER. 
     272                                sum +=weights_short_a[i].weight* weights_short_b[j].weight 
     273                                        * weights_long_c[k].weight*DiamCyl(dp.long_c, suf_rad)/2.0; 
     274                                norm += weights_short_a[i].weight* weights_short_b[j].weight*weights_long_c[k].weight; 
     275                        } 
     276                } 
     277        } 
     278 
     279        if (norm != 0){ 
     280                //return the averaged value 
     281                rad_out =  sum/norm;} 
     282        else{ 
     283                //return normal value 
     284                //Note: output of "DiamCyl(length,radius)" is DIAMETER. 
     285                rad_out = DiamCyl(dp.long_c, suf_rad)/2.0;} 
     286        return rad_out; 
     287 
     288} 
  • sansmodels/src/sans/models/c_models/sphere.cpp

    r5eb9154 rf9bf661  
    9898/** 
    9999 * Function to calculate effective radius 
    100  * @param pars: parameters of the sphere 
    101100 * @return: effective radius value 
    102101 */ 
  • sansmodels/src/sans/models/c_models/spheroid.cpp

    r5eb9154 rf9bf661  
    247247/** 
    248248 * Function to calculate effective radius 
    249  * @param pars: parameters of the sphere 
    250249 * @return: effective radius value 
    251250 */ 
  • sansmodels/src/sans/models/c_models/stackeddisks.cpp

    r5eb9154 rf9bf661  
    219219/** 
    220220 * Function to calculate effective radius 
    221  * @param pars: parameters of the sphere 
    222221 * @return: effective radius value 
    223222 */ 
  • sansmodels/src/sans/models/c_models/triaxialellipsoid.cpp

    r5eb9154 rf9bf661  
    2929extern "C" { 
    3030        #include "libCylinder.h" 
     31        #include "libStructureFactor.h" 
    3132        #include "triaxial_ellipsoid.h" 
    3233} 
     
    219220/** 
    220221 * Function to calculate effective radius 
    221  * @param pars: parameters of the sphere 
    222222 * @return: effective radius value 
    223223 */ 
    224224double TriaxialEllipsoidModel :: calculate_ER() { 
    225 //NOT implemented yet!!! 
    226 } 
     225        TriaxialEllipsoidParameters dp; 
     226 
     227        dp.semi_axisA   = semi_axisA(); 
     228        dp.semi_axisB     = semi_axisB(); 
     229        //polar axis C 
     230        dp.semi_axisC     = semi_axisC(); 
     231 
     232        double rad_out = 0.0; 
     233        //Surface average radius at the equat. cross section. 
     234        double suf_rad = sqrt(dp.semi_axisA * dp.semi_axisB); 
     235 
     236        // Perform the computation, with all weight points 
     237        double sum = 0.0; 
     238        double norm = 0.0; 
     239 
     240        // Get the dispersion points for the semi_axis A 
     241        vector<WeightPoint> weights_semi_axisA; 
     242        semi_axisA.get_weights(weights_semi_axisA); 
     243 
     244        // Get the dispersion points for the semi_axis B 
     245        vector<WeightPoint> weights_semi_axisB; 
     246        semi_axisB.get_weights(weights_semi_axisB); 
     247 
     248        // Get the dispersion points for the semi_axis C 
     249        vector<WeightPoint> weights_semi_axisC; 
     250        semi_axisC.get_weights(weights_semi_axisC); 
     251 
     252        // Loop over semi axis A weight points 
     253        for(int i=0; i< (int)weights_semi_axisA.size(); i++) { 
     254                dp.semi_axisA = weights_semi_axisA[i].value; 
     255 
     256                // Loop over semi axis B weight points 
     257                for(int j=0; j< (int)weights_semi_axisB.size(); j++) { 
     258                        dp.semi_axisB = weights_semi_axisB[j].value; 
     259 
     260                        // Loop over semi axis C weight points 
     261                        for(int k=0; k < (int)weights_semi_axisC.size(); k++) { 
     262                                dp.semi_axisC = weights_semi_axisC[k].value; 
     263 
     264                                //Calculate surface averaged radius 
     265                                suf_rad = sqrt(dp.semi_axisA * dp.semi_axisB); 
     266 
     267                                //Sum 
     268                                sum += weights_semi_axisA[i].weight 
     269                                        * weights_semi_axisB[j].weight 
     270                                        * weights_semi_axisC[k].weight * DiamEllip(dp.semi_axisC, suf_rad)/2.0; 
     271                                //Norm 
     272                                norm += weights_semi_axisA[i].weight* weights_semi_axisB[j].weight 
     273                                        * weights_semi_axisC[k].weight; 
     274                        } 
     275                } 
     276        } 
     277        if (norm != 0){ 
     278                //return the averaged value 
     279                rad_out =  sum/norm;} 
     280        else{ 
     281                //return normal value 
     282                rad_out = DiamEllip(dp.semi_axisC, suf_rad)/2.0;} 
     283 
     284        return rad_out; 
     285} 
  • sansmodels/src/sans/models/c_models/vesicle.cpp

    r5eb9154 rf9bf661  
    108108/** 
    109109 * Function to calculate effective radius 
    110  * @param pars: parameters of the sphere 
    111110 * @return: effective radius value 
    112111 */ 
Note: See TracChangeset for help on using the changeset viewer.