--- trunk/OOPSE/libmdtools/SimSetup.cpp 2004/04/14 15:37:41 1108 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2004/04/15 16:18:26 1113 @@ -147,13 +147,6 @@ void SimSetup::createSim(void){ // make the output filenames makeOutNames(); - - if (globals->haveMinimizer()) - // make minimizer - makeMinimizer(); - else - // make the integrator - makeIntegrator(); #ifdef IS_MPI mpiSim->mpiRefresh(); @@ -162,6 +155,14 @@ void SimSetup::createSim(void){ // initialize the Fortran initFortran(); + + if (globals->haveMinimizer()) + // make minimizer + makeMinimizer(); + else + // make the integrator + makeIntegrator(); + } @@ -262,10 +263,10 @@ void SimSetup::makeMolecules(void){ else{ molInfo.myAtoms[j] = new Atom((j + atomOffset), info[k].getConfiguration()); + } molInfo.myAtoms[j]->setType(currentAtom->getType()); - #ifdef IS_MPI molInfo.myAtoms[j]->setGlobalIndex(globalAtomIndex[j + atomOffset]); @@ -409,6 +410,9 @@ void SimSetup::makeMolecules(void){ info[k].excludes->addPair(exK, exL); } + + molInfo.myRigidBodies.clear(); + for (j = 0; j < molInfo.nRigidBodies; j++){ currentRigidBody = comp_stamps[stampID]->getRigidBody(j); @@ -418,7 +422,7 @@ void SimSetup::makeMolecules(void){ myRB = new RigidBody(); - sprintf(rbName,"%s_RB_%s", molName, j); + sprintf(rbName,"%s_RB_%d", molName, j); myRB->setType(rbName); for (rb1 = 0; rb1 < nMembers; rb1++) { @@ -479,6 +483,9 @@ void SimSetup::makeMolecules(void){ // After this is all set up, scan through the atoms to // see if they can be added to the integrableObjects: + + molInfo.myIntegrableObjects.clear(); + for (j = 0; j < molInfo.nAtoms; j++){ @@ -957,6 +964,7 @@ void SimSetup::finalInfoCheck(void){ void SimSetup::finalInfoCheck(void){ int index; int usesDipoles; + int usesCharges; int i; for (i = 0; i < nInfo; i++){ @@ -968,7 +976,12 @@ void SimSetup::finalInfoCheck(void){ usesDipoles = (info[i].atoms[index])->hasDipole(); index++; } - + index = 0; + usesCharges = 0; + while ((index < info[i].n_atoms) && !usesCharges){ + usesCharges= (info[i].atoms[index])->hasCharge(); + index++; + } #ifdef IS_MPI int myUse = usesDipoles; MPI_Allreduce(&myUse, &usesDipoles, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); @@ -1019,7 +1032,7 @@ void SimSetup::finalInfoCheck(void){ info[i].dielectric = globals->getDielectric(); } else{ - if (usesDipoles){ + if (usesDipoles || usesCharges){ if (!globals->haveECR()){ sprintf(painCave.errMsg, "SimSetup Warning: No value was set for electrostaticCutoffRadius.\n"