Changeset 5eb9154 in sasview for sansmodels/src/sans/models/c_models/vesicle.cpp
- Timestamp:
- Aug 31, 2009 5:25:44 PM (15 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:
- 5be36bb
- Parents:
- 572beba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/vesicle.cpp
re2afadf r5eb9154 28 28 extern "C" { 29 29 #include "libSphere.h" 30 #include "vesicle.h" 30 31 } 31 32 … … 105 106 return (*this).operator()(q); 106 107 } 108 /** 109 * Function to calculate effective radius 110 * @param pars: parameters of the sphere 111 * @return: effective radius value 112 */ 113 double VesicleModel :: calculate_ER() { 114 VesicleParameters dp; 115 116 dp.radius = radius(); 117 dp.thickness = thickness(); 118 119 double rad_out = 0.0; 120 121 // Perform the computation, with all weight points 122 double sum = 0.0; 123 double norm = 0.0; 124 125 126 // Get the dispersion points for the major shell 127 vector<WeightPoint> weights_thickness; 128 thickness.get_weights(weights_thickness); 129 130 // Get the dispersion points for the minor shell 131 vector<WeightPoint> weights_radius ; 132 radius.get_weights(weights_radius); 133 134 // Loop over major shell weight points 135 for(int j=0; j< (int)weights_thickness.size(); j++) { 136 dp.thickness = weights_thickness[j].value; 137 for(int k=0; k< (int)weights_radius.size(); k++) { 138 dp.radius = weights_radius[k].value; 139 sum += weights_thickness[j].weight 140 * weights_radius[k].weight*(dp.radius+dp.thickness); 141 norm += weights_thickness[j].weight* weights_radius[k].weight; 142 } 143 } 144 if (norm != 0){ 145 //return the averaged value 146 rad_out = sum/norm;} 147 else{ 148 //return normal value 149 rad_out = (dp.radius+dp.thickness);} 150 151 return rad_out; 152 }
Note: See TracChangeset
for help on using the changeset viewer.