# | Line 156 | Line 156 | namespace oopse { | |
---|---|---|
156 | + nGlobalRigidBodies_; | |
157 | ||
158 | nGlobalMols_ = molStampIds_.size(); | |
159 | – | |
160 | – | #ifdef IS_MPI |
159 | molToProcMap_.resize(nGlobalMols_); | |
162 | – | #endif |
163 | – | |
160 | } | |
161 | ||
162 | SimInfo::~SimInfo() { | |
# | Line 860 | Line 856 | namespace oopse { | |
856 | int nGlobalExcludes = 0; | |
857 | int* globalExcludes = NULL; | |
858 | int* excludeList = exclude_.getExcludeList(); | |
859 | < | setFortranSim( &fInfo_, &nGlobalAtoms_, &nAtoms_, &identArray[0], &nExclude, excludeList , |
860 | < | &nGlobalExcludes, globalExcludes, &molMembershipArray[0], |
861 | < | &mfact[0], &nCutoffGroups_, &fortranGlobalGroupMembership[0], &isError); |
862 | < | |
859 | > | setFortranSim( &fInfo_, &nGlobalAtoms_, &nAtoms_, &identArray[0], |
860 | > | &nExclude, excludeList , &nGlobalExcludes, globalExcludes, |
861 | > | &molMembershipArray[0], &mfact[0], &nCutoffGroups_, |
862 | > | &fortranGlobalGroupMembership[0], &isError); |
863 | > | |
864 | if( isError ){ | |
865 | < | |
865 | > | |
866 | sprintf( painCave.errMsg, | |
867 | "There was an error setting the simulation information in fortran.\n" ); | |
868 | painCave.isFatal = 1; | |
869 | painCave.severity = OOPSE_ERROR; | |
870 | simError(); | |
871 | } | |
872 | < | |
873 | < | #ifdef IS_MPI |
872 | > | |
873 | > | |
874 | sprintf( checkPointMsg, | |
875 | "succesfully sent the simulation information to fortran.\n"); | |
876 | < | MPIcheckPoint(); |
877 | < | #endif // is_mpi |
878 | < | |
876 | > | |
877 | > | errorCheckPoint(); |
878 | > | |
879 | // Setup number of neighbors in neighbor list if present | |
880 | if (simParams_->haveNeighborListNeighbors()) { | |
881 | int nlistNeighbors = simParams_->getNeighborListNeighbors(); | |
# | Line 889 | Line 886 | namespace oopse { | |
886 | } | |
887 | ||
888 | ||
892 | – | #ifdef IS_MPI |
889 | void SimInfo::setupFortranParallel() { | |
890 | < | |
890 | > | #ifdef IS_MPI |
891 | //SimInfo is responsible for creating localToGlobalAtomIndex and localToGlobalGroupIndex | |
892 | std::vector<int> localToGlobalAtomIndex(getNAtoms(), 0); | |
893 | std::vector<int> localToGlobalCutoffGroupIndex; | |
# | Line 941 | Line 937 | namespace oopse { | |
937 | } | |
938 | ||
939 | sprintf(checkPointMsg, " mpiRefresh successful.\n"); | |
940 | < | MPIcheckPoint(); |
945 | < | |
946 | < | |
947 | < | } |
940 | > | errorCheckPoint(); |
941 | ||
942 | #endif | |
943 | + | } |
944 | ||
945 | void SimInfo::setupCutoff() { | |
946 | ||
# | Line 955 | Line 949 | namespace oopse { | |
949 | // Check the cutoff policy | |
950 | int cp = TRADITIONAL_CUTOFF_POLICY; // Set to traditional by default | |
951 | ||
952 | + | // Set LJ shifting bools to false |
953 | + | ljsp_ = false; |
954 | + | ljsf_ = false; |
955 | + | |
956 | std::string myPolicy; | |
957 | if (forceFieldOptions_.haveCutoffPolicy()){ | |
958 | myPolicy = forceFieldOptions_.getCutoffPolicy(); | |
# | Line 1018 | Line 1016 | namespace oopse { | |
1016 | simError(); | |
1017 | } | |
1018 | } | |
1019 | < | |
1020 | < | notifyFortranCutoffs(&rcut_, &rsw_); |
1019 | > | |
1020 | > | if (simParams_->haveElectrostaticSummationMethod()) { |
1021 | > | std::string myMethod = simParams_->getElectrostaticSummationMethod(); |
1022 | > | toUpper(myMethod); |
1023 | > | |
1024 | > | if (myMethod == "SHIFTED_POTENTIAL") { |
1025 | > | ljsp_ = true; |
1026 | > | } else if (myMethod == "SHIFTED_FORCE") { |
1027 | > | ljsf_ = true; |
1028 | > | } |
1029 | > | } |
1030 | > | notifyFortranCutoffs(&rcut_, &rsw_, &ljsp_, &ljsf_); |
1031 | ||
1032 | } else { | |
1033 | ||
# | Line 1036 | Line 1044 | namespace oopse { | |
1044 | if (simParams_->haveElectrostaticSummationMethod()) { | |
1045 | std::string myMethod = simParams_->getElectrostaticSummationMethod(); | |
1046 | toUpper(myMethod); | |
1047 | < | if (myMethod == "SHIFTED_POTENTIAL" || myMethod == "SHIFTED_FORCE") { |
1047 | > | |
1048 | > | // For the time being, we're tethering the LJ shifted behavior to the |
1049 | > | // electrostaticSummationMethod keyword options |
1050 | > | if (myMethod == "SHIFTED_POTENTIAL") { |
1051 | > | ljsp_ = true; |
1052 | > | } else if (myMethod == "SHIFTED_FORCE") { |
1053 | > | ljsf_ = true; |
1054 | > | } |
1055 | > | if (myMethod == "SHIFTED_POTENTIAL" || myMethod == "SHIFTED_FORCE") { |
1056 | if (simParams_->haveSwitchingRadius()){ | |
1057 | sprintf(painCave.errMsg, | |
1058 | "SimInfo Warning: A value was set for the switchingRadius\n" | |
# | Line 1059 | Line 1075 | namespace oopse { | |
1075 | simError(); | |
1076 | rsw_ = 0.85 * rcut_; | |
1077 | } | |
1078 | < | notifyFortranCutoffs(&rcut_, &rsw_); |
1078 | > | |
1079 | > | notifyFortranCutoffs(&rcut_, &rsw_, &ljsp_, &ljsf_); |
1080 | > | |
1081 | } else { | |
1082 | // We didn't set rcut explicitly, and we don't have electrostatic atoms, so | |
1083 | // We'll punt and let fortran figure out the cutoffs later. |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |