本文整理汇总了C++中OBMol::SetTorsion方法的典型用法代码示例。如果您正苦于以下问题:C++ OBMol::SetTorsion方法的具体用法?C++ OBMol::SetTorsion怎么用?C++ OBMol::SetTorsion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBMol
的用法示例。
在下文中一共展示了OBMol::SetTorsion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: turnMolMT
void turnMolMT(OBMol& mol,vector< vector <int> >& maplist,int k)
{
if (k<0)
return;
if (k>=maplist.size())
return;
OBAtom *a1, *a2, *a3, *a4;
pthread_t threadList[angleSum];
for (int i=0;i<angleSum;++i) {
pthread_create(threadList+i,NULL,turnMolSingle,new MolData(mol,maplist,k-1));
a2 = mol.GetAtom(maplist[k][0]);
a3 = mol.GetAtom(maplist[k][1]);
std::vector<OBEdgeBase*>::iterator temp = a2->BeginBonds();
a1 = a2->BeginNbrAtom(temp);
if (a1==a3)
a1 = a2->NextNbrAtom(temp);
temp = a3->BeginBonds();
a4 = a3->BeginNbrAtom(temp);
if (a4==a2)
a4 = a3->NextNbrAtom(temp);
mol.SetTorsion(a1, a2, a3, a4, i * angle * DEG_TO_RAD);
}
for (int i=0;i<angleSum;++i) {
pthread_join(threadList[i],NULL);
}
}
示例2: turnMol
void turnMol(OBMol& mol,vector< vector <int> >& maplist,int k)
{
if (k<0)
return;
if (k>=maplist.size())
return;
OBAtom *a1, *a2, *a3, *a4;
double energy;
string fileName;
ostringstream oss(fileName);
for (int i=0;i<angleSum;++i) {
fileName = "";
a2 = mol.GetAtom(maplist[k][0]);
a3 = mol.GetAtom(maplist[k][1]);
std::vector<OBEdgeBase*>::iterator temp = a2->BeginBonds();
a1 = a2->BeginNbrAtom(temp);
if (a1==a3)
a1 = a2->NextNbrAtom(temp);
temp = a3->BeginBonds();
a4 = a3->BeginNbrAtom(temp);
if (a4==a2)
a4 = a3->NextNbrAtom(temp);
if ( !a2->IsConnected(a3) ) {
cerr << "obrotate: The atoms of the rotating bond must be bonded." << endl;
exit(-1);
}
mol.SetTorsion(a1, a2, a3, a4, i * angle * DEG_TO_RAD);
if (isEnergyCalcing)
{
indexSheet[k]=i;
forceField->Setup(mol);
energy = forceField->Energy(false);
energySheet->getVectorValue(indexSheet)=energy;
}
else
{
oss.str("");
pthread_mutex_lock(&sum_lock);
oss << sum++ << "," << FileIn ;
pthread_mutex_unlock(&sum_lock);
ofstream ofs(oss.str().c_str());
cerr << "Outputing file no." << sum << "/" << totalSum << endl;
conv.Write(&mol,&ofs); //NF
}
turnMol(mol,maplist,k-1);
}
}
示例3: outputMol
void outputMol(vector<int*>& mols,OBMol& mol,vector< vector <int> >& maplist,int k)
{
if (k<0)
return;
if (k>=maplist.size())
return;
OBAtom *a1, *a2, *a3, *a4;
double energy;
string fileName;
ostringstream oss(fileName);
for (int i=0;i<angleSum;++i) {
fileName = "";
a2 = mol.GetAtom(maplist[k][0]);
a3 = mol.GetAtom(maplist[k][1]);
std::vector<OBEdgeBase*>::iterator temp = a2->BeginBonds();
a1 = a2->BeginNbrAtom(temp);
if (a1==a3)
a1 = a2->NextNbrAtom(temp);
temp = a3->BeginBonds();
a4 = a3->BeginNbrAtom(temp);
if (a4==a2)
a4 = a3->NextNbrAtom(temp);
mol.SetTorsion(a1, a2, a3, a4, i * angle * DEG_TO_RAD);
indexSheet[k]=i;
if (isContained(mols,indexSheet))
{
oss.str("");
pthread_mutex_lock(&sum_lock);
oss << sum++ << "," << FileIn;
pthread_mutex_unlock(&sum_lock);
ofstream ofs(oss.str().c_str());
cerr << "Outputing low energy file no." << sum << "/" << totalSum << endl;
conv.Write(&mol,&ofs); //NF
}
outputMol(mols,mol,maplist,k-1);
}
}