Changeset e08bd5b in sasview
- Timestamp:
- Feb 29, 2012 8:48:08 AM (13 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:
- 2d6f1f1
- Parents:
- 6319646
- Location:
- sansmodels/src
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/c_models/DiamCyl.cpp
r0ba3b08 re08bd5b 110 110 return 0.0; 111 111 } 112 double DiamCylFunc :: calculate_VR() { 113 return 1.0; 114 } -
sansmodels/src/c_models/DiamEllip.cpp
r0ba3b08 re08bd5b 108 108 return 0.0; 109 109 } 110 double DiamEllipFunc :: calculate_VR() { 111 return 1.0; 112 } -
sansmodels/src/c_models/Hardsphere.cpp
r101065a re08bd5b 101 101 return 0.0; 102 102 } 103 double HardsphereStructure :: calculate_VR() { 104 return 1.0; 105 } -
sansmodels/src/c_models/HayterMSA.cpp
r0ba3b08 re08bd5b 111 111 return 0.0; 112 112 } 113 double HayterMSAStructure :: calculate_VR() { 114 return 1.0; 115 } -
sansmodels/src/c_models/SquareWell.cpp
r0ba3b08 re08bd5b 105 105 return 0.0; 106 106 } 107 double SquareWellStructure :: calculate_VR() { 108 return 1.0; 109 } -
sansmodels/src/c_models/StickyHS.cpp
r0ba3b08 re08bd5b 108 108 return 0.0; 109 109 } 110 double StickyHSStructure :: calculate_VR() { 111 return 1.0; 112 } -
sansmodels/src/c_models/barbell.cpp
ref93acb re08bd5b 346 346 return 0.0; 347 347 } 348 /** 349 * Function to calculate volf_ratio for shell/tot 350 * @return: volf_ratio value 351 */ 352 double BarBellModel :: calculate_VR() { 353 return 1.0; 354 } -
sansmodels/src/c_models/bcc.cpp
r0ba3b08 re08bd5b 330 330 return 0.0; 331 331 } 332 double BCCrystalModel :: calculate_VR() { 333 return 1.0; 334 } -
sansmodels/src/c_models/binaryHS.cpp
r82c11d3 re08bd5b 123 123 return 0.0; 124 124 } 125 125 double BinaryHSModel :: calculate_VR() { 126 return 1.0; 127 } -
sansmodels/src/c_models/binaryHS_PSF11.cpp
r82c11d3 re08bd5b 48 48 double operator()(double qx , double qy); 49 49 double calculate_ER(); 50 double calculate_VR(); 50 51 double evaluate_rphi(double q, double phi); 51 52 }; … … 143 144 return 0.0; 144 145 } 146 double BinaryHSPSF11Model :: calculate_VR() { 147 return 1.0; 148 } -
sansmodels/src/c_models/capcyl.cpp
r0c2389e re08bd5b 403 403 return 0.0; 404 404 } 405 double CappedCylinderModel :: calculate_VR() { 406 return 1.0; 407 } -
sansmodels/src/c_models/corefourshell.cpp
r011e0e4 re08bd5b 253 253 return rad_out; 254 254 } 255 double CoreFourShellModel :: calculate_VR() { 256 return 1.0; 257 } -
sansmodels/src/c_models/coresecondmoment.cpp
r7289627 re08bd5b 129 129 return 0.0; 130 130 } 131 double Core2ndMomentModel :: calculate_VR() { 132 return 1.0; 133 } -
sansmodels/src/c_models/coreshellbicelle.cpp
r543d1bd re08bd5b 428 428 return rad_out; 429 429 } 430 double CoreShellBicelleModel :: calculate_VR() { 431 return 1.0; 432 } -
sansmodels/src/c_models/coreshellcylinder.cpp
r82c11d3 re08bd5b 387 387 return rad_out; 388 388 } 389 double CoreShellCylinderModel :: calculate_VR() { 390 return 1.0; 391 } -
sansmodels/src/c_models/coreshellsphere.cpp
r011e0e4 re08bd5b 177 177 return rad_out; 178 178 } 179 double CoreShellModel :: calculate_VR() { 180 return 1.0; 181 } -
sansmodels/src/c_models/csparallelepiped.cpp
rc637521 re08bd5b 552 552 553 553 } 554 double CSParallelepipedModel :: calculate_VR() { 555 return 1.0; 556 } -
sansmodels/src/c_models/cylinder.cpp
r0c2389e re08bd5b 339 339 return rad_out; 340 340 } 341 double CylinderModel :: calculate_VR() { 342 return 1.0; 343 } -
sansmodels/src/c_models/ellipsoid.cpp
r82c11d3 re08bd5b 340 340 return rad_out; 341 341 } 342 double EllipsoidModel :: calculate_VR() { 343 return 1.0; 344 } -
sansmodels/src/c_models/ellipticalcylinder.cpp
r82c11d3 re08bd5b 459 459 return rad_out; 460 460 } 461 double EllipticalCylinderModel :: calculate_VR() { 462 return 1.0; 463 } -
sansmodels/src/c_models/fcc.cpp
r0ba3b08 re08bd5b 325 325 return 0.0; 326 326 } 327 double FCCrystalModel :: calculate_VR() { 328 return 1.0; 329 } -
sansmodels/src/c_models/flexcyl_ellipX.cpp
r82c11d3 re08bd5b 212 212 return rad_out; 213 213 } 214 double FlexCylEllipXModel :: calculate_VR() { 215 return 1.0; 216 } -
sansmodels/src/c_models/flexiblecylinder.cpp
r82c11d3 re08bd5b 191 191 return rad_out; 192 192 } 193 double FlexibleCylinderModel :: calculate_VR() { 194 return 1.0; 195 } -
sansmodels/src/c_models/fractal.cpp
r82c11d3 re08bd5b 119 119 return 0.0; 120 120 } 121 double FractalModel :: calculate_VR() { 122 return 1.0; 123 } -
sansmodels/src/c_models/fuzzysphere.cpp
r0ba3b08 re08bd5b 180 180 return rad_out; 181 181 } 182 double FuzzySphereModel :: calculate_VR() { 183 return 1.0; 184 } -
sansmodels/src/c_models/gaussian.cpp
r101065a re08bd5b 78 78 return 0.0; 79 79 } 80 double Gaussian :: calculate_VR() { 81 return 1.0; 82 } -
sansmodels/src/c_models/hollowcylinder.cpp
r82c11d3 re08bd5b 372 372 return rad_out; 373 373 } 374 /** 375 * Function to calculate volf_ratio for shell 376 * @return: volf_ratio value 377 */ 378 double HollowCylinderModel :: calculate_VR() { 379 HollowCylinderParameters dp; 380 dp.core_radius = core_radius(); 381 dp.radius = radius(); 382 dp.length = length(); 383 384 double rad_out = 0.0; 385 386 // Perform the computation, with all weight points 387 double sum_tot = 0.0; 388 double sum_shell = 0.0; 389 390 // Get the dispersion points for the major shell 391 vector<WeightPoint> weights_length; 392 length.get_weights(weights_length); 393 394 // Get the dispersion points for the minor shell 395 vector<WeightPoint> weights_radius ; 396 radius.get_weights(weights_radius); 397 398 // Get the dispersion points for the core radius 399 vector<WeightPoint> weights_core_radius; 400 core_radius.get_weights(weights_core_radius); 401 402 // Loop over major shell weight points 403 for(int i=0; i< (int)weights_length.size(); i++) { 404 dp.length = weights_length[i].value; 405 for(int k=0; k< (int)weights_radius.size(); k++) { 406 dp.radius = weights_radius[k].value; 407 for(int j=0; j<(int)weights_core_radius.size(); j++) { 408 dp.core_radius = weights_core_radius[j].value; 409 sum_tot +=weights_length[i].weight* weights_core_radius[j].weight 410 * weights_radius[k].weight*pow(dp.radius, 2); 411 sum_shell += weights_length[i].weight* weights_core_radius[j].weight 412 * weights_radius[k].weight*(pow(dp.radius, 2)-pow(dp.core_radius, 2)); 413 } 414 } 415 } 416 if (sum_tot == 0.0){ 417 //return the default value 418 rad_out = 1.0;} 419 else{ 420 //return ratio value 421 return sum_shell/sum_tot; 422 } 423 } -
sansmodels/src/c_models/lamellar.cpp
r82c11d3 re08bd5b 130 130 return 0.0; 131 131 } 132 double LamellarModel :: calculate_VR() { 133 return 1.0; 134 } -
sansmodels/src/c_models/lamellarFF_HG.cpp
r82c11d3 re08bd5b 119 119 return 0.0; 120 120 } 121 double LamellarFFHGModel :: calculate_VR() { 122 return 1.0; 123 } -
sansmodels/src/c_models/lamellarPC.cpp
r82c11d3 re08bd5b 119 119 return 0.0; 120 120 } 121 double LamellarPCrystalModel :: calculate_VR() { 122 return 1.0; 123 } -
sansmodels/src/c_models/lamellarPS.cpp
r82c11d3 re08bd5b 182 182 return 0.0; 183 183 } 184 184 double LamellarPSModel :: calculate_VR() { 185 return 1.0; 186 } -
sansmodels/src/c_models/lamellarPS_HG.cpp
r82c11d3 re08bd5b 135 135 return 0.0; 136 136 } 137 double LamellarPSHGModel :: calculate_VR() { 138 return 1.0; 139 } -
sansmodels/src/c_models/linearpearls.cpp
rd9547e7 re08bd5b 215 215 216 216 } 217 double LinearPearlsModel :: calculate_VR() { 218 return 1.0; 219 } -
sansmodels/src/c_models/logNormal.cpp
r101065a re08bd5b 78 78 return 0.0; 79 79 } 80 double LogNormal :: calculate_VR() { 81 return 1.0; 82 } -
sansmodels/src/c_models/lorentzian.cpp
r101065a re08bd5b 65 65 return 0.0; 66 66 } 67 double Lorentzian :: calculate_VR() { 68 return 1.0; 69 } -
sansmodels/src/c_models/massfractal.cpp
r08648c0 re08bd5b 125 125 return 0.0; 126 126 } 127 double MassFractalModel :: calculate_VR() { 128 return 1.0; 129 } -
sansmodels/src/c_models/masssurfacefractal.cpp
r08648c0 re08bd5b 65 65 return 0.0; 66 66 } 67 67 68 68 //computation 69 69 mass_dim /= 2.0; … … 156 156 return 0.0; 157 157 } 158 double MassSurfaceFractal :: calculate_VR() { 159 return 1.0; 160 } -
sansmodels/src/c_models/multishell.cpp
r82c11d3 re08bd5b 195 195 return rad_out; 196 196 } 197 double MultiShellModel :: calculate_VR() { 198 return 1.0; 199 } -
sansmodels/src/c_models/onion.cpp
rc637521 re08bd5b 664 664 return rad_out; 665 665 } 666 double OnionModel :: calculate_VR() { 667 return 1.0; 668 } -
sansmodels/src/c_models/parallelepiped.cpp
r82c11d3 re08bd5b 460 460 461 461 } 462 double ParallelepipedModel :: calculate_VR() { 463 return 1.0; 464 } -
sansmodels/src/c_models/pearlnecklace.cpp
r0ba3b08 re08bd5b 282 282 283 283 } 284 double PearlNecklaceModel :: calculate_VR() { 285 return 1.0; 286 } -
sansmodels/src/c_models/polygausscoil.cpp
r82c11d3 re08bd5b 140 140 return rad_out; 141 141 } 142 double Poly_GaussCoil :: calculate_VR() { 143 return 1.0; 144 } -
sansmodels/src/c_models/refl.cpp
r37805e9 re08bd5b 299 299 return 0.0; 300 300 } 301 double ReflModel :: calculate_VR() { 302 return 1.0; 303 } -
sansmodels/src/c_models/refl_adv.cpp
rdd60b45 re08bd5b 377 377 return 0.0; 378 378 } 379 double ReflAdvModel :: calculate_VR() { 380 return 1.0; 381 } -
sansmodels/src/c_models/rpa.cpp
r7ffa8196 re08bd5b 538 538 return 0.0; 539 539 } 540 double RPAModel :: calculate_VR() { 541 return 1.0; 542 } -
sansmodels/src/c_models/sc.cpp
r82c11d3 re08bd5b 327 327 return 0.0; 328 328 } 329 double SCCrystalModel :: calculate_VR() { 330 return 1.0; 331 } -
sansmodels/src/c_models/schulz.cpp
rcd127d2 re08bd5b 93 93 return 0.0; 94 94 } 95 double Schulz :: calculate_VR() { 96 return 1.0; 97 } -
sansmodels/src/c_models/sld_cal.cpp
r0ba3b08 re08bd5b 105 105 return 0.0; 106 106 } 107 double SLDCalFunc :: calculate_VR() { 108 return 1.0; 109 } -
sansmodels/src/c_models/sphere.cpp
r82c11d3 re08bd5b 136 136 return rad_out; 137 137 } 138 double SphereModel :: calculate_VR() { 139 return 1.0; 140 } -
sansmodels/src/c_models/spheresld.cpp
r37805e9 re08bd5b 630 630 631 631 } 632 double SphereSLDModel :: calculate_VR() { 633 return 1.0; 634 } -
sansmodels/src/c_models/spheroid.cpp
r82c11d3 re08bd5b 413 413 return rad_out; 414 414 } 415 double CoreShellEllipsoidModel :: calculate_VR() { 416 return 1.0; 417 } -
sansmodels/src/c_models/stackeddisks.cpp
r82c11d3 re08bd5b 390 390 return rad_out; 391 391 } 392 double StackedDisksModel :: calculate_VR() { 393 return 1.0; 394 } -
sansmodels/src/c_models/surfacefractal.cpp
r08648c0 re08bd5b 124 124 return 0.0; 125 125 } 126 double SurfaceFractalModel :: calculate_VR() { 127 return 1.0; 128 } -
sansmodels/src/c_models/triaxialellipsoid.cpp
r82c11d3 re08bd5b 441 441 return rad_out; 442 442 } 443 double TriaxialEllipsoidModel :: calculate_VR() { 444 return 1.0; 445 } -
sansmodels/src/c_models/vesicle.cpp
r82c11d3 re08bd5b 167 167 return rad_out; 168 168 } 169 /** 170 * Function to calculate volf_ratio for shell 171 * @return: volf_ratio value 172 */ 173 double VesicleModel :: calculate_VR() { 174 VesicleParameters dp; 175 176 dp.radius = radius(); 177 dp.thickness = thickness(); 178 179 double rad_out = 0.0; 180 181 // Perform the computation, with all weight points 182 double sum_tot = 0.0; 183 double sum_shell = 0.0; 184 185 186 // Get the dispersion points for the major shell 187 vector<WeightPoint> weights_thickness; 188 thickness.get_weights(weights_thickness); 189 190 // Get the dispersion points for the minor shell 191 vector<WeightPoint> weights_radius ; 192 radius.get_weights(weights_radius); 193 194 // Loop over major shell weight points 195 for(int j=0; j< (int)weights_thickness.size(); j++) { 196 dp.thickness = weights_thickness[j].value; 197 for(int k=0; k< (int)weights_radius.size(); k++) { 198 dp.radius = weights_radius[k].value; 199 sum_tot += weights_thickness[j].weight 200 * weights_radius[k].weight*pow((dp.radius+dp.thickness), 3); 201 sum_shell += weights_thickness[j].weight 202 * weights_radius[k].weight*(pow((dp.radius+dp.thickness), 3) 203 - pow((dp.radius), 3)); 204 } 205 } 206 if (sum_tot == 0.0){ 207 //return the default value 208 rad_out = 1.0;} 209 else{ 210 //return ratio value 211 return sum_shell/sum_tot; 212 } 213 } -
sansmodels/src/python_wrapper/classTemplate.txt
re63a411 re08bd5b 331 331 } 332 332 /** 333 * Function to call to cal the ratio shell volume/ total volume 334 * @return: the ratio shell volume/ total volume 335 */ 336 static PyObject * calculate_VR([PYTHONCLASS] *self) { 337 338 // Get parameters 339 340 [READDICTIONARY] 341 342 return Py_BuildValue("d",(*(self->model)).calculate_VR()); 343 344 } 345 /** 333 346 * Function to call to evaluate model in cartesian coordinates 334 347 * @param args: input q or [qx, qy]] … … 416 429 {"calculate_ER", (PyCFunction)calculate_ER , METH_VARARGS, 417 430 "Evaluate the model at a given Q or Q, phi"}, 418 431 {"calculate_VR", (PyCFunction)calculate_VR , METH_VARARGS, 432 "Evaluate VR"}, 419 433 {"evalDistribution", (PyCFunction)evalDistribution , METH_VARARGS, 420 434 "Evaluate the model at a given Q or Qx, Qy vector "}, -
sansmodels/src/python_wrapper/modelTemplate.txt
r67424cd re08bd5b 129 129 return [CPYTHONCLASS].calculate_ER(self) 130 130 131 def calculate_VR(self): 132 """ 133 Calculate the volf ratio for P(q)*S(q) 134 135 :return: the value of the volf ratio 136 137 """ 138 return [CPYTHONCLASS].calculate_VR(self) 139 131 140 def set_dispersion(self, parameter, dispersion): 132 141 """ -
sansmodels/src/sans/models/BaseComponent.py
r0145a25 re08bd5b 69 69 def runXY(self, x): return NotImplemented 70 70 def calculate_ER(self): return NotImplemented 71 def calculate_VR(self): return NotImplemented 71 72 def evalDistribution(self, qdist): 72 73 """ -
sansmodels/src/sans/models/MultiplicationModel.py
rccb7363 re08bd5b 157 157 value = self.params['volfraction'] 158 158 if value != None: 159 self.p_model.setParam( 'scale', value) 159 factor = self.p_model.calculate_VR() 160 val = factor * value 161 self.p_model.setParam( 'scale', val) 160 162 161 163
Note: See TracChangeset
for help on using the changeset viewer.