Changeset 3275c13 in sasview for sansmodels/src


Ignore:
Timestamp:
Mar 31, 2009 5:52:28 PM (16 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:
be28027
Parents:
db1dcef
Message:

Added 2nd virial coeff. functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/libigor/libStructureFactor.c

    r87b0d78 r3275c13  
    77#include "StandardHeaders.h"                    // Include ANSI headers, Mac headers, IgorXOP.h, XOP.h and XOPSupport.h 
    88#include "libStructureFactor.h" 
    9  
    10  
    119//Hard Sphere Structure Factor 
    1210// 
     
    650648} 
    651649 
    652 // called as DiamCyl(hcyl,rcyl) 
     650// called as DiamCyl(hcyl,rcyl)  
     651//modified from Igor NIST package XOP 
    653652double 
    654 DiamCyl(double hcyl, double rcyl) 
     653DiamCyl(double dp[], double q) 
    655654{ 
    656          
     655        double hcyl, rcyl; 
    657656        double diam,a,b,t1,t2,ddd; 
    658657        double pi; 
    659658         
     659        rcyl = dp[0]; 
     660        hcyl = dp[1]; 
    660661        pi = 4.0*atan(1.0); 
    661          
     662        if (rcyl == 0 || hcyl == 0) { 
     663                return 0.0; 
     664        } 
    662665        a = rcyl; 
    663666        b = hcyl/2.0; 
     
    667670        diam = pow(ddd,(1.0/3.0)); 
    668671         
    669         return(diam); 
     672        return(diam/2);  //return radius 
    670673} 
    671674 
     
    677680//returns DIAMETER 
    678681// called as DiamEllip(aa,bb) 
     682 
     683//modified from Igor NIST package XOP 
    679684double 
    680 DiamEllip(double aa, double bb) 
     685DiamEllip(double dp[], double q) 
    681686{ 
    682          
     687        double aa, bb; 
    683688        double ee,e1,bd,b1,bL,b2,del,ddd,diam; 
    684689         
     690        aa = dp[0]; 
     691        bb = dp[1]; 
     692        if (aa == 0 || bb == 0) { 
     693                return 0.0; 
     694        } 
     695        if (aa == bb) { 
     696                return aa; 
     697        } 
    685698        if(aa>bb) { 
    686699                ee = (aa*aa - bb*bb)/(aa*aa); 
     
    699712        diam = pow(ddd,(1.0/3.0)); 
    700713         
    701         return(diam); 
     714        return(diam/2);      //return radius 
    702715} 
    703716 
Note: See TracChangeset for help on using the changeset viewer.