Changeset 186c4eb in sasview for sansmodels/src/sans/models


Ignore:
Timestamp:
Aug 2, 2010 5:46:04 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:
6ca38f3
Parents:
c4dd2fe
Message:

fixed a bug, not displaying polydispersion parameters for the triaxialellipsoid model

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

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_extensions/triaxial_ellipsoid.h

    r13eb1c4 r186c4eb  
    33/** Structure definition for cylinder parameters 
    44 * [PYTHONCLASS] = TriaxialEllipsoidModel 
    5  * [DISP_PARAMS] = axis_theta, axis_phi, axis_psi 
     5 * [DISP_PARAMS] = semi_axisA, semi_axisB, semi_axisC,axis_theta, axis_phi, axis_psi 
    66        [DESCRIPTION] = <text>Note: During fitting ensure that the inequality A<B<C is not 
    77        violated. Otherwise the calculation will 
  • sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp

    r13eb1c4 r186c4eb  
    103103        DispersionVisitor* visitor = new DispersionVisitor(); 
    104104        PyObject * disp_dict; 
     105        disp_dict = PyDict_New(); 
     106        self->model->semi_axisA.dispersion->accept_as_source(visitor, self->model->semi_axisA.dispersion, disp_dict); 
     107        PyDict_SetItemString(self->dispersion, "semi_axisA", disp_dict); 
     108        disp_dict = PyDict_New(); 
     109        self->model->semi_axisB.dispersion->accept_as_source(visitor, self->model->semi_axisB.dispersion, disp_dict); 
     110        PyDict_SetItemString(self->dispersion, "semi_axisB", disp_dict); 
     111        disp_dict = PyDict_New(); 
     112        self->model->semi_axisC.dispersion->accept_as_source(visitor, self->model->semi_axisC.dispersion, disp_dict); 
     113        PyDict_SetItemString(self->dispersion, "semi_axisC", disp_dict); 
    105114        disp_dict = PyDict_New(); 
    106115        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict); 
     
    254263    PyObject* disp_dict; 
    255264    DispersionVisitor* visitor = new DispersionVisitor(); 
     265    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA"); 
     266    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict); 
     267    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB"); 
     268    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict); 
     269    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC"); 
     270    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict); 
    256271    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta"); 
    257272    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict); 
     
    335350    PyObject* disp_dict; 
    336351    DispersionVisitor* visitor = new DispersionVisitor(); 
     352    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA"); 
     353    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict); 
     354    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB"); 
     355    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict); 
     356    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC"); 
     357    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict); 
    337358    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta"); 
    338359    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict); 
     
    403424    PyObject* disp_dict; 
    404425    DispersionVisitor* visitor = new DispersionVisitor(); 
     426    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA"); 
     427    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict); 
     428    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB"); 
     429    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict); 
     430    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC"); 
     431    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict); 
    405432    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta"); 
    406433    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict); 
     
    440467    PyObject* disp_dict; 
    441468    DispersionVisitor* visitor = new DispersionVisitor(); 
     469    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA"); 
     470    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict); 
     471    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB"); 
     472    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict); 
     473    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC"); 
     474    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict); 
    442475    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta"); 
    443476    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict); 
     
    501534        // Ugliness necessary to go from python to C 
    502535            // TODO: refactor this 
    503     if (!strcmp(par_name, "axis_theta")) { 
     536    if (!strcmp(par_name, "semi_axisA")) { 
     537        self->model->semi_axisA.dispersion = dispersion; 
     538    } else    if (!strcmp(par_name, "semi_axisB")) { 
     539        self->model->semi_axisB.dispersion = dispersion; 
     540    } else    if (!strcmp(par_name, "semi_axisC")) { 
     541        self->model->semi_axisC.dispersion = dispersion; 
     542    } else    if (!strcmp(par_name, "axis_theta")) { 
    504543        self->model->axis_theta.dispersion = dispersion; 
    505544    } else    if (!strcmp(par_name, "axis_phi")) { 
Note: See TracChangeset for help on using the changeset viewer.