ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimSetup.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/SimSetup.cpp (file contents):
Revision 1129 by tim, Thu Apr 22 03:29:30 2004 UTC vs.
Revision 1163 by gezelter, Wed May 12 14:30:12 2004 UTC

# Line 183 | Line 183 | void SimSetup::makeMolecules(void){
183    BendStamp* currentBend;
184    TorsionStamp* currentTorsion;
185    RigidBodyStamp* currentRigidBody;
186 <
186 >  CutoffGroupStamp* currentCutoffGroup;
187 >  CutoffGroup* myCutoffGroup;
188 >  
189    bond_pair* theBonds;
190    bend_set* theBends;
191    torsion_set* theTorsions;
# Line 216 | Line 218 | void SimSetup::makeMolecules(void){
218        molInfo.nBends = comp_stamps[stampID]->getNBends();
219        molInfo.nTorsions = comp_stamps[stampID]->getNTorsions();
220        molInfo.nRigidBodies = comp_stamps[stampID]->getNRigidBodies();
221 +      molInfo.nCutoffGroups = comp_stamps[stampID]->getNCutoffGroups();
222        
223        molInfo.myAtoms = &(info[k].atoms[atomOffset]);
224  
# Line 479 | Line 482 | void SimSetup::makeMolecules(void){
482          molInfo.myRigidBodies.push_back(myRB);
483          info[k].rigidBodies.push_back(myRB);
484        }
485 +      
486 +
487 +      //create cutoff group for molecule
488 +      molInfo.myCutoffGroups.clear();
489 +      for (j = 0; j < molInfo.nCutoffGroups; j++){
490 +
491 +        currentCutoffGroup = comp_stamps[stampID]->getCutoffGroup(j);
492 +        nMembers = currentCutoffGroup->getNMembers();
493 +
494 +        myCutoffGroup = new CutoffGroup();
495 +        
496 +        for (int cg = 0; cg < nMembers; cg++) {
497 +
498 +          // molI is atom numbering inside this molecule
499 +          molI = currentCutoffGroup->getMember(cg);    
500 +
501 +          // tempI is atom numbering on local processor
502 +          tempI = molI + atomOffset;
503 +
504 +          myCutoffGroup->addAtom(info[k].atoms[tempI]);          
505 +        }
506 +
507 +        molInfo.myCutoffGroups.push_back(myCutoffGroup);
508 +      }//end for (j = 0; j < molInfo.nCutoffGroups; j++)
509        
510  
511 +
512        // After this is all set up, scan through the atoms to
513        // see if they can be added to the integrableObjects:
514  
# Line 535 | Line 563 | void SimSetup::makeMolecules(void){
563    sprintf(checkPointMsg, "all molecules initialized succesfully");
564    MPIcheckPoint();
565   #endif // is_mpi
538
539  // clean up the forcefield
540
541  if (!globals->haveLJrcut()){
566  
543    the_ff->calcRcut();
544
545  } else {
546    
547    the_ff->setRcut( globals->getLJrcut() );
548  }
549
550  the_ff->cleanMe();
567   }
568  
569   void SimSetup::initFromBass(void){
# Line 987 | Line 1003 | void SimSetup::finalInfoCheck(void){
1003      MPI_Allreduce(&myUse, &usesDipoles, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
1004   #endif //is_mpi
1005  
1006 <    double theEcr, theEst;
1006 >    double theRcut, theRsw;
1007  
1008 +    if (globals->haveRcut()) {
1009 +      theRcut = globals->getRcut();
1010 +
1011 +      if (globals->haveRsw())
1012 +        theRsw = globals->getRsw();
1013 +      else
1014 +        theRsw = theRcut;
1015 +      
1016 +      info[i].setDefaultRcut(theRcut, theRsw);
1017 +
1018 +    } else {
1019 +      
1020 +      the_ff->calcRcut();
1021 +      theRcut = info[i].getRcut();
1022 +
1023 +      if (globals->haveRsw())
1024 +        theRsw = globals->getRsw();
1025 +      else
1026 +        theRsw = theRcut;
1027 +      
1028 +      info[i].setDefaultRcut(theRcut, theRsw);
1029 +    }
1030 +
1031      if (globals->getUseRF()){
1032        info[i].useReactionField = 1;
1033 <
1034 <      if (!globals->haveECR()){
1033 >      
1034 >      if (!globals->haveRcut()){
1035          sprintf(painCave.errMsg,
1036 <                "SimSetup Warning: No value was set for electrostaticCutoffRadius.\n"
1036 >                "SimSetup Warning: No value was set for the cutoffRadius.\n"
1037                  "\tOOPSE will use a default value of 15.0 angstroms"
1038 <                "\tfor the electrostaticCutoffRadius.\n");
1038 >                "\tfor the cutoffRadius.\n");
1039          painCave.isFatal = 0;
1040          simError();
1041 <        theEcr = 15.0;
1041 >        theRcut = 15.0;
1042        }
1043        else{
1044 <        theEcr = globals->getECR();
1044 >        theRcut = globals->getRcut();
1045        }
1046  
1047 <      if (!globals->haveEST()){
1048 <        sprintf(painCave.errMsg,
1049 <                "SimSetup Warning: No value was set for electrostaticSkinThickness.\n"
1047 >      if (!globals->haveRsw()){
1048 >        sprintf(painCave.errMsg,
1049 >                "SimSetup Warning: No value was set for switchingRadius.\n"
1050                  "\tOOPSE will use a default value of\n"
1051 <                "\t0.05 * electrostaticCutoffRadius\n"
1013 <                "\tfor the electrostaticSkinThickness\n");
1051 >                "\t0.95 * cutoffRadius for the switchingRadius\n");
1052          painCave.isFatal = 0;
1053          simError();
1054 <        theEst = 0.05 * theEcr;
1054 >        theRsw = 0.95 * theRcut;
1055        }
1056        else{
1057 <        theEst = globals->getEST();
1057 >        theRsw = globals->getRsw();
1058        }
1059  
1060 <      info[i].setDefaultEcr(theEcr, theEst);
1060 >      info[i].setDefaultRcut(theRcut, theRsw);
1061  
1062        if (!globals->haveDielectric()){
1063          sprintf(painCave.errMsg,
# Line 1033 | Line 1071 | void SimSetup::finalInfoCheck(void){
1071      }
1072      else{
1073        if (usesDipoles || usesCharges){
1074 <        if (!globals->haveECR()){
1074 >
1075 >        if (!globals->haveRcut()){
1076            sprintf(painCave.errMsg,
1077 <                  "SimSetup Warning: No value was set for electrostaticCutoffRadius.\n"
1077 >                  "SimSetup Warning: No value was set for the cutoffRadius.\n"
1078                    "\tOOPSE will use a default value of 15.0 angstroms"
1079 <                  "\tfor the electrostaticCutoffRadius.\n");
1080 <          painCave.isFatal = 0;
1081 <          simError();
1082 <          theEcr = 15.0;
1083 <        }
1079 >                  "\tfor the cutoffRadius.\n");
1080 >          painCave.isFatal = 0;
1081 >          simError();
1082 >          theRcut = 15.0;
1083 >      }
1084          else{
1085 <          theEcr = globals->getECR();
1085 >          theRcut = globals->getRcut();
1086          }
1087 <        
1088 <        if (!globals->haveEST()){
1089 <          sprintf(painCave.errMsg,
1090 <                  "SimSetup Warning: No value was set for electrostaticSkinThickness.\n"
1087 >        
1088 >        if (!globals->haveRsw()){
1089 >          sprintf(painCave.errMsg,
1090 >                  "SimSetup Warning: No value was set for switchingRadius.\n"
1091                    "\tOOPSE will use a default value of\n"
1092 <                  "\t0.05 * electrostaticCutoffRadius\n"
1054 <                  "\tfor the electrostaticSkinThickness\n");
1092 >                  "\t0.95 * cutoffRadius for the switchingRadius\n");
1093            painCave.isFatal = 0;
1094            simError();
1095 <          theEst = 0.05 * theEcr;
1095 >          theRsw = 0.95 * theRcut;
1096          }
1097          else{
1098 <          theEst = globals->getEST();
1098 >          theRsw = globals->getRsw();
1099          }
1100 +        
1101 +        info[i].setDefaultRcut(theRcut, theRsw);
1102          
1063        info[i].setDefaultEcr(theEcr, theEst);
1103        }
1104      }
1105    }
# Line 1068 | Line 1107 | void SimSetup::finalInfoCheck(void){
1107    strcpy(checkPointMsg, "post processing checks out");
1108    MPIcheckPoint();
1109   #endif // is_mpi
1110 +
1111 +  // clean up the forcefield
1112 +  the_ff->cleanMe();
1113   }
1114    
1115   void SimSetup::initSystemCoords(void){
# Line 1282 | Line 1324 | void SimSetup::compList(void){
1324    LinkedMolStamp* headStamp = new LinkedMolStamp();
1325    LinkedMolStamp* currentStamp = NULL;
1326    comp_stamps = new MoleculeStamp * [n_components];
1327 +  bool haveCutoffGroups;
1328  
1329 +  haveCutoffGroups = false;
1330 +  
1331    // make an array of molecule stamps that match the components used.
1332    // also extract the used stamps out into a separate linked list
1333  
# Line 1317 | Line 1362 | void SimSetup::compList(void){
1362        headStamp->add(currentStamp);
1363        comp_stamps[i] = headStamp->match(id);
1364      }
1365 +
1366 +    if(comp_stamps[i]->getNCutoffGroups() > 0)
1367 +      haveCutoffGroups = true;    
1368    }
1369 +    
1370 +  for (i = 0; i < nInfo; i++)
1371 +    info[i].haveCutoffGroups = haveCutoffGroups;
1372  
1373   #ifdef IS_MPI
1374    strcpy(checkPointMsg, "Component stamps successfully extracted\n");
# Line 1492 | Line 1543 | void SimSetup::makeSysArrays(void){
1543      info[l].atoms = the_atoms;
1544      info[l].molecules = the_molecules;
1545      info[l].nGlobalExcludes = 0;
1546 <
1546 >    
1547      the_ff->setSimInfo(info);
1548    }
1549   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines