Changeset 339ce67 in sasview for sansmodels/src/sans/models/c_models


Ignore:
Timestamp:
Oct 12, 2010 6:22:08 PM (14 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:
20f00bed
Parents:
aaad3098
Message:

added some models and tests

Location:
sansmodels/src/sans/models/c_models
Files:
5 added
6 edited

Legend:

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

    r35aface r339ce67  
    9797        PyDict_SetItemString(self->params,"thick_shell2",Py_BuildValue("d",10.000000000000)); 
    9898        PyDict_SetItemString(self->params,"sld_shell1",Py_BuildValue("d",0.000001000000)); 
    99         PyDict_SetItemString(self->params,"rad_core",Py_BuildValue("d",60.000000000000)); 
    100         PyDict_SetItemString(self->params,"sld_core",Py_BuildValue("d",0.000006400000)); 
     99        PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",10.000000000000)); 
     100        PyDict_SetItemString(self->params,"sld_core0",Py_BuildValue("d",0.000006400000)); 
    101101        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000)); 
    102         PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",10.000000000000)); 
     102        PyDict_SetItemString(self->params,"rad_core0",Py_BuildValue("d",60.000000000000)); 
    103103        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006400000)); 
    104104        PyDict_SetItemString(self->params,"sld_shell3",Py_BuildValue("d",0.000003000000)); 
     
    107107        PyObject * disp_dict; 
    108108        disp_dict = PyDict_New(); 
    109         self->model->rad_core.dispersion->accept_as_source(visitor, self->model->rad_core.dispersion, disp_dict); 
    110         PyDict_SetItemString(self->dispersion, "rad_core", disp_dict); 
     109        self->model->rad_core0.dispersion->accept_as_source(visitor, self->model->rad_core0.dispersion, disp_dict); 
     110        PyDict_SetItemString(self->dispersion, "rad_core0", disp_dict); 
    111111        disp_dict = PyDict_New(); 
    112112        self->model->thick_shell1.dispersion->accept_as_source(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    257257    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 
    258258    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 
    259     self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") ); 
    260     self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") ); 
     259    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     260    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 
    261261    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    262     self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     262    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 
    263263    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 
    264264    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); 
     
    266266    PyObject* disp_dict; 
    267267    DispersionVisitor* visitor = new DispersionVisitor(); 
    268     disp_dict = PyDict_GetItemString(self->dispersion, "rad_core"); 
    269     self->model->rad_core.dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict); 
     268    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 
     269    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 
    270270    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 
    271271    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    345345    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 
    346346    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 
    347     self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") ); 
    348     self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") ); 
     347    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     348    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 
    349349    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    350     self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     350    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 
    351351    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 
    352352    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); 
     
    354354    PyObject* disp_dict; 
    355355    DispersionVisitor* visitor = new DispersionVisitor(); 
    356     disp_dict = PyDict_GetItemString(self->dispersion, "rad_core"); 
    357     self->model->rad_core.dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict); 
     356    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 
     357    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 
    358358    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 
    359359    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    420420    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 
    421421    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 
    422     self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") ); 
    423     self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") ); 
     422    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     423    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 
    424424    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    425     self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     425    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 
    426426    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 
    427427    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); 
     
    429429    PyObject* disp_dict; 
    430430    DispersionVisitor* visitor = new DispersionVisitor(); 
    431     disp_dict = PyDict_GetItemString(self->dispersion, "rad_core"); 
    432     self->model->rad_core.dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict); 
     431    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 
     432    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 
    433433    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 
    434434    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    464464    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 
    465465    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 
    466     self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") ); 
    467     self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") ); 
     466    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     467    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 
    468468    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    469     self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     469    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 
    470470    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 
    471471    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); 
     
    473473    PyObject* disp_dict; 
    474474    DispersionVisitor* visitor = new DispersionVisitor(); 
    475     disp_dict = PyDict_GetItemString(self->dispersion, "rad_core"); 
    476     self->model->rad_core.dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict); 
     475    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 
     476    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 
    477477    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 
    478478    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    538538        // Ugliness necessary to go from python to C 
    539539            // TODO: refactor this 
    540     if (!strcmp(par_name, "rad_core")) { 
    541         self->model->rad_core.dispersion = dispersion; 
     540    if (!strcmp(par_name, "rad_core0")) { 
     541        self->model->rad_core0.dispersion = dispersion; 
    542542    } else    if (!strcmp(par_name, "thick_shell1")) { 
    543543        self->model->thick_shell1.dispersion = dispersion; 
  • sansmodels/src/sans/models/c_models/CReflModel.cpp

    r35aface r339ce67  
    9090         
    9191        // Initialize parameter dictionary 
     92        PyDict_SetItemString(self->params,"sldIM_flat4",Py_BuildValue("d",0.000000000000)); 
    9293        PyDict_SetItemString(self->params,"thick_flat8",Py_BuildValue("d",100.000000000000)); 
    9394        PyDict_SetItemString(self->params,"thick_flat9",Py_BuildValue("d",100.000000000000)); 
     95        PyDict_SetItemString(self->params,"sldIM_flat7",Py_BuildValue("d",0.000000000000)); 
     96        PyDict_SetItemString(self->params,"sldIM_flat10",Py_BuildValue("d",0.000000000000)); 
     97        PyDict_SetItemString(self->params,"sldIM_flat5",Py_BuildValue("d",0.000000000000)); 
    9498        PyDict_SetItemString(self->params,"thick_flat1",Py_BuildValue("d",10.000000000000)); 
    9599        PyDict_SetItemString(self->params,"thick_flat3",Py_BuildValue("d",100.000000000000)); 
     
    109113        PyDict_SetItemString(self->params,"thick_inter8",Py_BuildValue("d",1.000000000000)); 
    110114        PyDict_SetItemString(self->params,"thick_inter9",Py_BuildValue("d",1.000000000000)); 
     115        PyDict_SetItemString(self->params,"sldIM_flat1",Py_BuildValue("d",0.000000000000)); 
    111116        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000)); 
     117        PyDict_SetItemString(self->params,"sldIM_flat2",Py_BuildValue("d",0.000000000000)); 
    112118        PyDict_SetItemString(self->params,"func_inter9",Py_BuildValue("d",0.000000000000)); 
    113119        PyDict_SetItemString(self->params,"thick_inter10",Py_BuildValue("d",1.000000000000)); 
     120        PyDict_SetItemString(self->params,"sldIM_flat3",Py_BuildValue("d",0.000000000000)); 
    114121        PyDict_SetItemString(self->params,"func_inter8",Py_BuildValue("d",0.000000000000)); 
    115122        PyDict_SetItemString(self->params,"thick_flat2",Py_BuildValue("d",100.000000000000)); 
     
    129136        PyDict_SetItemString(self->params,"sld_flat2",Py_BuildValue("d",0.000003500000)); 
    130137        PyDict_SetItemString(self->params,"sld_flat3",Py_BuildValue("d",0.000004000000)); 
     138        PyDict_SetItemString(self->params,"sldIM_flat8",Py_BuildValue("d",0.000000000000)); 
    131139        PyDict_SetItemString(self->params,"sld_flat8",Py_BuildValue("d",0.000003500000)); 
    132140        PyDict_SetItemString(self->params,"sld_flat9",Py_BuildValue("d",0.000004000000)); 
     141        PyDict_SetItemString(self->params,"sldIM_flat9",Py_BuildValue("d",0.000000000000)); 
    133142        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000)); 
    134143        PyDict_SetItemString(self->params,"func_inter1",Py_BuildValue("d",0.000000000000)); 
     144        PyDict_SetItemString(self->params,"sldIM_sub0",Py_BuildValue("d",0.000000000000)); 
     145        PyDict_SetItemString(self->params,"sldIM_medium",Py_BuildValue("d",0.000000000000)); 
    135146        PyDict_SetItemString(self->params,"sld_flat10",Py_BuildValue("d",0.000003500000)); 
    136147        PyDict_SetItemString(self->params,"thick_inter0",Py_BuildValue("d",1.000000000000)); 
     148        PyDict_SetItemString(self->params,"sldIM_flat6",Py_BuildValue("d",0.000000000000)); 
    137149        PyDict_SetItemString(self->params,"func_inter4",Py_BuildValue("d",0.000000000000)); 
    138150        PyDict_SetItemString(self->params,"func_inter10",Py_BuildValue("d",0.000000000000)); 
     
    272284         
    273285            // Reader parameter dictionary 
     286    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 
    274287    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 
    275288    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 
     289    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 
     290    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 
     291    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 
    276292    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 
    277293    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); 
     
    291307    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 
    292308    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 
     309    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 
    293310    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     311    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 
    294312    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 
    295313    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 
     314    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 
    296315    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 
    297316    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); 
     
    311330    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 
    312331    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 
     332    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 
    313333    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 
    314334    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 
     335    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 
    315336    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    316337    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 
     338    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 
     339    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 
    317340    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 
    318341    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 
     342    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 
    319343    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 
    320344    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); 
     
    386410         
    387411            // Reader parameter dictionary 
     412    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 
    388413    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 
    389414    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 
     415    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 
     416    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 
     417    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 
    390418    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 
    391419    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); 
     
    405433    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 
    406434    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 
     435    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 
    407436    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     437    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 
    408438    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 
    409439    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 
     440    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 
    410441    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 
    411442    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); 
     
    425456    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 
    426457    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 
     458    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 
    427459    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 
    428460    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 
     461    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 
    429462    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    430463    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 
     464    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 
     465    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 
    431466    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 
    432467    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 
     468    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 
    433469    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 
    434470    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); 
     
    487523         
    488524            // Reader parameter dictionary 
     525    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 
    489526    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 
    490527    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 
     528    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 
     529    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 
     530    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 
    491531    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 
    492532    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); 
     
    506546    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 
    507547    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 
     548    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 
    508549    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     550    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 
    509551    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 
    510552    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 
     553    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 
    511554    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 
    512555    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); 
     
    526569    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 
    527570    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 
     571    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 
    528572    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 
    529573    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 
     574    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 
    530575    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    531576    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 
     577    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 
     578    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 
    532579    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 
    533580    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 
     581    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 
    534582    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 
    535583    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); 
     
    557605         
    558606            // Reader parameter dictionary 
     607    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 
    559608    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 
    560609    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 
     610    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 
     611    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 
     612    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 
    561613    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 
    562614    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); 
     
    576628    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 
    577629    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 
     630    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 
    578631    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     632    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 
    579633    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 
    580634    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 
     635    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 
    581636    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 
    582637    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); 
     
    596651    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 
    597652    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 
     653    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 
    598654    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 
    599655    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 
     656    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 
    600657    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    601658    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 
     659    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 
     660    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 
    602661    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 
    603662    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 
     663    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 
    604664    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 
    605665    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); 
  • sansmodels/src/sans/models/c_models/corefourshell.cpp

    rc724ccd r339ce67  
    3333CoreFourShellModel :: CoreFourShellModel() { 
    3434        scale      = Parameter(1.0); 
    35         rad_core     = Parameter(60.0, true); 
    36         rad_core.set_min(0.0); 
    37         sld_core   = Parameter(6.4e-6); 
     35        rad_core0     = Parameter(60.0, true); 
     36        rad_core0.set_min(0.0); 
     37        sld_core0   = Parameter(6.4e-6); 
    3838        thick_shell1     = Parameter(10.0, true); 
    3939        thick_shell1.set_min(0.0); 
     
    6464        // Add the background after averaging 
    6565        dp[0] = scale(); 
    66         dp[1] = rad_core(); 
    67         dp[2] = sld_core(); 
     66        dp[1] = rad_core0(); 
     67        dp[2] = sld_core0(); 
    6868        dp[3] = thick_shell1(); 
    6969        dp[4] = sld_shell1(); 
     
    7979        // Get the dispersion points for the radius 
    8080        vector<WeightPoint> weights_rad; 
    81         rad_core.get_weights(weights_rad); 
     81        rad_core0.get_weights(weights_rad); 
    8282 
    8383        // Get the dispersion points for the thick 1 
     
    167167 
    168168        dp.scale = scale(); 
    169         dp.rad_core = rad_core(); 
    170         dp.sld_core = sld_core(); 
     169        dp.rad_core0 = rad_core0(); 
     170        dp.sld_core0 = sld_core0(); 
    171171        dp.thick_shell1 = thick_shell1(); 
    172172        dp.sld_shell1 = sld_shell1(); 
     
    182182        // Get the dispersion points for the radius 
    183183        vector<WeightPoint> weights_rad; 
    184         rad_core.get_weights(weights_rad); 
     184        rad_core0.get_weights(weights_rad); 
    185185 
    186186        // Get the dispersion points for the thick 1 
     
    207207        // Loop over radius weight points 
    208208        for(int i=0; i<weights_rad.size(); i++) { 
    209                 dp.rad_core = weights_rad[i].value; 
     209                dp.rad_core0 = weights_rad[i].value; 
    210210                // Loop over radius weight points 
    211211                for(int j=0; j<weights_s1.size(); j++) { 
     
    222222                                                //Un-normalize FourShell by volume 
    223223                                                sum += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight*weights_s4[m].weight 
    224                                                         * (dp.rad_core+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4); 
     224                                                        * (dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4); 
    225225                                                norm += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight*weights_s4[m].weight; 
    226226                                        } 
     
    234234        else{ 
    235235                //return normal value 
    236                 rad_out = dp.rad_core+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4;} 
     236                rad_out = dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4;} 
    237237 
    238238        return rad_out; 
  • sansmodels/src/sans/models/c_models/models.hh

    rd5b6a9d r339ce67  
    4949}; 
    5050 
     51class BarBellModel{ 
     52public: 
     53        // Model parameters 
     54        Parameter scale; 
     55        Parameter rad_bar; 
     56        Parameter len_bar; 
     57        Parameter rad_bell; 
     58        Parameter sld_barbell; 
     59        Parameter sld_solv; 
     60        Parameter background; 
     61        Parameter theta; 
     62        Parameter phi; 
     63 
     64        // Constructor 
     65        BarBellModel(); 
     66 
     67        // Operators to get I(Q) 
     68        double operator()(double q); 
     69        double operator()(double qx, double qy); 
     70        double calculate_ER(); 
     71        double evaluate_rphi(double q, double phi); 
     72}; 
     73 
     74class CappedCylinderModel{ 
     75public: 
     76        // Model parameters 
     77        Parameter scale; 
     78        Parameter rad_cyl; 
     79        Parameter len_cyl; 
     80        Parameter rad_cap; 
     81        Parameter sld_capcyl; 
     82        Parameter sld_solv; 
     83        Parameter background; 
     84        Parameter theta; 
     85        Parameter phi; 
     86 
     87        // Constructor 
     88        CappedCylinderModel(); 
     89 
     90        // Operators to get I(Q) 
     91        double operator()(double q); 
     92        double operator()(double qx, double qy); 
     93        double calculate_ER(); 
     94        double evaluate_rphi(double q, double phi); 
     95}; 
     96 
     97 
    5198class ParallelepipedModel{ 
    5299public: 
     
    80127        Parameter n_shells; 
    81128        Parameter scale; 
    82         Parameter rad_core; 
    83         Parameter sld_core; 
     129        Parameter rad_core0; 
     130        Parameter sld_core0; 
    84131        Parameter sld_solv; 
    85132        Parameter background; 
     
    256303        Parameter func_inter10; 
    257304 
     305        Parameter sldIM_flat1; 
     306        Parameter sldIM_flat2; 
     307        Parameter sldIM_flat3; 
     308        Parameter sldIM_flat4; 
     309        Parameter sldIM_flat5; 
     310        Parameter sldIM_flat6; 
     311        Parameter sldIM_flat7; 
     312        Parameter sldIM_flat8; 
     313        Parameter sldIM_flat9; 
     314        Parameter sldIM_flat10; 
     315 
     316        Parameter sldIM_sub0; 
     317        Parameter sldIM_medium; 
     318 
    258319        // Constructor 
    259320        ReflModel(); 
     
    511572        // Model parameters 
    512573        Parameter scale; 
    513         Parameter rad_core; 
    514         Parameter sld_core; 
     574        Parameter rad_core0; 
     575        Parameter sld_core0; 
    515576        Parameter thick_shell1; 
    516577        Parameter sld_shell1; 
  • sansmodels/src/sans/models/c_models/onion.cpp

    re096270 r339ce67  
    3333        n_shells = Parameter(1.0); 
    3434        scale = Parameter(1.0); 
    35         rad_core = Parameter(200.0); 
    36         sld_core = Parameter(1e-06); 
     35        rad_core0 = Parameter(200.0); 
     36        sld_core0 = Parameter(1e-06); 
    3737        sld_solv = Parameter(6.4e-06); 
    3838    background = Parameter(0.0); 
     
    112112        dp[0] = n_shells(); 
    113113        dp[1] = scale(); 
    114         dp[2] = rad_core(); 
    115         dp[3] = sld_core(); 
     114        dp[2] = rad_core0(); 
     115        dp[3] = sld_core0(); 
    116116        dp[4] = sld_solv(); 
    117117        dp[5] = 0.0; 
     
    175175        // Get the dispersion points for the radius 
    176176        vector<WeightPoint> weights_rad; 
    177         rad_core.get_weights(weights_rad); 
     177        rad_core0.get_weights(weights_rad); 
    178178 
    179179        // Get the dispersion points for the thick 1 
     
    313313double OnionModel :: calculate_ER() { 
    314314        OnionParameters dp; 
    315         dp.rad_core = rad_core(); 
     315        dp.rad_core0 = rad_core0(); 
    316316        dp.thick_shell1 = thick_shell1(); 
    317317        dp.thick_shell2 = thick_shell2(); 
     
    333333        // Get the dispersion points for the radius 
    334334        vector<WeightPoint> weights_rad; 
    335         rad_core.get_weights(weights_rad); 
     335        rad_core0.get_weights(weights_rad); 
    336336 
    337337        // Get the dispersion points for the thick 1 
     
    376376        // Loop over radius weight points 
    377377        for(int i=0; i<weights_rad.size(); i++) { 
    378                 dp.rad_core = weights_rad[i].value; 
     378                dp.rad_core0 = weights_rad[i].value; 
    379379                // Loop over radius weight points 
    380380                for(int j=0; j<weights_s1.size(); j++) { 
     
    411411                                                                                                        *weights_s5[n].weight*weights_s6[o].weight*weights_s7[p].weight*weights_s8[t].weight 
    412412                                                                                                        *weights_s9[r].weight*weights_s10[s].weight 
    413                                                                                                         * (dp.rad_core+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4+dp.thick_shell5 
     413                                                                                                        * (dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4+dp.thick_shell5 
    414414                                                                                                                        +dp.thick_shell6+dp.thick_shell7+dp.thick_shell8+dp.thick_shell9+dp.thick_shell10); 
    415415                                                                                                norm += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight 
     
    433433        else{ 
    434434                //return normal value 
    435                 rad_out = dp.rad_core+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4 
     435                rad_out = dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4 
    436436                                        +dp.thick_shell5+dp.thick_shell6+dp.thick_shell7+dp.thick_shell8+dp.thick_shell9+dp.thick_shell10;} 
    437437        return rad_out; 
  • sansmodels/src/sans/models/c_models/refl.cpp

    r35aface r339ce67  
    6767    func_inter10 = Parameter(0); 
    6868 
     69    sldIM_flat1 = Parameter(0); 
     70    sldIM_flat2 = Parameter(0); 
     71    sldIM_flat3 = Parameter(0); 
     72    sldIM_flat4 = Parameter(0); 
     73    sldIM_flat5 = Parameter(0); 
     74    sldIM_flat6 = Parameter(0); 
     75    sldIM_flat7 = Parameter(0); 
     76    sldIM_flat8 = Parameter(0); 
     77    sldIM_flat9 = Parameter(0); 
     78    sldIM_flat10 = Parameter(0); 
     79 
     80    sldIM_sub0 = Parameter(0); 
     81    sldIM_medium = Parameter(0); 
    6982} 
    7083 
     
    7588 */ 
    7689double ReflModel :: operator()(double q) { 
    77         double dp[47]; 
     90        double dp[59]; 
    7891        // Fill parameter array for IGOR library 
    7992        // Add the background after averaging 
     
    130143        dp[46] = func_inter10(); 
    131144 
     145        dp[47] = sldIM_flat1(); 
     146        dp[48] = sldIM_flat2(); 
     147        dp[49] = sldIM_flat3(); 
     148        dp[50] = sldIM_flat4(); 
     149        dp[51] = sldIM_flat5(); 
     150        dp[52] = sldIM_flat6(); 
     151        dp[53] = sldIM_flat7(); 
     152        dp[54] = sldIM_flat8(); 
     153        dp[55] = sldIM_flat9(); 
     154        dp[56] = sldIM_flat10(); 
     155 
     156        dp[57] = sldIM_sub0(); 
     157        dp[58] = sldIM_medium(); 
     158 
    132159        // Get the dispersion points for the radius 
    133160        //vector<WeightPoint> weights_thick; 
Note: See TracChangeset for help on using the changeset viewer.