--- trunk/OOPSE/staticProps/staticProps.cpp 2003/10/10 17:10:22 803 +++ trunk/OOPSE/staticProps/staticProps.cpp 2004/02/09 20:38:38 1043 @@ -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++){ @@ -89,7 +96,7 @@ int main(int argC,char* argV[]){ // parse long word options if( !strcmp( argV[i], "--gofr" ) ){ - + i++; if( i>=argC ){ sprintf( painCave.errMsg, @@ -113,7 +120,66 @@ int main(int argC,char* argV[]){ pair2 = argV[i]; pairType = gofr; + theList.push_back(PairCorrList( pairType, pair1, pair2 )); + havePairCorrs = true; + } + + else 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; + } + + else 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") ){ @@ -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 @@ -369,14 +441,15 @@ int main(int argC,char* argV[]){ nFrames ); fflush(stdout); - infoArray = new SimInfo[nFrames]; + infoArray = new SimInfo; printf("Parsing the bass file, and initializing the " "Simulation Frames..." ); fflush(stdout); startMe = new SimSetup(); - startMe->setSimInfo( infoArray, nFrames ); + startMe->setSimInfo( infoArray ); + startMe->suspendInit(); startMe->parseFile( inName ); startMe->createSim(); @@ -394,7 +467,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 +502,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",