本文整理汇总了C++中Pattern::endAtom方法的典型用法代码示例。如果您正苦于以下问题:C++ Pattern::endAtom方法的具体用法?C++ Pattern::endAtom怎么用?C++ Pattern::endAtom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pattern
的用法示例。
在下文中一共展示了Pattern::endAtom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pattern
// Find pattern for given atom
Pattern* Model::pattern(Atom* i)
{
Messenger::enter("Model::pattern[atom]");
int id = i->id();
Pattern* p;
for (p = patterns_.first(); p != NULL; p = p->next)
if ((id >= p->startAtom()) && (id <= p->endAtom())) break;
Messenger::exit("Model::pattern[atom]");
return p;
}
示例2: locateAtom
// Determine the locality of the supplied atom
AtomAddress Model::locateAtom(Atom* i)
{
Messenger::enter("Model::locateAtom");
int patternno, molno, atomno, id;
Pattern* p;
AtomAddress result;
if (!createPatterns())
{
Messenger::print("Model::locateAtom : No valid pattern available for model.");
Messenger::exit("Model::locateAtom");
return result;
}
id = i->id();
// First, find the pattern the atom is covered by
patternno = -1;
p = patterns_.first();
while (p != NULL)
{
if ((id >= p->startAtom()) && (id <= p->endAtom()))
{
patternno = p->id();
break;
}
p = p->next;
}
if (patternno == -1)
{
printf("Fatal error - could not find owner pattern for atom!\n");
Messenger::exit("Model::locateAtom");
return result;
}
// Next, find its molecule id
id -= p->startAtom();
molno = id / p->nAtoms();
// Finally, get the atom offset
atomno = id % p->nAtoms();
// Store values, and return
result.setPattern(p);
result.setMolecule(molno);
result.setOffset(atomno);
Messenger::exit("Model::locateAtom");
return result;
}
示例3: printPatterns
// Print patterns
void Model::printPatterns() const
{
Messenger::enter("Model::printPatterns");
Pattern* p = patterns_.first();
if (p == NULL) Messenger::print("No patterns defined for model '%s'.", qPrintable(name_));
else
{
Messenger::print("Pattern info for model '%s':", qPrintable(name_));
Messenger::print(" ID NMols StartId EndId Name Forcefield");
while (p != NULL)
{
Messenger::print(" %2i %-5i %-6i %-6i %-16s %s", p->id(), p->nMolecules(), p->startAtom()+1, p->endAtom()+1, qPrintable(p->name()), p->forcefield() ? qPrintable(p->forcefield()->name()) : "< Inherited >");
p = p->next;
}
}
Messenger::exit("Model::printPatterns");
}