--- trunk/OOPSE/staticProps/staticProps.cpp 2003/10/10 17:10:22 803 +++ trunk/OOPSE/staticProps/staticProps.cpp 2003/12/19 15:12:23 885 @@ -39,6 +39,10 @@ int main(int argC,char* argV[]){ bool haveMaxLength; double maxLength; + bool separateOut; + bool havePairCorrs; + bool haveStaticCorrs; + int nBins; vector theList; @@ -59,8 +63,7 @@ int main(int argC,char* argV[]){ // first things first, all of the initializations - printf("Initializing stuff ....\n"); - fflush(sdtout); + fflush(stdout); srand48( 1337 ); // the random number generator. initSimError(); // the error handler @@ -72,11 +75,15 @@ int main(int argC,char* argV[]){ havePrefix = false; haveMaxLength = false; + + haveStaticCorrs = false; + havePairCorrs = false; + separateOut = false; maxLength = 1.0; nBins = 100; - programName = argv[0]; /*save the program name in case we need it*/ + programName = argV[0]; /*save the program name in case we need it*/ for( i = 1; i < argC; i++){ @@ -114,8 +121,67 @@ int main(int argC,char* argV[]){ pairType = gofr; theList.push_back(PairCorrList( pairType, pair1, pair2 )); + havePairCorrs = true; } + if( !strcmp( argV[i], "--gofrTheta" ) ){ + + i++; + if( i>=argC ){ + sprintf( painCave.errMsg, + "\n" + "not enough arguments for --gofrTheta\n"); + usage(); + painCave.isFatal = 1; + simError(); + } + pair1 = argV[i]; + + i++; + if( i>=argC ){ + sprintf( painCave.errMsg, + "\n" + "not enough arguments for --gofrTheta\n"); + usage(); + painCave.isFatal = 1; + simError(); + } + pair2 = argV[i]; + + pairType = gofrTheta; + theList.push_back(PairCorrList( pairType, pair1, pair2 )); + havePairCorrs = true; + } + + if( !strcmp( argV[i], "--gofrOmega" ) ){ + + i++; + if( i>=argC ){ + sprintf( painCave.errMsg, + "\n" + "not enough arguments for --gofrOmega\n"); + usage(); + painCave.isFatal = 1; + simError(); + } + pair1 = argV[i]; + + i++; + if( i>=argC ){ + sprintf( painCave.errMsg, + "\n" + "not enough arguments for --gofrOmega\n"); + usage(); + painCave.isFatal = 1; + simError(); + } + pair2 = argV[i]; + + pairType = gofrOmega; + theList.push_back(PairCorrList( pairType, pair1, pair2 )); + havePairCorrs = true; + } + else if( !strcmp( argV[i], "--version") ){ printf("\n" @@ -245,6 +311,12 @@ int main(int argC,char* argV[]){ break; + case 's': + // -s turn on separate output files + + separateOut = true; + break; + case 'n': // -n set to the nBins @@ -394,7 +466,8 @@ int main(int argC,char* argV[]){ theCorrs.setNbins( nBins ); theCorrs.setFrames( infoArray, nFrames, reader ); theCorrs.setPairCorrList( theList ); - theCorrs.initCorrelations( outPrefix ); + theCorrs.initCorrelations( outPrefix, separateOut, havePairCorrs, + haveStaticCorrs ); printf("done\n"); fflush(stdout); @@ -428,10 +501,14 @@ void usage(){ "\n" " long:\n" " -----\n" - " --gofr g(r) for atom1 and atom2\n" - " *note: \"_ALL_\" matches all atoms/n" - " --version displays the version number\n" - " --help displays this help message.\n" + " --gofr g(r) for atom1 and atom2\n" + " *note: \"_ALL_\" matches all atoms\n" + " --gofrTheta g(r, theta) for atom1 and atom2\n" + " *note: \"_ALL_\" matches all atoms\n" + " --gofrOmega g(r, omega) for atom1 and atom2\n" + " *note: \"_ALL_\" matches all atoms\n" + " --version displays the version number\n" + " --help displays this help message.\n" "\n" "\n",