Changeset e2afadf in sasview for sansmodels/src/sans/models


Ignore:
Timestamp:
Aug 25, 2009 3:31:36 PM (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:
ff85cc5
Parents:
c8727c5
Message:

fixed a mistake and changed a para_name

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

Legend:

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

    r9bd69098 re2afadf  
    3434         scale           = 1.0  
    3535         core_radius     = 20.0 [A] 
    36          shell_radius    = 30.0 [A] 
     36         radius          = 30.0 [A] 
    3737         length          = 400.0 [A] 
    3838         contrast        = 5.3e-006 [1/A²] 
     
    5959        self.details['scale'] = ['', None, None] 
    6060        self.details['core_radius'] = ['[A]', None, None] 
    61         self.details['shell_radius'] = ['[A]', None, None] 
     61        self.details['radius'] = ['[A]', None, None] 
    6262        self.details['length'] = ['[A]', None, None] 
    6363        self.details['contrast'] = ['[1/A²]', None, None] 
     
    6767 
    6868                ## fittable parameters 
    69         self.fixed=['axis_phi.width', 'axis_theta.width', 'length.width', 'core_radius.width', 'shell_radius'] 
     69        self.fixed=['axis_phi.width', 'axis_theta.width', 'length.width', 'core_radius.width', 'radius'] 
    7070         
    7171        ## parameters with orientation 
  • sansmodels/src/sans/models/VesicleModel.py

    r870f131 re2afadf  
    3333        List of default parameters: 
    3434         scale           = 1.0  
    35          core_radius     = 100.0 [A] 
     35         radius          = 100.0 [A] 
    3636         thickness       = 30.0 [A] 
    3737         core_sld        = 6.36e-006 [1/A²] 
     
    5151        self.name = "VesicleModel" 
    5252        ## Model description 
    53         self.description ="""Model parameters:  core_radius : Core radius of the vesicle 
     53        self.description ="""Model parameters:  radius : core radius of the vesicle 
    5454                thickness: shell thickness 
    5555                core_sld: core scattering length density 
     
    6161        self.details = {} 
    6262        self.details['scale'] = ['', None, None] 
    63         self.details['core_radius'] = ['[A]', None, None] 
     63        self.details['radius'] = ['[A]', None, None] 
    6464        self.details['thickness'] = ['[A]', None, None] 
    6565        self.details['core_sld'] = ['[1/A²]', None, None] 
     
    6868 
    6969                ## fittable parameters 
    70         self.fixed=['core_radius.width', 'thickness.width'] 
     70        self.fixed=['radius.width', 'thickness.width'] 
    7171         
    7272        ## parameters with orientation 
  • sansmodels/src/sans/models/c_extensions/hollow_cylinder.c

    r27fea3f re2afadf  
    1818double hollow_cylinder_analytical_1D(HollowCylinderParameters *pars, double q) { 
    1919        double dp[6]; 
    20          
     20 
    2121        dp[0] = pars->scale; 
    2222        dp[1] = pars->core_radius; 
    23         dp[2] = pars->shell_radius; 
     23        dp[2] = pars->radius; 
    2424        dp[3] = pars->length; 
    2525        dp[4] = pars->contrast; 
    2626        dp[5] = pars->background; 
    27          
     27 
    2828        return HollowCylinder(dp, q); 
    2929} 
    30      
     30 
    3131/** 
    3232 * Function to evaluate 2D scattering function 
     
    3939        q = sqrt(qx*qx+qy*qy); 
    4040    return hollow_cylinder_analytical_2D_scaled(pars, q, qx/q, qy/q); 
    41 }  
     41} 
    4242 
    4343/** 
     
    5050double hollow_cylinder_analytical_2D(HollowCylinderParameters *pars, double q, double phi) { 
    5151    return hollow_cylinder_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); 
    52 }  
     52} 
    5353 
    5454/** 
     
    6565        double  alpha,vol, cos_val; 
    6666        double answer; 
    67          
     67 
    6868    // Cylinder orientation 
    6969    cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 
    7070    cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 
    7171    cyl_z = cos(pars->axis_theta); 
    72       
     72 
    7373    // q vector 
    7474    q_z = 0; 
    75          
     75 
    7676    // Compute the angle btw vector q and the 
    7777    // axis of the cylinder 
    7878    cos_val = cyl_x*q_x + cyl_y*q_y + cyl_z*q_z; 
    79      
     79 
    8080    // The following test should always pass 
    8181    if (fabs(cos_val)>1.0) { 
     
    8383        return 0; 
    8484    } 
    85      
     85 
    8686        alpha = acos( cos_val ); 
    87          
     87 
    8888        // Call the IGOR library function to get the kernel 
    89         answer = HolCylKernel(q, pars->core_radius, pars->shell_radius, pars->length, cos_val); 
    90          
     89        answer = HolCylKernel(q, pars->core_radius, pars->radius, pars->length, cos_val); 
     90 
    9191        //normalize by cylinder volume 
    92         vol=acos(-1.0)*((pars->core_radius *pars->core_radius)-(pars->shell_radius*pars->shell_radius)) 
     92        vol=acos(-1.0)*((pars->core_radius *pars->core_radius)-(pars->radius*pars->radius)) 
    9393                        *(pars->length); 
    9494        answer /= vol; 
    95          
     95 
    9696        //convert to [cm-1] 
    9797        answer *= 1.0e8; 
    98          
     98 
    9999        //Scale 
    100100        answer *= pars->scale; 
    101          
     101 
    102102        // add in the background 
    103103        answer += pars->background; 
    104          
     104 
    105105        return answer; 
    106106} 
  • sansmodels/src/sans/models/c_extensions/hollow_cylinder.h

    r27fea3f re2afadf  
    66 */ 
    77 //[PYTHONCLASS] = HollowCylinderModel 
    8  //[DISP_PARAMS] = core_radius, shell_radius, length, axis_theta, axis_phi 
     8 //[DISP_PARAMS] = core_radius, radius, length, axis_theta, axis_phi 
    99 //[DESCRIPTION] = <text></text> 
    10  //[FIXED]= <text> axis_phi.width; axis_theta.width; length.width;core_radius.width; shell_radius</text> 
     10 //[FIXED]= <text> axis_phi.width; axis_theta.width; length.width;core_radius.width; radius</text> 
    1111 //[ORIENTATION_PARAMS]= axis_phi; axis_theta;axis_phi.width; axis_theta.width 
    1212 
     
    2222 
    2323    /// Shell radius [A] 
    24     //  [DEFAULT]=shell_radius=30.0 [A] 
    25     double shell_radius; 
     24    //  [DEFAULT]=radius=30.0 [A] 
     25    double radius; 
    2626 
    2727    /// Hollow cylinder length [A] 
  • sansmodels/src/sans/models/c_extensions/vesicle.c

    r3d25331f re2afadf  
    1717double vesicle_analytical_1D(VesicleParameters *pars, double q) { 
    1818        double dp[6]; 
    19          
     19 
    2020        dp[0] = pars->scale; 
    21         dp[1] = pars->core_radius; 
     21        dp[1] = pars->radius; 
    2222        dp[2] = pars->thickness; 
    2323        dp[3] = pars->core_sld; 
     
    2525        dp[5] = pars->background; 
    2626 
    27          
     27 
    2828        return VesicleForm(dp, q); 
    2929} 
    30      
     30 
    3131/** 
    3232 * Function to evaluate 2D scattering function 
     
    4040 
    4141double vesicle_analytical_2DXY(VesicleParameters *pars, double qx, double qy){ 
    42         return vesicle_analytical_1D(pars,sqrt(qx*qx+qy*qy));    
     42        return vesicle_analytical_1D(pars,sqrt(qx*qx+qy*qy)); 
    4343} 
  • sansmodels/src/sans/models/c_extensions/vesicle.h

    r42f193a re2afadf  
    55 * Structure definition for vesicle parameters 
    66[PYTHONCLASS] = VesicleModel 
    7 [DISP_PARAMS] = core_radius,thickness 
    8 [DESCRIPTION] =<text>Model parameters:  core_radius : Core radius of the vesicle 
     7[DISP_PARAMS] = radius,thickness 
     8[DESCRIPTION] =<text>Model parameters:  radius : core radius of the vesicle 
    99                thickness: shell thickness 
    1010                core_sld: core scattering length density 
     
    1313                scale : scale factor 
    1414</text> 
    15 [FIXED]=  core_radius.width; thickness.width 
     15[FIXED]=  radius.width; thickness.width 
    1616[ORIENTATION_PARAMS]= <text> </text> 
    1717 */ 
     
    2222 
    2323    /// Core radius of the vesicle [A] 
    24     //  [DEFAULT]=core_radius= 100.0 [A] 
    25     double core_radius; 
     24    //  [DEFAULT]=radius= 100.0 [A] 
     25    double radius; 
    2626 
    2727        ///     shell thickness [Å] 
  • sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp

    r870f131 re2afadf  
    9191        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000)); 
    9292        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000)); 
     93        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",30.000000)); 
    9394        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.010000)); 
    94         PyDict_SetItemString(self->params,"shell_radius",Py_BuildValue("d",30.000000)); 
    9595        PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000005)); 
    9696        // Initialize dispersion / averaging parameter dict 
     
    101101        PyDict_SetItemString(self->dispersion, "core_radius", disp_dict); 
    102102        disp_dict = PyDict_New(); 
    103         self->model->shell_radius.dispersion->accept_as_source(visitor, self->model->shell_radius.dispersion, disp_dict); 
    104         PyDict_SetItemString(self->dispersion, "shell_radius", disp_dict); 
     103        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict); 
     104        PyDict_SetItemString(self->dispersion, "radius", disp_dict); 
    105105        disp_dict = PyDict_New(); 
    106106        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict); 
     
    248248    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") ); 
    249249    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") ); 
     250    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 
    250251    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    251     self->model->shell_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_radius") ); 
    252252    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") ); 
    253253    // Read in dispersion parameters 
     
    256256    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 
    257257    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 
    258     disp_dict = PyDict_GetItemString(self->dispersion, "shell_radius"); 
    259     self->model->shell_radius.dispersion->accept_as_destination(visitor, self->model->shell_radius.dispersion, disp_dict); 
     258    disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 
     259    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 
    260260    disp_dict = PyDict_GetItemString(self->dispersion, "length"); 
    261261    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict); 
     
    331331    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") ); 
    332332    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") ); 
     333    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 
    333334    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    334     self->model->shell_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_radius") ); 
    335335    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") ); 
    336336    // Read in dispersion parameters 
     
    339339    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 
    340340    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 
    341     disp_dict = PyDict_GetItemString(self->dispersion, "shell_radius"); 
    342     self->model->shell_radius.dispersion->accept_as_destination(visitor, self->model->shell_radius.dispersion, disp_dict); 
     341    disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 
     342    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 
    343343    disp_dict = PyDict_GetItemString(self->dispersion, "length"); 
    344344    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict); 
     
    403403    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") ); 
    404404    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") ); 
     405    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 
    405406    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    406     self->model->shell_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_radius") ); 
    407407    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") ); 
    408408    // Read in dispersion parameters 
     
    411411    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 
    412412    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 
    413     disp_dict = PyDict_GetItemString(self->dispersion, "shell_radius"); 
    414     self->model->shell_radius.dispersion->accept_as_destination(visitor, self->model->shell_radius.dispersion, disp_dict); 
     413    disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 
     414    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 
    415415    disp_dict = PyDict_GetItemString(self->dispersion, "length"); 
    416416    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict); 
     
    476476    if (!strcmp(par_name, "core_radius")) { 
    477477        self->model->core_radius.dispersion = dispersion; 
    478     } else    if (!strcmp(par_name, "shell_radius")) { 
    479         self->model->shell_radius.dispersion = dispersion; 
     478    } else    if (!strcmp(par_name, "radius")) { 
     479        self->model->radius.dispersion = dispersion; 
    480480    } else    if (!strcmp(par_name, "length")) { 
    481481        self->model->length.dispersion = dispersion; 
  • sansmodels/src/sans/models/c_models/CVesicleModel.cpp

    r870f131 re2afadf  
    8787        // Initialize parameter dictionary 
    8888        PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000006)); 
    89         PyDict_SetItemString(self->params,"core_radius",Py_BuildValue("d",100.000000)); 
    9089        PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",30.000000)); 
    9190        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000)); 
     91        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",100.000000)); 
    9292        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000)); 
    9393        PyDict_SetItemString(self->params,"shell_sld",Py_BuildValue("d",0.000000)); 
     
    9696        PyObject * disp_dict; 
    9797        disp_dict = PyDict_New(); 
    98         self->model->core_radius.dispersion->accept_as_source(visitor, self->model->core_radius.dispersion, disp_dict); 
    99         PyDict_SetItemString(self->dispersion, "core_radius", disp_dict); 
     98        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict); 
     99        PyDict_SetItemString(self->dispersion, "radius", disp_dict); 
    100100        disp_dict = PyDict_New(); 
    101101        self->model->thickness.dispersion->accept_as_source(visitor, self->model->thickness.dispersion, disp_dict); 
     
    233233            // Reader parameter dictionary 
    234234    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 
    235     self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") ); 
    236235    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") ); 
    237236    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     237    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 
    238238    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    239239    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") ); 
     
    241241    PyObject* disp_dict; 
    242242    DispersionVisitor* visitor = new DispersionVisitor(); 
    243     disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 
    244     self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 
     243    disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 
     244    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 
    245245    disp_dict = PyDict_GetItemString(self->dispersion, "thickness"); 
    246246    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); 
     
    308308            // Reader parameter dictionary 
    309309    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 
    310     self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") ); 
    311310    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") ); 
    312311    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     312    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 
    313313    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    314314    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") ); 
     
    316316    PyObject* disp_dict; 
    317317    DispersionVisitor* visitor = new DispersionVisitor(); 
    318     disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 
    319     self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 
     318    disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 
     319    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 
    320320    disp_dict = PyDict_GetItemString(self->dispersion, "thickness"); 
    321321    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); 
     
    372372            // Reader parameter dictionary 
    373373    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 
    374     self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") ); 
    375374    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") ); 
    376375    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     376    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 
    377377    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    378378    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") ); 
     
    380380    PyObject* disp_dict; 
    381381    DispersionVisitor* visitor = new DispersionVisitor(); 
    382     disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 
    383     self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 
     382    disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 
     383    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 
    384384    disp_dict = PyDict_GetItemString(self->dispersion, "thickness"); 
    385385    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); 
     
    439439        // Ugliness necessary to go from python to C 
    440440            // TODO: refactor this 
    441     if (!strcmp(par_name, "core_radius")) { 
    442         self->model->core_radius.dispersion = dispersion; 
     441    if (!strcmp(par_name, "radius")) { 
     442        self->model->radius.dispersion = dispersion; 
    443443    } else    if (!strcmp(par_name, "thickness")) { 
    444444        self->model->thickness.dispersion = dispersion; 
  • sansmodels/src/sans/models/c_models/hollowcylinder.cpp

    r9188cc1 re2afadf  
    3636        core_radius = Parameter(20.0, true); 
    3737        core_radius.set_min(0.0); 
    38         shell_radius  = Parameter(30.0, true); 
    39         shell_radius.set_min(0.0); 
     38        radius  = Parameter(30.0, true); 
     39        radius.set_min(0.0); 
    4040        length     = Parameter(400.0, true); 
    4141        length.set_min(0.0); 
     
    5757        dp[0] = scale(); 
    5858        dp[1] = core_radius(); 
    59         dp[2] = shell_radius(); 
     59        dp[2] = radius(); 
    6060        dp[3] = length(); 
    6161        dp[4] = contrast(); 
     
    6767 
    6868        // Get the dispersion points for the shell radius 
    69         vector<WeightPoint> weights_shell_radius; 
    70         shell_radius.get_weights(weights_shell_radius); 
     69        vector<WeightPoint> weights_radius; 
     70        radius.get_weights(weights_radius); 
    7171 
    7272        // Get the dispersion points for the length 
     
    8787 
    8888                        // Loop over shell radius weight points 
    89                         for(int k=0; k< (int)weights_shell_radius.size(); k++) { 
    90                                 dp[2] = weights_shell_radius[k].value; 
     89                        for(int k=0; k< (int)weights_radius.size(); k++) { 
     90                                dp[2] = weights_radius[k].value; 
    9191 
    9292                                sum += weights_core_radius[i].weight 
    9393                                        * weights_length[j].weight 
    94                                         * weights_shell_radius[k].weight 
     94                                        * weights_radius[k].weight 
    9595                                        * HollowCylinder(dp, q); 
    9696                                norm += weights_core_radius[i].weight 
    9797                                * weights_length[j].weight 
    98                                 * weights_shell_radius[k].weight; 
     98                                * weights_radius[k].weight; 
    9999                        } 
    100100                } 
     
    114114        dp.scale      = scale(); 
    115115        dp.core_radius     = core_radius(); 
    116         dp.shell_radius  = shell_radius(); 
     116        dp.radius  = radius(); 
    117117        dp.length     = length(); 
    118118        dp.contrast   = contrast(); 
     
    126126 
    127127        // Get the dispersion points for the shell radius 
    128         vector<WeightPoint> weights_shell_radius; 
    129         shell_radius.get_weights(weights_shell_radius); 
     128        vector<WeightPoint> weights_radius; 
     129        radius.get_weights(weights_radius); 
    130130 
    131131        // Get the dispersion points for the length 
     
    155155 
    156156                        // Loop over shell radius weight points 
    157                         for(int m=0; m< (int)weights_shell_radius.size(); m++) { 
    158                                 dp.shell_radius = weights_shell_radius[m].value; 
     157                        for(int m=0; m< (int)weights_radius.size(); m++) { 
     158                                dp.radius = weights_radius[m].value; 
    159159 
    160160                        // Average over theta distribution 
     
    168168                                        double _ptvalue = weights_core_radius[i].weight 
    169169                                                * weights_length[j].weight 
    170                                                 * weights_shell_radius[m].weight 
     170                                                * weights_radius[m].weight 
    171171                                                * weights_theta[k].weight 
    172172                                                * weights_phi[l].weight 
     
    179179                                        norm += weights_core_radius[i].weight 
    180180                                                * weights_length[j].weight 
    181                                                 * weights_shell_radius[m].weight 
     181                                                * weights_radius[m].weight 
    182182                                                * weights_theta[k].weight 
    183183                                                * weights_phi[l].weight; 
  • sansmodels/src/sans/models/c_models/models.hh

    rc1c29b6 re2afadf  
    494494        Parameter scale; 
    495495        Parameter core_radius; 
    496         Parameter shell_radius; 
     496        Parameter radius; 
    497497        Parameter length; 
    498498        Parameter contrast; 
     
    535535        // Model parameters 
    536536        Parameter scale; 
    537         Parameter core_radius; 
     537        Parameter radius; 
    538538        Parameter thickness; 
    539539        Parameter core_sld; 
  • sansmodels/src/sans/models/c_models/vesicle.cpp

    r9188cc1 re2afadf  
    3232VesicleModel :: VesicleModel() { 
    3333        scale      = Parameter(1.0); 
    34         core_radius     = Parameter(100.0, true); 
    35         core_radius.set_min(0.0); 
     34        radius     = Parameter(100.0, true); 
     35        radius.set_min(0.0); 
    3636        thickness  = Parameter(30.0, true); 
    3737        thickness.set_min(0.0); 
     
    5353        // Add the background after averaging 
    5454        dp[0] = scale(); 
    55         dp[1] = core_radius(); 
     55        dp[1] = radius(); 
    5656        dp[2] = thickness(); 
    5757        dp[3] = core_sld(); 
     
    6161 
    6262        // Get the dispersion points for the core radius 
    63         vector<WeightPoint> weights_core_radius; 
    64         core_radius.get_weights(weights_core_radius); 
     63        vector<WeightPoint> weights_radius; 
     64        radius.get_weights(weights_radius); 
    6565        // Get the dispersion points for the thickness 
    6666        vector<WeightPoint> weights_thickness; 
     
    7272 
    7373        // Loop over radius weight points 
    74         for(int i=0; i< (int)weights_core_radius.size(); i++) { 
    75                 dp[1] = weights_core_radius[i].value; 
    76                 for(int j=0; j< (int)weights_core_radius.size(); j++) { 
     74        for(int i=0; i< (int)weights_radius.size(); i++) { 
     75                dp[1] = weights_radius[i].value; 
     76                for(int j=0; j< (int)weights_thickness.size(); j++) { 
    7777                        dp[2] = weights_thickness[j].value; 
    78                         sum += weights_core_radius[i].weight 
     78                        sum += weights_radius[i].weight 
    7979                                * weights_thickness[j].weight * VesicleForm(dp, q); 
    80                         norm += weights_core_radius[i].weight * weights_thickness[j].weight; 
     80                        norm += weights_radius[i].weight * weights_thickness[j].weight; 
    8181                } 
    8282        } 
Note: See TracChangeset for help on using the changeset viewer.