--- trunk/src/brains/SimCreator.cpp 2005/03/11 17:50:11 436 +++ trunk/src/brains/SimCreator.cpp 2005/11/16 23:10:02 749 @@ -71,7 +71,6 @@ namespace oopse { if (worldRank == 0) { #endif // is_mpi - simParams->initalize(); set_interface_stamps(stamps, simParams); #ifdef IS_MPI @@ -96,7 +95,8 @@ namespace oopse { } - SimInfo* SimCreator::createSim(const std::string & mdFileName, bool loadInitCoords) { + SimInfo* SimCreator::createSim(const std::string & mdFileName, + bool loadInitCoords) { MakeStamps * stamps = new MakeStamps(); @@ -106,12 +106,13 @@ namespace oopse { parseFile(mdFileName, stamps, simParams); //create the force field - ForceField * ff = ForceFieldFactory::getInstance()->createForceField( - simParams->getForceField()); + ForceField * ff = ForceFieldFactory::getInstance() + ->createForceField(simParams->getForceField()); if (ff == NULL) { - sprintf(painCave.errMsg, "ForceField Factory can not create %s force field\n", - simParams->getForceField()); + sprintf(painCave.errMsg, + "ForceField Factory can not create %s force field\n", + simParams->getForceField().c_str()); painCave.isFatal = 1; simError(); } @@ -146,8 +147,8 @@ namespace oopse { compList(stamps, simParams, moleculeStampPairs); //create SimInfo - SimInfo * info = new SimInfo(moleculeStampPairs, ff, simParams); - + SimInfo * info = new SimInfo(stamps, moleculeStampPairs, ff, simParams); + //gather parameters (SimCreator only retrieves part of the parameters) gatherParameters(info, mdFileName); @@ -186,7 +187,7 @@ namespace oopse { void SimCreator::gatherParameters(SimInfo *info, const std::string& mdfile) { - //figure out the ouput file names + //figure out the output file names std::string prefix; #ifdef IS_MPI @@ -397,7 +398,6 @@ namespace oopse { std::vector < std::pair > &moleculeStampPairs) { int i; char * id; - LinkedMolStamp* extractedStamp = NULL; MoleculeStamp * currentStamp; Component** the_components = simParams->getComponents(); int n_components = simParams->getNComponents(); @@ -418,9 +418,9 @@ namespace oopse { } id = the_components[i]->getType(); - - extractedStamp = stamps->extractMolStamp(id); - if (extractedStamp == NULL) { + + currentStamp = stamps->getMolStamp(id); + if (currentStamp == NULL) { sprintf(painCave.errMsg, "SimCreator error: Component \"%s\" was not found in the " "list of declared molecules\n", id); @@ -429,9 +429,6 @@ namespace oopse { simError(); } - currentStamp = extractedStamp->getStamp(); - - moleculeStampPairs.push_back( std::make_pair(currentStamp, the_components[i]->getNMol())); } //end for (i = 0; i < n_components; i++) @@ -606,7 +603,7 @@ namespace oopse { //invalid initial coordinate file sprintf(painCave.errMsg, "Initial configuration file %s should at least contain one frame\n", - simParams->getInitialConfig()); + simParams->getInitialConfig().c_str()); painCave.isFatal = 1; simError(); }