234 |
|
|
235 |
|
SimInfo* SimCreator::createSim(const std::string & mdFileName, |
236 |
|
bool loadInitCoords) { |
237 |
< |
|
237 |
> |
|
238 |
|
const int bufferSize = 65535; |
239 |
|
char buffer[bufferSize]; |
240 |
|
int lineNo = 0; |
369 |
|
} |
370 |
|
|
371 |
|
ff->parse(forcefieldFileName); |
372 |
– |
ff->setFortranForceOptions(); |
372 |
|
//create SimInfo |
373 |
|
SimInfo * info = new SimInfo(ff, simParams); |
374 |
|
|
386 |
|
//create the molecules |
387 |
|
createMolecules(info); |
388 |
|
|
390 |
– |
|
389 |
|
//allocate memory for DataStorage(circular reference, need to |
390 |
|
//break it) |
391 |
|
info->setSnapshotManager(new SimSnapshotManager(info)); |
411 |
|
|
412 |
|
if (loadInitCoords) |
413 |
|
loadCoordinates(info, mdFileName); |
416 |
– |
|
414 |
|
return info; |
415 |
|
} |
416 |
|
|
718 |
|
|
719 |
|
} |
720 |
|
} |
721 |
< |
|
721 |
> |
|
722 |
|
#ifdef IS_MPI |
723 |
|
// Since the globalGroupMembership has been zero filled and we've only |
724 |
|
// poked values into the atoms we know, we can do an Allreduce |
795 |
|
|
796 |
|
void SimCreator::loadCoordinates(SimInfo* info, const std::string& mdFileName) { |
797 |
|
Globals* simParams; |
798 |
+ |
|
799 |
|
simParams = info->getSimParams(); |
800 |
|
|
803 |
– |
|
801 |
|
DumpReader reader(info, mdFileName); |
802 |
|
int nframes = reader.getNFrames(); |
803 |
< |
|
803 |
> |
|
804 |
|
if (nframes > 0) { |
805 |
|
reader.readFrame(nframes - 1); |
806 |
|
} else { |
811 |
|
painCave.isFatal = 1; |
812 |
|
simError(); |
813 |
|
} |
817 |
– |
|
814 |
|
//copy the current snapshot to previous snapshot |
815 |
|
info->getSnapshotManager()->advance(); |
816 |
|
} |