Ignore:
Timestamp:
Aug 31, 2009 5:25:44 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:
5be36bb
Parents:
572beba
Message:

calculation of the effective radius are added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp

    r870f131 r5eb9154  
    360360        }        
    361361} 
    362  
    363 /** 
    364  * Function to call to evaluate model in cartesian coordinates 
    365  * @param args: input q or [qx, qy]] 
    366  * @return: function value 
    367  */ 
    368 static PyObject * runXY(CLamellarFFHGModel *self, PyObject *args) { 
    369         double qx_value, qy_value; 
     362/** 
     363 * Function to call to calculate_ER 
     364 * @return: effective radius value  
     365 */ 
     366static PyObject * calculate_ER(CLamellarFFHGModel *self) { 
     367 
    370368        PyObject* pars; 
    371369        int npars; 
     
    389387    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.dispersion, disp_dict); 
    390388 
     389                 
     390        return Py_BuildValue("d",(*(self->model)).calculate_ER()); 
     391 
     392} 
     393/** 
     394 * Function to call to evaluate model in cartesian coordinates 
     395 * @param args: input q or [qx, qy]] 
     396 * @return: function value 
     397 */ 
     398static PyObject * runXY(CLamellarFFHGModel *self, PyObject *args) { 
     399        double qx_value, qy_value; 
     400        PyObject* pars; 
     401        int npars; 
     402         
     403        // Get parameters 
     404         
     405            // Reader parameter dictionary 
     406    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     407    self->model->h_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "h_thickness") ); 
     408    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") ); 
     409    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") ); 
     410    self->model->t_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "t_length") ); 
     411    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") ); 
     412    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
     413    // Read in dispersion parameters 
     414    PyObject* disp_dict; 
     415    DispersionVisitor* visitor = new DispersionVisitor(); 
     416    disp_dict = PyDict_GetItemString(self->dispersion, "t_length"); 
     417    self->model->t_length.dispersion->accept_as_destination(visitor, self->model->t_length.dispersion, disp_dict); 
     418    disp_dict = PyDict_GetItemString(self->dispersion, "h_thickness"); 
     419    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.dispersion, disp_dict); 
     420 
    391421         
    392422        // Get input and determine whether we have to supply a 1D or 2D return value. 
     
    466496    {"runXY",      (PyCFunction)runXY     , METH_VARARGS, 
    467497      "Evaluate the model at a given Q or Qx, Qy"}, 
     498    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS, 
     499      "Evaluate the model at a given Q or Q, phi"}, 
    468500       
    469501    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS, 
Note: See TracChangeset for help on using the changeset viewer.