--- trunk/src/applications/randomBuilder/randomBuilder.cpp 2006/04/25 22:59:27 950 +++ trunk/src/applications/randomBuilder/randomBuilder.cpp 2006/10/09 22:16:44 1061 @@ -42,7 +42,7 @@ * * Created by Charles F. Vardeman II on 10 Apr 2006. * @author Charles F. Vardeman II - * @version $Id: randomBuilder.cpp,v 1.1 2006-04-25 22:59:27 chuckv Exp $ + * @version $Id: randomBuilder.cpp,v 1.3 2006-10-09 22:16:44 gezelter Exp $ * */ @@ -86,14 +86,13 @@ int main(int argc, char *argv []) { std::string inputFileName; std::string outPrefix; std::string outMdFileName; - std::string outInitFileName; Lattice *simpleLat; int* numMol; - double latticeConstant; - std::vector lc; - double mass; - const double rhoConvertConst = 1.661; - double density; + RealType latticeConstant; + std::vector lc; + RealType mass; + const RealType rhoConvertConst = 1.661; + RealType density; int nx, ny, nz; @@ -160,7 +159,7 @@ int main(int argc, char *argv []) { Globals* simParams = oldInfo->getSimParams(); int nComponents =simParams->getNComponents(); - if (oldInfo->getNMoleculeStamp()>= 2) { + if (oldInfo->getNMoleculeStamp() > 2) { std::cerr << "can not build the system with more than two components" << std::endl; exit(1); @@ -182,7 +181,7 @@ int main(int argc, char *argv []) { //calculate lattice constant (in Angstrom) latticeConstant = pow(rhoConvertConst * numMolPerCell * mass / density, - 1.0 / 3.0); + (RealType)(1.0 / 3.0)); //set lattice constant lc.push_back(latticeConstant); @@ -217,7 +216,7 @@ int main(int argc, char *argv []) { } int totComponents = 0; for (int i = 0;igetMoleculeStamp(0), NewInfo->getForceField()); + locator = new MoLocator(newInfo->getMoleculeStamp(0), newInfo->getForceField()); Molecule* mol; SimInfo::MoleculeIterator mi; - mol = NewInfo->beginMolecule(mi); + mol = newInfo->beginMolecule(mi); int l = 0; - for (mol = NewInfo->beginMolecule(mi); mol != NULL; mol = NewInfo->nextMolecule(mi)) { + for (mol = newInfo->beginMolecule(mi); mol != NULL; mol = newInfo->nextMolecule(mi)) { locator->placeMol(latticeSites[l], latticeOrt[l], mol); l++; } - - //create dumpwriter and write out the coordinates - oldInfo->setFinalConfigFileName(outInitFileName); - writer = new DumpWriter(oldInfo); + newInfo->setFinalConfigFileName(outMdFileName); + writer = new DumpWriter(newInfo); if (writer == NULL) { std::cerr << "error in creating DumpWriter" << std::endl; exit(1); } - writer->writeDump(); - std::cout << "new initial configuration file: " << outInitFileName - << " is generated." << std::endl; - - //delete objects - - //delete oldInfo and oldSimSetup - if (oldInfo != NULL) - delete oldInfo; - - if (writer != NULL) - delete writer; - - delete simpleLat; - + writer->writeEor(); + std::cout << "new OOPSE MD file: " << outMdFileName + << " has been generated." << std::endl; return 0; }