Changeset 770bab1 in sasview for sansmodels/src/sans/models
- Timestamp:
- Feb 8, 2011 6:19:43 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:
- 8240eab
- Parents:
- e369627
- Location:
- sansmodels/src/sans/models/c_models
- Files:
-
- 8 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/DiamCyl.cpp
rf9bf661 r770bab1 88 88 */ 89 89 double DiamCylFunc :: operator()(double qx, double qy) { 90 DiamCyldParameters dp; 91 // Fill parameter array 92 dp.radius = radius(); 93 dp.length = length(); 94 95 // Get the dispersion points for the radius 96 vector<WeightPoint> weights_rad; 97 radius.get_weights(weights_rad); 98 99 // Get the dispersion points for the length 100 vector<WeightPoint> weights_len; 101 length.get_weights(weights_len); 102 103 104 // Perform the computation, with all weight points 105 double sum = 0.0; 106 double norm = 0.0; 107 108 // Loop over radius weight points 109 for(int i=0; i<weights_rad.size(); i++) { 110 dp.radius = weights_rad[i].value; 111 112 // Loop over length weight points 113 for(int j=0; j<weights_len.size(); j++) { 114 dp.length = weights_len[j].value; 115 double _ptvalue = weights_rad[i].weight 116 * weights_len[j].weight 117 * DiamCyld_analytical_2DXY(&dp, qx, qy); 118 sum += _ptvalue; 119 120 norm += weights_rad[i].weight 121 * weights_len[j].weight; 122 123 124 } 125 } 126 return sum/norm; 90 double q = sqrt(qx*qx + qy*qy); 91 return (*this).operator()(q); 127 92 } 128 93 -
sansmodels/src/sans/models/c_models/DiamEllip.cpp
rf9bf661 r770bab1 18 18 * sansmodels/src/libigor 19 19 * 20 * TODO: refactor so that we pull in the old sansmodels.c_extensions21 20 */ 22 21 … … 87 86 */ 88 87 double DiamEllipFunc :: operator()(double qx, double qy) { 89 DiamEllipsParameters dp; 90 // Fill parameter array 91 dp.radius_a = radius_a(); 92 dp.radius_b = radius_b(); 93 94 // Get the dispersion points for the radius a 95 vector<WeightPoint> weights_rad_a; 96 radius_a.get_weights(weights_rad_a); 97 98 // Get the dispersion points for the radius b 99 vector<WeightPoint> weights_rad_b; 100 radius_b.get_weights(weights_rad_b); 101 102 103 // Perform the computation, with all weight points 104 double sum = 0.0; 105 double norm = 0.0; 106 107 // Loop over radius weight points 108 for(int i=0; i<weights_rad_a.size(); i++) { 109 dp.radius_a = weights_rad_a[i].value; 110 // Loop over length weight points 111 for(int j=0; j<weights_rad_b.size(); j++) { 112 dp.radius_b = weights_rad_b[j].value; 113 114 double _ptvalue = weights_rad_a[i].weight 115 *weights_rad_b[j].weight* DiamEllips_analytical_2DXY(&dp, qx, qy); 116 sum += _ptvalue; 117 118 norm += weights_rad_a[i].weight*weights_rad_b[j].weight; 119 } 120 } 121 // Averaging in theta needs an extra normalization 122 // factor to account for the sin(theta) term in the 123 // integration (see documentation). 124 return sum/norm; 88 double q = sqrt(qx*qx + qy*qy); 89 return (*this).operator()(q); 125 90 } 126 127 91 /** 128 92 * Function to evaluate 2D scattering function -
sansmodels/src/sans/models/c_models/Hardsphere.cpp
rf9bf661 r770bab1 79 79 */ 80 80 double HardsphereStructure :: operator()(double qx, double qy) { 81 HardsphereParameters dp; 82 // Fill parameter array 83 dp.effect_radius = effect_radius(); 84 dp.volfraction = volfraction(); 85 86 // Get the dispersion points for the radius 87 vector<WeightPoint> weights_rad; 88 effect_radius.get_weights(weights_rad); 89 90 // Perform the computation, with all weight points 91 double sum = 0.0; 92 double norm = 0.0; 93 94 // Loop over radius weight points 95 for(int i=0; i<weights_rad.size(); i++) { 96 dp.effect_radius = weights_rad[i].value; 97 98 double _ptvalue = weights_rad[i].weight 99 * Hardsphere_analytical_2DXY(&dp, qx, qy); 100 sum += _ptvalue; 101 102 norm += weights_rad[i].weight; 103 } 104 // Averaging in theta needs an extra normalization 105 // factor to account for the sin(theta) term in the 106 // integration (see documentation). 107 return sum/norm; 81 double q = sqrt(qx*qx + qy*qy); 82 return (*this).operator()(q); 108 83 } 109 84 -
sansmodels/src/sans/models/c_models/HayterMSA.cpp
rc724ccd r770bab1 88 88 */ 89 89 double HayterMSAStructure :: operator()(double qx, double qy) { 90 HayterMSAParameters dp; 91 // Fill parameter array 92 dp.effect_radius = effect_radius(); 93 dp.charge = charge(); 94 dp.volfraction = volfraction(); 95 dp.temperature = temperature(); 96 dp.saltconc = saltconc(); 97 dp.dielectconst = dielectconst(); 98 99 // Get the dispersion points for the radius 100 vector<WeightPoint> weights_rad; 101 effect_radius.get_weights(weights_rad); 102 103 // Perform the computation, with all weight points 104 double sum = 0.0; 105 double norm = 0.0; 106 107 // Loop over radius weight points 108 for(int i=0; i<weights_rad.size(); i++) { 109 dp.effect_radius = weights_rad[i].value; 110 111 double _ptvalue = weights_rad[i].weight 112 * HayterMSA_analytical_2DXY(&dp, qx, qy); 113 sum += _ptvalue; 114 115 norm += weights_rad[i].weight; 116 } 117 // Averaging in theta needs an extra normalization 118 // factor to account for the sin(theta) term in the 119 // integration (see documentation). 120 return sum/norm; 90 double q = sqrt(qx*qx + qy*qy); 91 return (*this).operator()(q); 121 92 } 122 93 -
sansmodels/src/sans/models/c_models/SquareWell.cpp
rf9bf661 r770bab1 83 83 */ 84 84 double SquareWellStructure :: operator()(double qx, double qy) { 85 SquareWellParameters dp; 86 // Fill parameter array 87 dp.effect_radius = effect_radius(); 88 dp.volfraction = volfraction(); 89 dp.welldepth = welldepth(); 90 dp.wellwidth = wellwidth(); 91 92 // Get the dispersion points for the radius 93 vector<WeightPoint> weights_rad; 94 effect_radius.get_weights(weights_rad); 95 96 // Perform the computation, with all weight points 97 double sum = 0.0; 98 double norm = 0.0; 99 100 // Loop over radius weight points 101 for(int i=0; i<weights_rad.size(); i++) { 102 dp.effect_radius = weights_rad[i].value; 103 104 double _ptvalue = weights_rad[i].weight 105 * SquareWell_analytical_2DXY(&dp, qx, qy); 106 sum += _ptvalue; 107 108 norm += weights_rad[i].weight; 109 } 110 // Averaging in theta needs an extra normalization 111 // factor to account for the sin(theta) term in the 112 // integration (see documentation). 113 return sum/norm; 85 double q = sqrt(qx*qx + qy*qy); 86 return (*this).operator()(q); 114 87 } 115 88 -
sansmodels/src/sans/models/c_models/StickyHS.cpp
rf9bf661 r770bab1 85 85 */ 86 86 double StickyHSStructure :: operator()(double qx, double qy) { 87 StickyHSParameters dp; 88 // Fill parameter array 89 dp.effect_radius = effect_radius(); 90 dp.volfraction = volfraction(); 91 dp.perturb = perturb(); 92 dp.stickiness = stickiness(); 93 94 // Get the dispersion points for the radius 95 vector<WeightPoint> weights_rad; 96 effect_radius.get_weights(weights_rad); 97 98 // Perform the computation, with all weight points 99 double sum = 0.0; 100 double norm = 0.0; 101 102 // Loop over radius weight points 103 for(int i=0; i<weights_rad.size(); i++) { 104 dp.effect_radius = weights_rad[i].value; 105 106 double _ptvalue = weights_rad[i].weight 107 * StickyHS_analytical_2DXY(&dp, qx, qy); 108 sum += _ptvalue; 109 110 norm += weights_rad[i].weight; 111 } 112 // Averaging in theta needs an extra normalization 113 // factor to account for the sin(theta) term in the 114 // integration (see documentation). 115 return sum/norm; 87 double q = sqrt(qx*qx + qy*qy); 88 return (*this).operator()(q); 116 89 } 117 90 -
sansmodels/src/sans/models/c_models/c_models.cpp
r8dc02d8b r770bab1 290 290 addCMultiShellModel(m); 291 291 addCBinaryHSModel(m); 292 addDisperser(m);293 addCGaussian(m);294 addCSchulz(m);295 addCLogNormal(m);296 addCLorentzian(m);292 //addDisperser(m); 293 //addCGaussian(m); 294 //addCSchulz(m); 295 //addCLogNormal(m); 296 //addCLorentzian(m); 297 297 addCVesicleModel(m); 298 298 addCPoly_GaussCoil(m);
Note: See TracChangeset
for help on using the changeset viewer.