Changeset 940aca7 in sasview for sansmodels/src/libigor
- Timestamp:
- May 19, 2012 12:17:02 PM (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:
- baa915c
- Parents:
- d225e32
- Location:
- sansmodels/src/libigor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/libigor/libStructureFactor.c
r67424cd r940aca7 7 7 #include "StandardHeaders.h" // Include ANSI headers, Mac headers, IgorXOP.h, XOP.h and XOPSupport.h 8 8 #include "libStructureFactor.h" 9 10 static double gMSAWave[17]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};11 9 12 10 //Hard Sphere Structure Factor … … 177 175 HayterPenfoldMSA(double dp[], double q) 178 176 { 177 double gMSAWave[17]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}; 179 178 double Elcharge=1.602189e-19; // electron charge in Coulombs (C) 180 179 double kB=1.380662e-23; // Boltzman constant in J/K … … 231 230 232 231 ierr=0; 233 ierr=sqcoef(ierr );232 ierr=sqcoef(ierr, gMSAWave); 234 233 if (ierr>=0) { 235 SofQ=sqhcal(Qdiam );234 SofQ=sqhcal(Qdiam, gMSAWave); 236 235 }else{ 237 236 //SofQ=NaN; … … 269 268 // 270 269 int 271 sqcoef(int ir )270 sqcoef(int ir, double gMSAWave[]) 272 271 { 273 272 int itm=40,ix,ig,ii; 274 273 double acc=5.0E-6,del,e1,e2,f1,f2; 275 274 276 275 // WAVE gMSAWave = $"root:HayPenMSA:gMSAWave" 277 276 f1=0; //these were never properly initialized... … … 284 283 gMSAWave[16]=gMSAWave[4]; 285 284 ix=1; 286 ir = sqfun(ix,ir );285 ir = sqfun(ix,ir,gMSAWave); 287 286 gMSAWave[14]=gMSAWave[15]; 288 287 gMSAWave[4]=gMSAWave[16]; … … 310 309 gMSAWave[16]=e1; 311 310 ix=2; 312 ir = sqfun(ix,ir );311 ir = sqfun(ix,ir,gMSAWave); 313 312 f1=gMSAWave[15]; 314 313 e1=gMSAWave[16]; … … 317 316 gMSAWave[16]=e2; 318 317 ix=2; 319 ir = sqfun(ix,ir );318 ir = sqfun(ix,ir,gMSAWave); 320 319 f2=gMSAWave[15]; 321 320 e2=gMSAWave[16]; … … 327 326 gMSAWave[16]=e2; 328 327 ix=4; 329 ir = sqfun(ix,ir );328 ir = sqfun(ix,ir,gMSAWave); 330 329 gMSAWave[14]=gMSAWave[15]; 331 330 e2=gMSAWave[16]; … … 338 337 gMSAWave[16]=gMSAWave[4]; 339 338 ix=3; 340 ir = sqfun(ix,ir );339 ir = sqfun(ix,ir,gMSAWave); 341 340 gMSAWave[14]=gMSAWave[15]; 342 341 gMSAWave[4]=gMSAWave[16]; … … 349 348 350 349 int 351 sqfun(int ix, int ir )350 sqfun(int ix, int ir, double gMSAWave[]) 352 351 { 353 352 double acc=1.0e-6; … … 712 711 713 712 double 714 sqhcal(double qq )713 sqhcal(double qq, double gMSAWave[]) 715 714 { 716 715 double SofQ,etaz,akz,gekz,e24,x1,x2,ck,sk,ak2,qk,q2k,qk2,qk3,qqk,sink,cosk,asink,qcosk,aqk,inter; 717 716 // WAVE gMSAWave = $"root:HayPenMSA:gMSAWave" 718 717 719 718 etaz = gMSAWave[10]; 720 719 akz = gMSAWave[12]; -
sansmodels/src/libigor/libStructureFactor.h
r67424cd r940aca7 10 10 11 11 //function prototypes 12 double sqhcal(double qq );13 int sqfun(int ix, int ir );14 int sqcoef(int ir );12 double sqhcal(double qq, double gMSAWave[]); 13 int sqfun(int ix, int ir, double gMSAWave[]); 14 int sqcoef(int ir, double gMSAWave[]);
Note: See TracChangeset
for help on using the changeset viewer.