--- trunk/OOPSE/libmdtools/SimSetup.cpp 2004/05/12 14:30:12 1163 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2004/05/20 20:24:07 1180 @@ -185,7 +185,9 @@ void SimSetup::makeMolecules(void){ RigidBodyStamp* currentRigidBody; CutoffGroupStamp* currentCutoffGroup; CutoffGroup* myCutoffGroup; - + int nCutoffGroups;// number of cutoff group of a molecule defined in mdl file + set cutoffAtomSet; //atoms belong to cutoffgroup defined at mdl file + bond_pair* theBonds; bend_set* theBends; torsion_set* theTorsions; @@ -218,22 +220,23 @@ void SimSetup::makeMolecules(void){ molInfo.nBends = comp_stamps[stampID]->getNBends(); molInfo.nTorsions = comp_stamps[stampID]->getNTorsions(); molInfo.nRigidBodies = comp_stamps[stampID]->getNRigidBodies(); - molInfo.nCutoffGroups = comp_stamps[stampID]->getNCutoffGroups(); + + nCutoffGroups = comp_stamps[stampID]->getNCutoffGroups(); molInfo.myAtoms = &(info[k].atoms[atomOffset]); if (molInfo.nBonds > 0) - molInfo.myBonds = new (Bond *) [molInfo.nBonds]; + molInfo.myBonds = new Bond*[molInfo.nBonds]; else molInfo.myBonds = NULL; if (molInfo.nBends > 0) - molInfo.myBends = new (Bend *) [molInfo.nBends]; + molInfo.myBends = new Bend*[molInfo.nBends]; else molInfo.myBends = NULL; if (molInfo.nTorsions > 0) - molInfo.myTorsions = new (Torsion *) [molInfo.nTorsions]; + molInfo.myTorsions = new Torsion *[molInfo.nTorsions]; else molInfo.myTorsions = NULL; @@ -485,8 +488,11 @@ void SimSetup::makeMolecules(void){ //create cutoff group for molecule + + cutoffAtomSet.clear(); molInfo.myCutoffGroups.clear(); - for (j = 0; j < molInfo.nCutoffGroups; j++){ + + for (j = 0; j < nCutoffGroups; j++){ currentCutoffGroup = comp_stamps[stampID]->getCutoffGroup(j); nMembers = currentCutoffGroup->getNMembers(); @@ -500,13 +506,28 @@ void SimSetup::makeMolecules(void){ // tempI is atom numbering on local processor tempI = molI + atomOffset; - + myCutoffGroup->addAtom(info[k].atoms[tempI]); + + cutoffAtomSet.insert(tempI); } molInfo.myCutoffGroups.push_back(myCutoffGroup); }//end for (j = 0; j < molInfo.nCutoffGroups; j++) - + + //creat a cutoff group for every atom in current molecule which does not belong to cutoffgroup defined at mdl file + + for(j = 0; j < molInfo.nAtoms; j++){ + + if(cutoffAtomSet.find(molInfo.myAtoms[j]->getIndex()) == cutoffAtomSet.end()){ + myCutoffGroup = new CutoffGroup(); + myCutoffGroup->addAtom(molInfo.myAtoms[j]); + molInfo.myCutoffGroups.push_back(myCutoffGroup); + } + + } + + // After this is all set up, scan through the atoms to @@ -927,7 +948,16 @@ void SimSetup::gatherInfo(void){ info[i].useInitXSstate = globals->getUseInitXSstate(); info[i].orthoTolerance = globals->getOrthoBoxTolerance(); - + + // check for thermodynamic integration + if (globals->haveThermIntLambda() && globals->haveThermIntK()) { + info[i].thermIntLambda = globals->getThermIntLambda(); + info[i].thermIntK = globals->getThermIntK(); + info[i].useThermInt = 1; + + Restraints *myRestraint = new Restraints(tot_nmol, info[i].thermIntLambda, info[i].thermIntK); + info[i].restraint = myRestraint; + } } //setup seed for random number generator @@ -1237,7 +1267,29 @@ void SimSetup::makeOutNames(void){ } else{ strcat(info[k].statusName, ".stat"); + } + } + + strcpy(info[k].rawPotName, inFileName); + nameLength = strlen(info[k].rawPotName); + endTest = &(info[k].rawPotName[nameLength - 5]); + if (!strcmp(endTest, ".bass")){ + strcpy(endTest, ".raw"); + } + else if (!strcmp(endTest, ".BASS")){ + strcpy(endTest, ".raw"); + } + else{ + endTest = &(info[k].rawPotName[nameLength - 4]); + if (!strcmp(endTest, ".bss")){ + strcpy(endTest, ".raw"); } + else if (!strcmp(endTest, ".mdl")){ + strcpy(endTest, ".raw"); + } + else{ + strcat(info[k].rawPotName, ".raw"); + } } #ifdef IS_MPI