65 |
|
AtomLocalToGlobal = info_->getGlobalAtomIndices(); |
66 |
|
cgLocalToGlobal = info_->getGlobalGroupIndices(); |
67 |
|
vector<int> globalGroupMembership = info_->getGlobalGroupMembership(); |
68 |
< |
vector<RealType> massFactorsLocal = info_->getMassFactors(); |
68 |
> |
massFactors = info_->getMassFactors(); |
69 |
|
PairList excludes = info_->getExcludedInteractions(); |
70 |
|
PairList oneTwo = info_->getOneTwoInteractions(); |
71 |
|
PairList oneThree = info_->getOneThreeInteractions(); |
117 |
|
cgCommIntRow->gather(cgLocalToGlobal, cgRowToGlobal); |
118 |
|
cgCommIntColumn->gather(cgLocalToGlobal, cgColToGlobal); |
119 |
|
|
120 |
< |
AtomCommRealRow->gather(massFactorsLocal, massFactorsRow); |
121 |
< |
AtomCommRealColumn->gather(massFactorsLocal, massFactorsCol); |
120 |
> |
AtomCommRealRow->gather(massFactors, massFactorsRow); |
121 |
> |
AtomCommRealColumn->gather(massFactors, massFactorsCol); |
122 |
|
|
123 |
|
groupListRow_.clear(); |
124 |
|
groupListRow_.resize(nGroupsInRow_); |
691 |
|
#ifdef IS_MPI |
692 |
|
return massFactorsRow[atom1]; |
693 |
|
#else |
694 |
< |
return massFactorsLocal[atom1]; |
694 |
> |
return massFactors[atom1]; |
695 |
|
#endif |
696 |
|
} |
697 |
|
|
699 |
|
#ifdef IS_MPI |
700 |
|
return massFactorsCol[atom2]; |
701 |
|
#else |
702 |
< |
return massFactorsLocal[atom2]; |
702 |
> |
return massFactors[atom2]; |
703 |
|
#endif |
704 |
|
|
705 |
|
} |
776 |
|
} |
777 |
|
|
778 |
|
// filling interaction blocks with pointers |
779 |
< |
InteractionData ForceMatrixDecomposition::fillInteractionData(int atom1, int atom2) { |
780 |
< |
InteractionData idat; |
781 |
< |
|
779 |
> |
void ForceMatrixDecomposition::fillInteractionData(InteractionData &idat, |
780 |
> |
int atom1, int atom2) { |
781 |
|
#ifdef IS_MPI |
782 |
|
|
783 |
|
idat.atypes = make_pair( ff_->getAtomType(identsRow[atom1]), |
784 |
|
ff_->getAtomType(identsCol[atom2]) ); |
786 |
– |
|
785 |
|
|
786 |
|
if (storageLayout_ & DataStorage::dslAmat) { |
787 |
|
idat.A1 = &(atomRowData.aMat[atom1]); |
859 |
|
} |
860 |
|
|
861 |
|
#endif |
864 |
– |
return idat; |
862 |
|
} |
863 |
|
|
864 |
|
|
865 |
< |
void ForceMatrixDecomposition::unpackInteractionData(InteractionData idat, int atom1, int atom2) { |
865 |
> |
void ForceMatrixDecomposition::unpackInteractionData(InteractionData &idat, int atom1, int atom2) { |
866 |
|
#ifdef IS_MPI |
867 |
|
pot_row[atom1] += 0.5 * *(idat.pot); |
868 |
|
pot_col[atom2] += 0.5 * *(idat.pot); |
879 |
|
} |
880 |
|
|
881 |
|
|
882 |
< |
InteractionData ForceMatrixDecomposition::fillSkipData(int atom1, int atom2){ |
883 |
< |
|
887 |
< |
InteractionData idat; |
882 |
> |
void ForceMatrixDecomposition::fillSkipData(InteractionData &idat, |
883 |
> |
int atom1, int atom2) { |
884 |
|
#ifdef IS_MPI |
885 |
|
idat.atypes = make_pair( ff_->getAtomType(identsRow[atom1]), |
886 |
|
ff_->getAtomType(identsCol[atom2]) ); |
953 |
|
#ifdef IS_MPI |
954 |
|
for (int i = 0; i < nGroupsInRow_; i++) { |
955 |
|
rs = cgRowData.position[i]; |
956 |
+ |
|
957 |
|
// scaled positions relative to the box vectors |
958 |
|
scaled = invHmat * rs; |
959 |
+ |
|
960 |
|
// wrap the vector back into the unit box by subtracting integer box |
961 |
|
// numbers |
962 |
< |
for (int j = 0; j < 3; j++) |
962 |
> |
for (int j = 0; j < 3; j++) { |
963 |
|
scaled[j] -= roundMe(scaled[j]); |
964 |
+ |
scaled[j] += 0.5; |
965 |
+ |
} |
966 |
|
|
967 |
|
// find xyz-indices of cell that cutoffGroup is in. |
968 |
|
whichCell.x() = nCells_.x() * scaled.x(); |
971 |
|
|
972 |
|
// find single index of this cell: |
973 |
|
cellIndex = Vlinear(whichCell, nCells_); |
974 |
+ |
|
975 |
|
// add this cutoff group to the list of groups in this cell; |
976 |
|
cellListRow_[cellIndex].push_back(i); |
977 |
|
} |
978 |
|
|
979 |
|
for (int i = 0; i < nGroupsInCol_; i++) { |
980 |
|
rs = cgColData.position[i]; |
981 |
+ |
|
982 |
|
// scaled positions relative to the box vectors |
983 |
|
scaled = invHmat * rs; |
984 |
+ |
|
985 |
|
// wrap the vector back into the unit box by subtracting integer box |
986 |
|
// numbers |
987 |
< |
for (int j = 0; j < 3; j++) |
987 |
> |
for (int j = 0; j < 3; j++) { |
988 |
|
scaled[j] -= roundMe(scaled[j]); |
989 |
+ |
scaled[j] += 0.5; |
990 |
+ |
} |
991 |
|
|
992 |
|
// find xyz-indices of cell that cutoffGroup is in. |
993 |
|
whichCell.x() = nCells_.x() * scaled.x(); |
996 |
|
|
997 |
|
// find single index of this cell: |
998 |
|
cellIndex = Vlinear(whichCell, nCells_); |
999 |
+ |
|
1000 |
|
// add this cutoff group to the list of groups in this cell; |
1001 |
|
cellListCol_[cellIndex].push_back(i); |
1002 |
|
} |
1003 |
|
#else |
1004 |
|
for (int i = 0; i < nGroups_; i++) { |
1005 |
|
rs = snap_->cgData.position[i]; |
1006 |
+ |
|
1007 |
|
// scaled positions relative to the box vectors |
1008 |
|
scaled = invHmat * rs; |
1009 |
+ |
|
1010 |
|
// wrap the vector back into the unit box by subtracting integer box |
1011 |
|
// numbers |
1012 |
< |
for (int j = 0; j < 3; j++) |
1012 |
> |
for (int j = 0; j < 3; j++) { |
1013 |
|
scaled[j] -= roundMe(scaled[j]); |
1014 |
+ |
scaled[j] += 0.5; |
1015 |
+ |
} |
1016 |
|
|
1017 |
|
// find xyz-indices of cell that cutoffGroup is in. |
1018 |
|
whichCell.x() = nCells_.x() * scaled.x(); |
1020 |
|
whichCell.z() = nCells_.z() * scaled.z(); |
1021 |
|
|
1022 |
|
// find single index of this cell: |
1023 |
< |
cellIndex = Vlinear(whichCell, nCells_); |
1023 |
> |
cellIndex = Vlinear(whichCell, nCells_); |
1024 |
> |
|
1025 |
|
// add this cutoff group to the list of groups in this cell; |
1026 |
|
cellList_[cellIndex].push_back(i); |
1027 |
|
} |
1079 |
|
} |
1080 |
|
} |
1081 |
|
#else |
1082 |
+ |
|
1083 |
|
for (vector<int>::iterator j1 = cellList_[m1].begin(); |
1084 |
|
j1 != cellList_[m1].end(); ++j1) { |
1085 |
|
for (vector<int>::iterator j2 = cellList_[m2].begin(); |
1086 |
|
j2 != cellList_[m2].end(); ++j2) { |
1087 |
< |
|
1087 |
> |
|
1088 |
|
// Always do this if we're in different cells or if |
1089 |
|
// we're in the same cell and the global index of the |
1090 |
|
// j2 cutoff group is less than the j1 cutoff group |
1104 |
|
} |
1105 |
|
} |
1106 |
|
} |
1107 |
< |
|
1107 |
> |
|
1108 |
|
// save the local cutoff group positions for the check that is |
1109 |
|
// done on each loop: |
1110 |
|
saved_CG_positions_.clear(); |
1111 |
|
for (int i = 0; i < nGroups_; i++) |
1112 |
|
saved_CG_positions_.push_back(snap_->cgData.position[i]); |
1113 |
< |
|
1113 |
> |
|
1114 |
|
return neighborList; |
1115 |
|
} |
1116 |
|
} //end namespace OpenMD |