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; |
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 |
|
|
467 |
|
// used for the exclude list: |
468 |
|
|
469 |
|
#ifdef IS_MPI |
470 |
< |
exI = info[k].atoms[tempI]->getGlobalIndex() + 1; |
471 |
< |
exJ = info[k].atoms[tempJ]->getGlobalIndex() + 1; |
470 |
> |
exI = molInfo.myAtoms[tempI]->getGlobalIndex() + 1; |
471 |
> |
exJ = molInfo.myAtoms[tempJ]->getGlobalIndex() + 1; |
472 |
|
#else |
473 |
< |
exI = tempI + 1; |
474 |
< |
exJ = tempJ + 1; |
473 |
> |
exI = molInfo.myAtoms[tempI]->getIndex() + 1; |
474 |
> |
exJ = molInfo.myAtoms[tempJ]->getIndex() + 1; |
475 |
|
#endif |
476 |
|
|
477 |
|
info[k].excludes->addPair(exI, exJ); |
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 |
|
|
563 |
|
sprintf(checkPointMsg, "all molecules initialized succesfully"); |
564 |
|
MPIcheckPoint(); |
565 |
|
#endif // is_mpi |
538 |
– |
|
539 |
– |
// clean up the forcefield |
540 |
– |
|
541 |
– |
if (!globals->haveLJrcut()){ |
542 |
– |
|
543 |
– |
the_ff->calcRcut(); |
544 |
– |
|
545 |
– |
} else { |
546 |
– |
|
547 |
– |
the_ff->setRcut( globals->getLJrcut() ); |
548 |
– |
} |
566 |
|
|
550 |
– |
the_ff->cleanMe(); |
567 |
|
} |
568 |
|
|
569 |
|
void SimSetup::initFromBass(void){ |
850 |
|
} |
851 |
|
|
852 |
|
//check whether sample time, status time, thermal time and reset time are divisble by dt |
853 |
< |
if (!isDivisible(globals->getSampleTime(), globals->getDt())){ |
853 |
> |
if (globals->haveSampleTime() && !isDivisible(globals->getSampleTime(), globals->getDt())){ |
854 |
|
sprintf(painCave.errMsg, |
855 |
|
"Sample time is not divisible by dt.\n" |
856 |
|
"\tThis will result in samples that are not uniformly\n" |
860 |
|
simError(); |
861 |
|
} |
862 |
|
|
863 |
< |
if (globals->haveStatusTime() && !isDivisible(globals->getSampleTime(), globals->getDt())){ |
863 |
> |
if (globals->haveStatusTime() && !isDivisible(globals->getStatusTime(), globals->getDt())){ |
864 |
|
sprintf(painCave.errMsg, |
865 |
|
"Status time is not divisible by dt.\n" |
866 |
|
"\tThis will result in status reports that are not uniformly\n" |
896 |
|
if (globals->haveSampleTime()){ |
897 |
|
info[i].sampleTime = globals->getSampleTime(); |
898 |
|
info[i].statusTime = info[i].sampleTime; |
883 |
– |
info[i].thermalTime = info[i].sampleTime; |
899 |
|
} |
900 |
|
else{ |
901 |
|
info[i].sampleTime = globals->getRunTime(); |
902 |
|
info[i].statusTime = info[i].sampleTime; |
888 |
– |
info[i].thermalTime = info[i].sampleTime; |
903 |
|
} |
904 |
|
|
905 |
|
if (globals->haveStatusTime()){ |
908 |
|
|
909 |
|
if (globals->haveThermalTime()){ |
910 |
|
info[i].thermalTime = globals->getThermalTime(); |
911 |
+ |
} else { |
912 |
+ |
info[i].thermalTime = globals->getRunTime(); |
913 |
|
} |
914 |
|
|
915 |
|
info[i].resetIntegrator = 0; |
1003 |
|
MPI_Allreduce(&myUse, &usesDipoles, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
1004 |
|
#endif //is_mpi |
1005 |
|
|
1006 |
< |
double theEcr, theEst; |
991 |
< |
|
992 |
< |
if (globals->getUseRF()){ |
993 |
< |
info[i].useReactionField = 1; |
1006 |
> |
double theRcut, theRsw; |
1007 |
|
|
1008 |
< |
if (!globals->haveECR()){ |
1009 |
< |
sprintf(painCave.errMsg, |
1010 |
< |
"SimSetup Warning: No value was set for electrostaticCutoffRadius.\n" |
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->haveRcut()){ |
1035 |
> |
sprintf(painCave.errMsg, |
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()){ |
1047 |
> |
if (!globals->haveRsw()){ |
1048 |
|
sprintf(painCave.errMsg, |
1049 |
< |
"SimSetup Warning: No value was set for electrostaticSkinThickness.\n" |
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, |
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 |
|
} |
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){ |
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 |
|
|
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"); |
1416 |
|
int localMol, allMol; |
1417 |
|
int local_atoms, local_bonds, local_bends, local_torsions, local_SRI; |
1418 |
|
int local_rigid; |
1368 |
– |
vector<int> globalAtomIndex; |
1419 |
|
vector<int> globalMolIndex; |
1420 |
|
|
1421 |
|
mpiSim = new mpiSimulation(info); |
1422 |
|
|
1423 |
|
mpiSim->divideLabor(); |
1424 |
|
globalAtomIndex = mpiSim->getGlobalAtomIndex(); |
1425 |
< |
globalMolIndex = mpiSim->getGlobalMolIndex(); |
1425 |
> |
//globalMolIndex = mpiSim->getGlobalMolIndex(); |
1426 |
|
|
1427 |
|
// set up the local variables |
1428 |
|
|
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 |
|
} |