Changeset fbd09fa0 in sasview for sansmodels/src/sans/models
- Timestamp:
- Oct 12, 2010 6:33:14 PM (14 years ago)
- 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:
- 4cc8285c
- Parents:
- 20f00bed
- Location:
- sansmodels/src/sans/models/c_models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/COnionModel.cpp
r35aface rfbd09fa0 94 94 PyDict_SetItemString(self->params,"thick_shell9",Py_BuildValue("d",50.000000000000)); 95 95 PyDict_SetItemString(self->params,"thick_shell7",Py_BuildValue("d",50.000000000000)); 96 PyDict_SetItemString(self->params,"sld_core0",Py_BuildValue("d",0.000001000000)); 97 PyDict_SetItemString(self->params,"rad_core0",Py_BuildValue("d",200.000000000000)); 96 98 PyDict_SetItemString(self->params,"A_shell10",Py_BuildValue("d",1.000000000000)); 97 99 PyDict_SetItemString(self->params,"thick_shell1",Py_BuildValue("d",50.000000000000)); … … 103 105 PyDict_SetItemString(self->params,"thick_shell10",Py_BuildValue("d",50.000000000000)); 104 106 PyDict_SetItemString(self->params,"func_shell3",Py_BuildValue("d",2.000000000000)); 105 PyDict_SetItemString(self->params,"rad_core",Py_BuildValue("d",200.000000000000));106 PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",50.000000000000));107 107 PyDict_SetItemString(self->params,"func_shell8",Py_BuildValue("d",2.000000000000)); 108 108 PyDict_SetItemString(self->params,"func_shell9",Py_BuildValue("d",2.000000000000)); … … 118 118 PyDict_SetItemString(self->params,"sld_in_shell8",Py_BuildValue("d",0.000005200000)); 119 119 PyDict_SetItemString(self->params,"thick_shell2",Py_BuildValue("d",50.000000000000)); 120 PyDict_SetItemString(self->params," sld_core",Py_BuildValue("d",0.000001000000));120 PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",50.000000000000)); 121 121 PyDict_SetItemString(self->params,"sld_out_shell1",Py_BuildValue("d",0.000002000000)); 122 PyDict_SetItemString(self->params,"sld_ in_shell1",Py_BuildValue("d",0.000001700000));122 PyDict_SetItemString(self->params,"sld_out_shell5",Py_BuildValue("d",0.000004000000)); 123 123 PyDict_SetItemString(self->params,"sld_out_shell3",Py_BuildValue("d",0.000003000000)); 124 124 PyDict_SetItemString(self->params,"sld_in_shell6",Py_BuildValue("d",0.000004200000)); 125 PyDict_SetItemString(self->params,"sld_ out_shell5",Py_BuildValue("d",0.000004000000));125 PyDict_SetItemString(self->params,"sld_in_shell1",Py_BuildValue("d",0.000001700000)); 126 126 PyDict_SetItemString(self->params,"sld_out_shell4",Py_BuildValue("d",0.000003500000)); 127 127 PyDict_SetItemString(self->params,"sld_in_shell3",Py_BuildValue("d",0.000002700000)); … … 150 150 PyObject * disp_dict; 151 151 disp_dict = PyDict_New(); 152 self->model->rad_core .dispersion->accept_as_source(visitor, self->model->rad_core.dispersion, disp_dict);153 PyDict_SetItemString(self->dispersion, "rad_core ", disp_dict);152 self->model->rad_core0.dispersion->accept_as_source(visitor, self->model->rad_core0.dispersion, disp_dict); 153 PyDict_SetItemString(self->dispersion, "rad_core0", disp_dict); 154 154 disp_dict = PyDict_New(); 155 155 self->model->thick_shell1.dispersion->accept_as_source(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 315 315 self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") ); 316 316 self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") ); 317 self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 318 self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 317 319 self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") ); 318 320 self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") ); … … 324 326 self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") ); 325 327 self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") ); 326 self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") );327 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );328 328 self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") ); 329 329 self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") ); … … 339 339 self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") ); 340 340 self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 341 self->model-> sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );341 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 342 342 self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") ); 343 self->model->sld_ in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );343 self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") ); 344 344 self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") ); 345 345 self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") ); 346 self->model->sld_ out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );346 self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") ); 347 347 self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") ); 348 348 self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") ); … … 370 370 PyObject* disp_dict; 371 371 DispersionVisitor* visitor = new DispersionVisitor(); 372 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core ");373 self->model->rad_core .dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict);372 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 373 self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 374 374 disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 375 375 self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 458 458 self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") ); 459 459 self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") ); 460 self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 461 self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 460 462 self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") ); 461 463 self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") ); … … 467 469 self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") ); 468 470 self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") ); 469 self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") );470 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );471 471 self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") ); 472 472 self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") ); … … 482 482 self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") ); 483 483 self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 484 self->model-> sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );484 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 485 485 self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") ); 486 self->model->sld_ in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );486 self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") ); 487 487 self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") ); 488 488 self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") ); 489 self->model->sld_ out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );489 self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") ); 490 490 self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") ); 491 491 self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") ); … … 513 513 PyObject* disp_dict; 514 514 DispersionVisitor* visitor = new DispersionVisitor(); 515 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core ");516 self->model->rad_core .dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict);515 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 516 self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 517 517 disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 518 518 self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 588 588 self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") ); 589 589 self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") ); 590 self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 591 self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 590 592 self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") ); 591 593 self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") ); … … 597 599 self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") ); 598 600 self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") ); 599 self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") );600 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );601 601 self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") ); 602 602 self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") ); … … 612 612 self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") ); 613 613 self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 614 self->model-> sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );614 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 615 615 self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") ); 616 self->model->sld_ in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );616 self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") ); 617 617 self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") ); 618 618 self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") ); 619 self->model->sld_ out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );619 self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") ); 620 620 self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") ); 621 621 self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") ); … … 643 643 PyObject* disp_dict; 644 644 DispersionVisitor* visitor = new DispersionVisitor(); 645 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core ");646 self->model->rad_core .dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict);645 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 646 self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 647 647 disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 648 648 self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 687 687 self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") ); 688 688 self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") ); 689 self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 690 self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 689 691 self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") ); 690 692 self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") ); … … 696 698 self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") ); 697 699 self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") ); 698 self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") );699 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );700 700 self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") ); 701 701 self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") ); … … 711 711 self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") ); 712 712 self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 713 self->model-> sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );713 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 714 714 self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") ); 715 self->model->sld_ in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );715 self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") ); 716 716 self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") ); 717 717 self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") ); 718 self->model->sld_ out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );718 self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") ); 719 719 self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") ); 720 720 self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") ); … … 742 742 PyObject* disp_dict; 743 743 DispersionVisitor* visitor = new DispersionVisitor(); 744 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core ");745 self->model->rad_core .dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict);744 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 745 self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 746 746 disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 747 747 self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 819 819 // Ugliness necessary to go from python to C 820 820 // TODO: refactor this 821 if (!strcmp(par_name, "rad_core ")) {822 self->model->rad_core .dispersion = dispersion;821 if (!strcmp(par_name, "rad_core0")) { 822 self->model->rad_core0.dispersion = dispersion; 823 823 } else if (!strcmp(par_name, "thick_shell1")) { 824 824 self->model->thick_shell1.dispersion = dispersion; -
sansmodels/src/sans/models/c_models/c_models.cpp
raaad3098 rfbd09fa0 12 12 13 13 void addCCylinderModel(PyObject *module); 14 void addCBarBellModel(PyObject *module); 15 void addCCappedCylinderModel(PyObject *module); 14 16 void addCTriaxialEllipsoidModel(PyObject *module); 15 17 void addCParallelepipedModel(PyObject *module); … … 36 38 void addCLamellarPSModel(PyObject *module); 37 39 void addCLamellarPSHGModel(PyObject *module); 38 //void addCLamellarPCrystalModel(PyObject *module);40 void addCLamellarPCrystalModel(PyObject *module); 39 41 void addCCoreShellEllipsoidModel(PyObject *module); 40 42 void addCDiamEllipFunc(PyObject *module); … … 222 224 223 225 addCCylinderModel(m); 226 addCBarBellModel(m); 227 addCCappedCylinderModel(m); 224 228 addCParallelepipedModel(m); 225 229 addCCoreShellCylinderModel(m); … … 245 249 addCLamellarPSModel(m); 246 250 addCLamellarPSHGModel(m); 247 //addCLamellarPCrystalModel(m);251 addCLamellarPCrystalModel(m); 248 252 addCCoreShellEllipsoidModel(m); 249 253 addCDiamEllipFunc(m);
Note: See TracChangeset
for help on using the changeset viewer.