Difference for src/Molecule.C from version 1.1261 to 1.1262

version 1.1261version 1.1262
Line 9288
Line 9288
   BigReal sumOfAs = 0;   BigReal sumOfAs = 0;
   BigReal sumOfBs = 0;   BigReal sumOfBs = 0;
   BigReal count = 0; // needed to avoid overflow   BigReal count = 0; // needed to avoid overflow
   BigReal npairs = 0;   BigReal npairs;
   for (int i=0; i < LJtypecount; i++) {   for (int i=0; i < LJtypecount; i++) {
     if (numAtomsByLjType[i] > 1) { 
       for (int j=0; j < LJtypecount; j++) {       for (int j=0; j < LJtypecount; j++) {
         A = ATable[i*LJtypecount + j];         A = ATable[i*LJtypecount + j];
         B = BTable[i*LJtypecount + j];         B = BTable[i*LJtypecount + j];
        if (!A && !B) continue; // don't count zeroed interactions
         npairs = (numAtomsByLjType[i] - int(i==j))*BigReal(numAtomsByLjType[j]);         npairs = (numAtomsByLjType[i] - int(i==j))*BigReal(numAtomsByLjType[j]);
         sumOfAs += npairs*A;         sumOfAs += npairs*A;
         sumOfBs += npairs*B;         sumOfBs += npairs*B;
         count += npairs;         count += npairs;
       }       }
     }     }
   } 
   delete [] numAtomsByLjType;   delete [] numAtomsByLjType;
   delete [] ATable;   delete [] ATable;
   delete [] BTable;   delete [] BTable;
Line 9329
Line 9328
       int alchFlagi = (get_fep_type(i) == 2 ? -1 : get_fep_type(i));       int alchFlagi = (get_fep_type(i) == 2 ? -1 : get_fep_type(i));
       for (int j=i+1; j < numAtoms; ++j) {       for (int j=i+1; j < numAtoms; ++j) {
         int alchFlagj = (get_fep_type(j) == 2 ? -1 : get_fep_type(j));         int alchFlagj = (get_fep_type(j) == 2 ? -1 : get_fep_type(j));
          int alchFlagSum = alchFlagi + alchFlagj;
  
         // Ignore completely non-alchemical pairs.         // Ignore completely non-alchemical pairs.
         if (alchFlagi == 0 && alchFlagj == 0) continue;         if (alchFlagi == 0 && alchFlagj == 0) continue;
  
Line 9349
Line 9350
           A = 4.0*sigma_ij*epsilon_ij*sigma_ij;           A = 4.0*sigma_ij*epsilon_ij*sigma_ij;
           B = 4.0*sigma_ij*epsilon_ij;           B = 4.0*sigma_ij*epsilon_ij;
         }         }
         int alchFlagSum = alchFlagi + alchFlagj;         if (!A && !B) continue; // don't count zeroed interactions
  
         if ( alchFlagSum > 0 ){ // in group 1, remove from group 2         if ( alchFlagSum > 0 ){ // in group 1, remove from group 2
           sumOfAs2 -= 2*A;           sumOfAs2 -= 2*A;
           sumOfBs2 -= 2*B;           sumOfBs2 -= 2*B;
Line 9371
Line 9373
       }       }
       // This should save _tons_ of time, since the alchemical atoms are almost       // This should save _tons_ of time, since the alchemical atoms are almost
       // always at the top of the pdb file.       // always at the top of the pdb file.
       switch ( alchFlagi ){       if ( alchFlagi == 1 || alchFlagi == -1 ) alch_counter++;
       case -1: 
       case 1: 
         alch_counter++; 
         break; 
       } 
       if ( alch_counter == (numFepInitial + numFepFinal) ) break;       if ( alch_counter == (numFepInitial + numFepFinal) ) break;
     }     }
     LJAvgA1 = sumOfAs1 / count1;     LJAvgA1 = sumOfAs1 / count1;


Legend:
Removed in v.1.1261 
changed lines
 Added in v.1.1262



Made by using version 1.53 of cvs2html