Difference for src/Molecule.C from version 1.1265 to 1.1266

version 1.1265version 1.1266
Line 2804
Line 2804
  
 void Molecule::plgLoadDihedrals(int *plgDihedrals) void Molecule::plgLoadDihedrals(int *plgDihedrals)
 { {
     char atom1name[11];     std::map< std::string, int > cache;
     char atom2name[11]; 
     char atom3name[11]; 
     char atom4name[11]; 
     int lastAtomIds[4];     int lastAtomIds[4];
     int multiplicity = 1; //multiplicity of the current bond     int multiplicity = 1; //multiplicity of the current bond
  
Line 2825
Line 2823
             lastAtomIds[j] = atomid[j];             lastAtomIds[j] = atomid[j];
         }         }
  
         strcpy(atom1name, atomNames[atomid[0]-1].atomtype); 
         strcpy(atom2name, atomNames[atomid[1]-1].atomtype); 
         strcpy(atom3name, atomNames[atomid[2]-1].atomtype); 
         strcpy(atom4name, atomNames[atomid[3]-1].atomtype); 
  
         if(duplicate_bond) {         if(duplicate_bond) {
             multiplicity++;             multiplicity++;
             if(multiplicity==2) {             if(multiplicity==2) {
Line 2845
Line 2838
         thisDihedral->atom3 = atomid[2]-1;         thisDihedral->atom3 = atomid[2]-1;
         thisDihedral->atom4 = atomid[3]-1;         thisDihedral->atom4 = atomid[3]-1;
  
        char query[128];
        sprintf(query,"%10s :: %10s :: %10s :: %10s :: %d",
          atomNames[atomid[0]-1].atomtype,
          atomNames[atomid[1]-1].atomtype,
          atomNames[atomid[2]-1].atomtype,
          atomNames[atomid[3]-1].atomtype,
          multiplicity);
        auto search = cache.find(query);
        if ( search != cache.end() ) { 
          thisDihedral->dihedral_type = search->second;
        } else {
          char atom1name[11];
          char atom2name[11];
          char atom3name[11];
          char atom4name[11];
          strcpy(atom1name, atomNames[atomid[0]-1].atomtype);
          strcpy(atom2name, atomNames[atomid[1]-1].atomtype);
          strcpy(atom3name, atomNames[atomid[2]-1].atomtype);
          strcpy(atom4name, atomNames[atomid[3]-1].atomtype);
  
         params->assign_dihedral_index(atom1name, atom2name,         params->assign_dihedral_index(atom1name, atom2name,
                                       atom3name, atom4name, thisDihedral,                                       atom3name, atom4name, thisDihedral,
                                       multiplicity, simParams->alchOn ? -1 : 0);                                       multiplicity, simParams->alchOn ? -1 : 0);
Line 2852
Line 2865
           iout << iWARN << "ALCHEMY MODULE WILL REMOVE DIHEDRAL OR RAISE ERROR\n"           iout << iWARN << "ALCHEMY MODULE WILL REMOVE DIHEDRAL OR RAISE ERROR\n"
                << endi;                << endi;
         }         }
          cache[query] = thisDihedral->dihedral_type;
        }
     }     }
  
     numDihedrals = numRealDihedrals;     numDihedrals = numRealDihedrals;


Legend:
Removed in v.1.1265 
changed lines
 Added in v.1.1266



Made by using version 1.53 of cvs2html