479 |
|
for (unsigned int j = 0; j < toposForAtom[atom1].size(); j++) { |
480 |
|
if (toposForAtom[atom1][j] == atom2) |
481 |
|
return topoDist[atom1][j]; |
482 |
< |
} |
482 |
> |
} |
483 |
|
return 0; |
484 |
|
} |
485 |
|
|
939 |
|
|
940 |
|
|
941 |
|
|
942 |
< |
int ForceMatrixDecomposition::getNAtomsInRow() { |
942 |
> |
int& ForceMatrixDecomposition::getNAtomsInRow() { |
943 |
|
#ifdef IS_MPI |
944 |
|
return nAtomsInRow_; |
945 |
|
#else |
950 |
|
/** |
951 |
|
* returns the list of atoms belonging to this group. |
952 |
|
*/ |
953 |
< |
vector<int> ForceMatrixDecomposition::getAtomsInGroupRow(int cg1){ |
953 |
> |
vector<int>& ForceMatrixDecomposition::getAtomsInGroupRow(int cg1){ |
954 |
|
#ifdef IS_MPI |
955 |
|
return groupListRow_[cg1]; |
956 |
|
#else |
958 |
|
#endif |
959 |
|
} |
960 |
|
|
961 |
< |
vector<int> ForceMatrixDecomposition::getAtomsInGroupColumn(int cg2){ |
961 |
> |
vector<int>& ForceMatrixDecomposition::getAtomsInGroupColumn(int cg2){ |
962 |
|
#ifdef IS_MPI |
963 |
|
return groupListCol_[cg2]; |
964 |
|
#else |
981 |
|
return d; |
982 |
|
} |
983 |
|
|
984 |
< |
Vector3d ForceMatrixDecomposition::getGroupVelocityColumn(int cg2){ |
984 |
> |
Vector3d& ForceMatrixDecomposition::getGroupVelocityColumn(int cg2){ |
985 |
|
#ifdef IS_MPI |
986 |
|
return cgColData.velocity[cg2]; |
987 |
|
#else |
989 |
|
#endif |
990 |
|
} |
991 |
|
|
992 |
< |
Vector3d ForceMatrixDecomposition::getAtomVelocityColumn(int atom2){ |
992 |
> |
Vector3d& ForceMatrixDecomposition::getAtomVelocityColumn(int atom2){ |
993 |
|
#ifdef IS_MPI |
994 |
|
return atomColData.velocity[atom2]; |
995 |
|
#else |
1027 |
|
return d; |
1028 |
|
} |
1029 |
|
|
1030 |
< |
RealType ForceMatrixDecomposition::getMassFactorRow(int atom1) { |
1030 |
> |
RealType& ForceMatrixDecomposition::getMassFactorRow(int atom1) { |
1031 |
|
#ifdef IS_MPI |
1032 |
|
return massFactorsRow[atom1]; |
1033 |
|
#else |
1035 |
|
#endif |
1036 |
|
} |
1037 |
|
|
1038 |
< |
RealType ForceMatrixDecomposition::getMassFactorColumn(int atom2) { |
1038 |
> |
RealType& ForceMatrixDecomposition::getMassFactorColumn(int atom2) { |
1039 |
|
#ifdef IS_MPI |
1040 |
|
return massFactorsCol[atom2]; |
1041 |
|
#else |
1058 |
|
return d; |
1059 |
|
} |
1060 |
|
|
1061 |
< |
vector<int> ForceMatrixDecomposition::getExcludesForAtom(int atom1) { |
1061 |
> |
vector<int>& ForceMatrixDecomposition::getExcludesForAtom(int atom1) { |
1062 |
|
return excludesForAtom[atom1]; |
1063 |
|
} |
1064 |
|
|
1149 |
|
|
1150 |
|
#ifdef IS_MPI |
1151 |
|
idat.atypes = make_pair( atypesRow[atom1], atypesCol[atom2]); |
1152 |
+ |
idat.atid1 = identsRow[atom1]; |
1153 |
+ |
idat.atid2 = identsCol[atom2]; |
1154 |
|
//idat.atypes = make_pair( ff_->getAtomType(identsRow[atom1]), |
1155 |
|
// ff_->getAtomType(identsCol[atom2]) ); |
1156 |
|
|
1207 |
|
#else |
1208 |
|
|
1209 |
|
idat.atypes = make_pair( atypesLocal[atom1], atypesLocal[atom2]); |
1210 |
+ |
idat.atid1 = idents[atom1]; |
1211 |
+ |
idat.atid2 = idents[atom2]; |
1212 |
|
|
1213 |
|
if (storageLayout_ & DataStorage::dslAmat) { |
1214 |
|
idat.A1 = &(snap_->atomData.aMat[atom1]); |
1320 |
|
* first element of pair is row-indexed CutoffGroup |
1321 |
|
* second element of pair is column-indexed CutoffGroup |
1322 |
|
*/ |
1323 |
< |
vector<pair<int, int> > ForceMatrixDecomposition::buildNeighborList() { |
1324 |
< |
|
1325 |
< |
vector<pair<int, int> > neighborList; |
1323 |
> |
void ForceMatrixDecomposition::buildNeighborList(vector<pair<int,int> >& neighborList) { |
1324 |
> |
|
1325 |
> |
neighborList.clear(); |
1326 |
|
groupCutoffs cuts; |
1327 |
|
bool doAllPairs = false; |
1328 |
|
|
1587 |
|
saved_CG_positions_.clear(); |
1588 |
|
for (int i = 0; i < nGroups_; i++) |
1589 |
|
saved_CG_positions_.push_back(snap_->cgData.position[i]); |
1586 |
– |
|
1587 |
– |
return neighborList; |
1590 |
|
} |
1591 |
|
} //end namespace OpenMD |