Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_bonds.cpp

    r112b09 r36166d  
    1313#include "element.hpp"
    1414#include "info.hpp"
     15#include "verbose.hpp"
    1516#include "log.hpp"
    1617#include "molecule.hpp"
     
    121122 * \param *molecules molecules to count bonds
    122123 * \param *InterfaceElement or NULL
    123  */
    124 int CountHydrogenBridgeBonds(MoleculeListClass *molecules, const element * InterfaceElement = NULL)
     124 * \param *Interface2Element or NULL
     125 */
     126int CountHydrogenBridgeBonds(MoleculeListClass *molecules, const element * InterfaceElement = NULL, const element * Interface2Element = NULL)
    125127{
    126128  int count = 0;
     
    128130  double Otherangle = 0.;
    129131  bool InterfaceFlag = false;
     132  bool Interface2Flag = false;
    130133  bool OtherHydrogenFlag = true;
    131134  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin();MolWalker != molecules->ListOfMolecules.end(); ++MolWalker) {
     
    145148              OtherHydrogens = 0;
    146149              InterfaceFlag = (InterfaceElement == NULL);
     150              Interface2Flag = (Interface2Element == NULL);
    147151              for (BondList::const_iterator BondRunner = (*Runner)->ListOfBonds.begin(); BondRunner != (*Runner)->ListOfBonds.end(); BondRunner++) {
    148152                atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Runner);
     
    155159                }
    156160                InterfaceFlag = InterfaceFlag || (OtherAtom->type == InterfaceElement);
     161                Interface2Flag = Interface2Flag || (OtherAtom->type == Interface2Element);
    157162              }
    158163              DoLog(1) && (Log() << Verbose(1) << "Otherangle is " << Otherangle << " for " << OtherHydrogens << " hydrogens." << endl);
     
    168173                  break;
    169174              }
    170               if (InterfaceFlag && OtherHydrogenFlag) {
     175              if (InterfaceFlag && Interface2Flag && OtherHydrogenFlag) {
    171176                // on this element (Walker) we check for bond to hydrogen, i.e. part of water molecule
    172177                for (BondList::const_iterator BondRunner = (*Walker)->ListOfBonds.begin(); BondRunner != (*Walker)->ListOfBonds.end(); BondRunner++) {
Note: See TracChangeset for help on using the changeset viewer.