# | Line 96 | Line 96 | namespace oopse { | |
---|---|---|
96 | ||
97 | } | |
98 | ||
99 | < | SimInfo* SimCreator::createSim(const std::string & mdFileName, bool loadInitCoords) { |
99 | > | SimInfo* SimCreator::createSim(const std::string & mdFileName, |
100 | > | bool loadInitCoords) { |
101 | ||
102 | MakeStamps * stamps = new MakeStamps(); | |
103 | ||
# | Line 106 | Line 107 | namespace oopse { | |
107 | parseFile(mdFileName, stamps, simParams); | |
108 | ||
109 | //create the force field | |
110 | < | ForceField * ff = ForceFieldFactory::getInstance()->createForceField( |
111 | < | simParams->getForceField()); |
110 | > | ForceField * ff = ForceFieldFactory::getInstance() |
111 | > | ->createForceField(simParams->getForceField()); |
112 | ||
113 | if (ff == NULL) { | |
114 | < | sprintf(painCave.errMsg, "ForceField Factory can not create %s force field\n", |
114 | > | sprintf(painCave.errMsg, |
115 | > | "ForceField Factory can not create %s force field\n", |
116 | simParams->getForceField()); | |
117 | painCave.isFatal = 1; | |
118 | simError(); | |
# | Line 146 | Line 148 | namespace oopse { | |
148 | compList(stamps, simParams, moleculeStampPairs); | |
149 | ||
150 | //create SimInfo | |
151 | < | SimInfo * info = new SimInfo(moleculeStampPairs, ff, simParams); |
152 | < | |
151 | > | SimInfo * info = new SimInfo(stamps, moleculeStampPairs, ff, simParams); |
152 | > | |
153 | //gather parameters (SimCreator only retrieves part of the parameters) | |
154 | gatherParameters(info, mdFileName); | |
155 | ||
# | Line 178 | Line 180 | namespace oopse { | |
180 | info->addExcludePairs(mol); | |
181 | } | |
182 | ||
181 | – | |
182 | – | //load initial coordinates, some extra information are pushed into SimInfo's property map ( such as |
183 | – | //eta, chi for NPT integrator) |
183 | if (loadInitCoords) | |
184 | loadCoordinates(info); | |
185 | ||
# | Line 400 | Line 399 | namespace oopse { | |
399 | std::vector < std::pair<MoleculeStamp *, int> > &moleculeStampPairs) { | |
400 | int i; | |
401 | char * id; | |
403 | – | LinkedMolStamp* extractedStamp = NULL; |
402 | MoleculeStamp * currentStamp; | |
403 | Component** the_components = simParams->getComponents(); | |
404 | int n_components = simParams->getNComponents(); | |
# | Line 421 | Line 419 | namespace oopse { | |
419 | } | |
420 | ||
421 | id = the_components[i]->getType(); | |
422 | < | |
423 | < | extractedStamp = stamps->extractMolStamp(id); |
424 | < | if (extractedStamp == NULL) { |
422 | > | |
423 | > | currentStamp = stamps->getMolStamp(id); |
424 | > | if (currentStamp == NULL) { |
425 | sprintf(painCave.errMsg, | |
426 | "SimCreator error: Component \"%s\" was not found in the " | |
427 | "list of declared molecules\n", id); | |
# | Line 432 | Line 430 | namespace oopse { | |
430 | simError(); | |
431 | } | |
432 | ||
435 | – | currentStamp = extractedStamp->getStamp(); |
436 | – | |
437 | – | |
433 | moleculeStampPairs.push_back( | |
434 | std::make_pair(currentStamp, the_components[i]->getNMol())); | |
435 | } //end for (i = 0; i < n_components; i++) |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |