--- trunk/tcProps/tcProps.c 2004/02/18 21:20:51 1058 +++ trunk/tcProps/tcProps.c 2004/02/28 16:45:57 1073 @@ -2,12 +2,16 @@ #include #include +#include #include "params.h" #include "tcProps.h" #include "readWrite.h" #include "scdCorr.h" +#include "directorHead.h" +#include "directorWhole.h" +#include "rmsd.h" #define VERSION_MAJOR 0 @@ -30,13 +34,12 @@ int main( int argC, char *argV[] ){ struct atomCoord atoms[nAtoms]; int i,j,k; - char* inName; - int nFrames; char* outPrefix; // the output prefix char currentFlag; // used in parsing the flags int done = 0; // multipurpose boolean int havePrefix; // boolean for the output prefix + int haveMaxLength; char* conversionCheck; int conversionError; int optionError; @@ -44,6 +47,9 @@ int main( int argC, char *argV[] ){ char* pair2; int scdCorr; double startTime; + double maxLength; + int directorHead, directorWhole, doRMSD; + enum atomNames rmsdType; // system initialization @@ -55,11 +61,15 @@ int main( int argC, char *argV[] ){ outPrefix = NULL; inName = NULL; + haveMaxLength = 0; conversionError = 0; optionError = 0; havePrefix = 0; scdCorr = 0; startTime = 0.0; + directorHead = 0; + directorWhole = 0; + doRMSD = 0; // parse the command line @@ -76,27 +86,31 @@ int main( int argC, char *argV[] ){ // parse long word options - if( !strcmp( argV[i], "--gofr" ) ){ + if( !strcmp( argV[i], "--rmsd" ) ){ + doRMSD = 1; i++; if( i>=argC ){ fprintf( stderr, "\n" - "not enough arguments for --gofr\n"); + "not enough arguments for --rmsd\n"); usage(); exit(0); } pair1 = argV[i]; - i++; - if( i>=argC ){ + if( !strcmp(pair1, "HEAD") ) rmsdType = HEAD; + else if( !strcmp(pair1, "CH") ) rmsdType = CH; + else if( !strcmp(pair1, "CH2") )rmsdType = CH2; + else if( !strcmp(pair1, "CH3") )rmsdType = CH3; + else if( !strcmp(pair1, "SSD") )rmsdType = SSD; + else if( !strcmp(pair1, "COM") )rmsdType = COM; + else{ fprintf( stderr, - "\n" - "not enough arguments for --gofr\n"); - usage(); + "Unrecognized rmsd atom type \"%s\"\n", + pair1 ); exit(0); - } - pair2 = argV[i]; + } } @@ -231,7 +245,7 @@ int main( int argC, char *argV[] ){ case 'l': // -l set to the maxLength - haveMaxLength = true; + haveMaxLength = 1; j++; currentFlag = argV[i][j]; @@ -292,15 +306,27 @@ int main( int argC, char *argV[] ){ break; case 's': - // -s turn on separate output files + // -s turn on Scd corr scdCorr = 1; + break; + + case 'h': + // -h turn on director head + + directorHead = 1; + break; + + case 'w': + // -h turn on director head + + directorWhole = 1; break; default: - sprintf(painCave.errMsg, + fprintf( stderr, "\n" "Bad option \"-%c\"\n", currentFlag); usage(); @@ -336,56 +362,80 @@ int main( int argC, char *argV[] ){ exit(0); } + if( outPrefix == NULL ) + outPrefix = inName; + // initialize the arrays for(i=0;i set the maximum value of r\n" " *Defaults to 1/2 smallest length of first frame.\n" " -s Calculate the Scd chain correlation.\n" + " -h Calculate the directors for the head groups\n" + " -w Calculate the director fro the bilayers\n" "\n" " long:\n" " -----\n" - " --gofr g(r) for atom1 and atom2\n" + " --rmsd rmsd for atom1\n" " --gofrTheta g(r, theta) for atom1 and atom2\n" " --gofrOmega g(r, omega) for atom1 and atom2\n" " --version displays the version number\n"