Changeset 184912d in sasview


Ignore:
Timestamp:
Dec 4, 2014 7:42:02 AM (10 years ago)
Author:
pkienzle
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:
3d669e1
Parents:
70a9d1c
Message:

fix capped cylinder volume calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sans/models/c_extension/c_models/capcyl.cpp

    r5b1392f r184912d  
    242242 
    243243                                //Un-normalize SphereForm by volume 
    244                                 hDist = -1.0*sqrt(fabs(dp[3]*dp[3]-dp[1]*dp[1])); 
     244                                hDist = sqrt(fabs(dp[3]*dp[3]-dp[1]*dp[1])); 
    245245                                vol_i = pi*dp[1]*dp[1]*dp[2]+2.0*pi/3.0*((dp[3]-hDist)*(dp[3]-hDist)* 
    246                                                                 (2.0*(dp[3]+hDist))); 
     246                                                                (2.0*dp[3]+hDist)); 
    247247                                result =  CappedCylinder(dp, q) * vol_i; 
    248248                                // This FIXES a singualrity the kernel in libigor. 
     
    330330                                                dp.phi = weights_phi[m].value; 
    331331                                                //Un-normalize Form by volume 
    332                                                 hDist = -1.0*sqrt(fabs(dp.rad_cap*dp.rad_cap-dp.rad_cyl*dp.rad_cyl)); 
     332                                                hDist = sqrt(fabs(dp.rad_cap*dp.rad_cap-dp.rad_cyl*dp.rad_cyl)); 
    333333                                                vol_i = pi*dp.rad_cyl*dp.rad_cyl*dp.len_cyl+2.0*pi/3.0*((dp.rad_cap-hDist)*(dp.rad_cap-hDist)* 
    334334                                                                                (2*dp.rad_cap+hDist)); 
Note: See TracChangeset for help on using the changeset viewer.