本文整理汇总了C++中CMol::Count_All_Atoms_Connected方法的典型用法代码示例。如果您正苦于以下问题:C++ CMol::Count_All_Atoms_Connected方法的具体用法?C++ CMol::Count_All_Atoms_Connected怎么用?C++ CMol::Count_All_Atoms_Connected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMol
的用法示例。
在下文中一共展示了CMol::Count_All_Atoms_Connected方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Get_Representative_14_Atoms
void Get_Representative_14_Atoms(int iDih)
{
int ia, ib, ic, id, i, Idx, nAtom_Connected, nAtom_Connected_Max=0;
ib = Dih_Bond[iDih][1];
ic = Dih_Bond[iDih][2];
//start to find the representative atom for the left side, ia
nAtom_Connected_Max=-100;
ia = -1;
for(i=0; i<Bond_Count[ib]; i++) {
Idx = Bond_List[ib][i];
if(Idx == ic) {
continue;
}
nAtom_Connected = Mol.Count_All_Atoms_Connected(Idx, ib);
if(nAtom_Connected > nAtom_Connected_Max) {
nAtom_Connected_Max = nAtom_Connected;
ia = Idx;
}
else if( (i!=0) && (nAtom_Connected == nAtom_Connected_Max) && (Mol.mass[Idx] > Mol.mass[ia]) ) {
ia = Idx;
}
}
if(ia>=0) {
Dih_Bond[iDih][0] = ia;
}
else {
Quit_With_Error_Msg("Fail to find the representative atom (heavy atom), ia, in dihedral.\nQuit\n");
}
//end to find the representative atom for the left side, ia
//start to find the representative atom for the left side, ia
nAtom_Connected_Max=-100;
id = -1;
for(i=0; i<Bond_Count[ic]; i++) {
Idx = Bond_List[ic][i];
if(Idx == ib) {
continue;
}
nAtom_Connected = Mol.Count_All_Atoms_Connected(Idx, ic);
if(nAtom_Connected > nAtom_Connected_Max) {
nAtom_Connected_Max = nAtom_Connected;
id = Idx;
}
else if( (i!=0) && (nAtom_Connected == nAtom_Connected_Max) && (Mol.mass[Idx] > Mol.mass[id]) ) {
id = Idx;
}
}
if(id>=0) {
Dih_Bond[iDih][3] = id;
}
else {
Quit_With_Error_Msg("Fail to find the representative atom (heavy atom), id, in dihedral.\nQuit\n");
}
//end to find the representative atom for the left side, ia
return;
}