--- trunk/OOPSE/shapes/forcer.cpp 2004/05/21 15:58:48 1183 +++ trunk/OOPSE/shapes/forcer.cpp 2004/05/21 18:34:52 1184 @@ -43,8 +43,14 @@ int main(int argc, char* argv[]){ int main(int argc, char* argv[]){ gengetopt_args_info args_info; - vector vdwAtypes; - vector::iterator iter; + + vector vdwAtypes; + vector::iterator i; + Atype* at; + vector theAtoms; + vector::iterator j; + VDWAtom* atom; + double mass, rpar, eps; string fileName; char vdwFileName[2002]; @@ -56,11 +62,12 @@ int main(int argc, char* argv[]){ char* ffPath; char* eof_test; char* foo; + char* myType; + char* vType; int lineNum; int nTokens; - Atype* at; int FF; - vector theAtoms; + short int gotMatch; //parse the command line options if (cmdline_parser (argc, argv, &args_info) != 0) @@ -177,7 +184,49 @@ int main(int argc, char* argv[]){ PDBread->setPDBfile(structureFileName); theAtoms = PDBread->getAtomList(); printf("Found %d atoms\n", theAtoms.size()); - + + for( j = theAtoms.begin(); j != theAtoms.end(); ++j){ + atom = *j; + myType = atom->getType(); + gotMatch = 0; + + for( i = vdwAtypes.begin(); i != vdwAtypes.end(); ++i){ + at = *i; + vType = at->getType(); + + if (!strcasecmp(myType, vType)) { + atom->setMass(at->getMass()); + atom->setRpar(at->getRpar()); + atom->setEps(at->getEps()); + gotMatch = 1; + } + } + if (!gotMatch) { + printf("No matches found for %s, ", myType); + myType = atom->getBase(); + printf("trying with BaseType %s\n", myType); + for( i = vdwAtypes.begin(); i != vdwAtypes.end(); ++i){ + at = *i; + vType = at->getType(); + if (!strcasecmp(myType, vType)) { + atom->setMass(at->getMass()); + atom->setRpar(at->getRpar()); + atom->setEps(at->getEps()); + gotMatch = 1; + } + } + } + + if (!gotMatch) { + printf("No matches found with BaseType!\n"); + } + } + + //GridBuilder gb = new GridBuilder(); + //gb->findAxesAndOrigin(theAtoms); + //gb->launchProbe(FF, sigmaGrid, sGrid, epsGrid); + + } int count_tokens(char *line, char *delimiters) {