Logo Search packages:      
Sourcecode: cdk version File versions  Download package

void org::openscience::cdk::modeling::forcefield::Torsions::setPhi ( GVector  coords3d ) [inline]

Calculate the actual phi

Parameters:
coords3dCurrent molecule coordinates.

Definition at line 235 of file Torsions.java.

References org::openscience::cdk::modeling::forcefield::ForceFieldTools::torsionAngleFrom3xNCoordinates().

Referenced by functionMMFF94SumET(), setGradientMMFF94SumET(), and setHessianMMFF94SumET().

                                           {
            changedCoordinates = 0;
            //logger.debug("Setting Phi");
            for (int i=0; i < changeAtomCoordinates.length; i++) {
                  this.changeAtomCoordinates[i] = false;
            }
            this.moleculeCurrentCoordinates.sub(coords3d);
            for (int i = 0; i < this.moleculeCurrentCoordinates.getSize(); i++) {
                  //logger.debug("moleculeCurrentCoordinates " + i + " = " + this.moleculeCurrentCoordinates.getElement(i));
                  if (Math.abs(this.moleculeCurrentCoordinates.getElement(i)) > 0) {
                        changeAtomCoordinates[i/3] = true;
                        changedCoordinates = changedCoordinates + 1;
                        //logger.debug("changeAtomCoordinates[" + i/3 + "] = " + changeAtomCoordinates[i/3]);
                        i = i + (2 - i % 3);
                  }
            }

            for (int m = 0; m < torsionNumber; m++) {
                  if ((changeAtomCoordinates[torsionAtomPosition[m][0]] == true) | 
                              (changeAtomCoordinates[torsionAtomPosition[m][1]] == true) | 
                              (changeAtomCoordinates[torsionAtomPosition[m][2]] == true) |
                              (changeAtomCoordinates[torsionAtomPosition[m][3]] == true))       {
                  
                        phi[m] = ForceFieldTools.torsionAngleFrom3xNCoordinates(coords3d, torsionAtomPosition[m][0], torsionAtomPosition[m][1], 
                                          torsionAtomPosition[m][2], torsionAtomPosition[m][3]);
                  } 
                  //else {System.out.println("phi was no recalculated");}
            }
            /*if  (changedCoordinates == changeAtomCoordinates.length) {
                  for (int m = 0; m < torsionNumber; m++) {
                        System.out.println("phi[" + m + "] = " + Math.toDegrees(phi[m]));
                  }
            }
            */
            moleculeCurrentCoordinates.set(coords3d);
            
      }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index