static inline void BondTypes(ParmHolder<int>& ParmIndices, Topology const& top, BondArray const& bonds) { for (BondArray::const_iterator b = bonds.begin(); b != bonds.end(); ++b) { AtomTypeHolder types(2); types.AddName( top[b->A1()].Type() ); types.AddName( top[b->A2()].Type() ); ParmIndices.AddParm( types, b->Idx(), false ); } }
/** Set up bond arrays in a sorted list for easy access during loop * over all pairs of atoms. Only use bonds for which both atoms are in * the mask. */ void Action_CheckStructure::ProcessBondArray(BondArray const& Bonds, BondParmArray const& Parm, CharMask const& cMask) { BondType BT; for (BondArray::const_iterator bnd = Bonds.begin(); bnd != Bonds.end(); ++bnd) { if ( cMask.AtomInCharMask(bnd->A1()) && cMask.AtomInCharMask(bnd->A2()) ) { if (bnd->Idx() < 0) mprintf("Warning: Bond parameters not present for atoms %i-%i, skipping.\n", bnd->A1()+1, bnd->A2()+1); else { BT.Req_off2_ = Parm[ bnd->Idx() ].Req() + bondoffset_; BT.Req_off2_ *= BT.Req_off2_; // Store squared values. BT.a1_ = bnd->A1(); BT.a2_ = bnd->A2(); bondList_.push_back(BT); } } } }