From: <la...@us...> - 2006-05-22 14:50:19
|
Revision: 6301 Author: labarta Date: 2006-05-22 07:49:56 -0700 (Mon, 22 May 2006) ViewCVS: http://svn.sourceforge.net/cdk/?rev=6301&view=rev Log Message: ----------- Objects are created only once in the beginning. The ForceFieldTools class was made abstract. Modified Paths: -------------- trunk/cdk/src/org/openscience/cdk/modeling/forcefield/BondStretching.java trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ElectrostaticInteractions.java trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ForceField.java trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ForceFieldTools.java trunk/cdk/src/org/openscience/cdk/modeling/forcefield/MMFF94EnergyFunction.java trunk/cdk/src/org/openscience/cdk/modeling/forcefield/NewtonRaphsonMethod.java trunk/cdk/src/org/openscience/cdk/modeling/forcefield/VanDerWaalsInteractions.java Modified: trunk/cdk/src/org/openscience/cdk/modeling/forcefield/BondStretching.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/modeling/forcefield/BondStretching.java 2006-05-22 14:42:53 UTC (rev 6300) +++ trunk/cdk/src/org/openscience/cdk/modeling/forcefield/BondStretching.java 2006-05-22 14:49:56 UTC (rev 6301) @@ -24,8 +24,7 @@ String functionShape = " Bond Stretching "; - ForceFieldTools ffTools = new ForceFieldTools(); - + double mmff94SumEB = 0; GVector gradientMMFF94SumEB = null; GMatrix hessianMMFF94SumEB = null; @@ -48,14 +47,14 @@ double[][] dDeltar = null; double[][][] ddDeltar = null; - private LoggingTool logger; + //private LoggingTool logger; /** * Constructor for the BondStretching object */ public BondStretching() { - logger = new LoggingTool(this); + //logger = new LoggingTool(this); } @@ -123,7 +122,7 @@ //logger.debug("deltar.length = " + deltar.length); for (int i = 0; i < bondsNumber; i++) { - r[i] = ffTools.distanceBetweenTwoAtomsFrom3xNCoordinates(coord3d, bondAtomPosition[i][0], bondAtomPosition[i][1]); + r[i] = ForceFieldTools.distanceBetweenTwoAtomsFrom3xNCoordinates(coord3d, bondAtomPosition[i][0], bondAtomPosition[i][1]); deltar[i] = r[i] - r0[i]; //if (deltar[i] > 0) { // deltar[i] = (-1) * deltar[i]; @@ -289,7 +288,7 @@ //logger.debug("bondAtomPosition.length = " + bondAtomPosition.length); double[] rTemp = new double[bondAtomPosition.length]; for (int i = 0; i < bondAtomPosition.length; i++) { - rTemp[i] = ffTools.distanceBetweenTwoAtomsFrom3xNCoordinates(coord3d, bondAtomPosition[i][0], bondAtomPosition[i][1]); + rTemp[i] = ForceFieldTools.distanceBetweenTwoAtomsFrom3xNCoordinates(coord3d, bondAtomPosition[i][0], bondAtomPosition[i][1]); } for (int i=0; i<coord3d.getSize(); i++) { Modified: trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ElectrostaticInteractions.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ElectrostaticInteractions.java 2006-05-22 14:42:53 UTC (rev 6300) +++ trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ElectrostaticInteractions.java 2006-05-22 14:49:56 UTC (rev 6301) @@ -6,8 +6,8 @@ import javax.vecmath.GVector; import org.openscience.cdk.AtomContainer; -import org.openscience.cdk.qsar.IMolecularDescriptor; import org.openscience.cdk.qsar.descriptors.atomic.BondsToAtomDescriptor; +import org.openscience.cdk.qsar.IMolecularDescriptor; import org.openscience.cdk.qsar.result.IntegerResult; import org.openscience.cdk.tools.LoggingTool; @@ -50,7 +50,6 @@ double[] iQ = null; double electrostatic14interactionsScale = 0.75; // Scale factor for 1-4 interactions. To take in the future from mmff94.prm files. - ForceFieldTools ffTools = new ForceFieldTools(); private LoggingTool logger; /** @@ -138,7 +137,7 @@ for (int l = 0; l < electrostaticInteractionNumber; l++) { - r[l] = ffTools.distanceBetweenTwoAtomsFrom3xNCoordinates(coords3d, electrostaticInteractionAtomPosition[l][0], electrostaticInteractionAtomPosition[l][1]); + r[l] = ForceFieldTools.distanceBetweenTwoAtomsFrom3xNCoordinates(coords3d, electrostaticInteractionAtomPosition[l][0], electrostaticInteractionAtomPosition[l][1]); //logger.debug("r[" + l + "]= " + r[l]); } } Modified: trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ForceField.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ForceField.java 2006-05-22 14:42:53 UTC (rev 6300) +++ trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ForceField.java 2006-05-22 14:49:56 UTC (rev 6301) @@ -8,33 +8,33 @@ import org.openscience.cdk.tools.LoggingTool; /** - * To work with the coordinates of the molecule, like get the 3d coordinates of the atoms or - * calculate the distance between two atoms. + * To work with the coordinates of the molecule, like get the 3d coordinates of the atoms or + * calculate the distance between two atoms. + *@author vlabarta + *@cdk.module forcefield * - * @author vlabarta - * @cdk.module forcefield */ public class ForceField extends GeometricMinimizer{ private String potentialFunction="mmff94"; - ForceFieldTools ffTools = new ForceFieldTools(); + boolean sdm_flag=true; boolean cgm_flag=true; boolean nrm_flag=true; - private LoggingTool logger; + //private LoggingTool logger; /** * Constructor for the ForceField object */ public ForceField() { - logger = new LoggingTool(this); + //logger = new LoggingTool(this); } - public ForceField(Molecule molecule) { + public ForceField(Molecule molecule) throws Exception { setMolecule(molecule, false); - logger = new LoggingTool(this); + //logger = new LoggingTool(this); } @@ -56,14 +56,15 @@ GVector moleculeCoords = new GVector(3); MMFF94EnergyFunction mmff94PF=null; if (potentialFunction=="mmff94"){ - //logger.debug("SET POTENTIAL FUNCTION TO MMFF94"); + //System.out.println("SET POTENTIAL FUNCTION TO MMFF94"); setMMFF94Tables(molecule); mmff94PF=new MMFF94EnergyFunction((AtomContainer)molecule,getPotentialParameterSet()); + //System.out.println("PotentialFunction set:"+potentialFunction+", Hashtable:"+getPotentialParameterSet().size()); } moleculeCoords.setSize(molecule.getAtomCount() * 3); - moleculeCoords.set(ffTools.getCoordinates3xNVector((AtomContainer)molecule)); + moleculeCoords.set(ForceFieldTools.getCoordinates3xNVector((AtomContainer)molecule)); - //logger.debug("PotentialFunction set:"+potentialFunction+"MoleculeCoords set:"+moleculeCoords.getSize()+" Hashtable:"+getPotentialParameterSet().size()); + //System.out.println("PotentialFunction set:"+potentialFunction+" Molecule Coords set:"+moleculeCoords.getSize()+" Hashtable:"+getPotentialParameterSet().size()); //logger.debug(moleculeCoords.toString()); start = System.currentTimeMillis(); //System.out.println("Starting minmization at " + start); @@ -73,14 +74,14 @@ //conjugateGradientMinimization(moleculeCoords, tpf); stop = System.currentTimeMillis(); //System.out.println("Finished minmization at " + stop); - if ((stop - start)/1000 < 60) { + //if ((stop - start)/1000 < 60) { //System.out.println("Time for minimization: " + (stop - start)/1000 + " sec"); - } else { - //System.out.println("Time for minimization: " + (stop - start)/60000 + " min"); + //} + // System.out.println("Time for minimization: " + (stop - start)/60000 + " min"); - } - //logger.debug("Minimization READY"); - //ffTools.assignCoordinatesToMolecule(moleculeCoords, (AtomContainer) molecule); + //} + //System.out.println("Minimization READY"); + //ForceFieldTools.assignCoordinatesToMolecule(moleculeCoords, (AtomContainer) molecule); } Modified: trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ForceFieldTools.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ForceFieldTools.java 2006-05-22 14:42:53 UTC (rev 6300) +++ trunk/cdk/src/org/openscience/cdk/modeling/forcefield/ForceFieldTools.java 2006-05-22 14:49:56 UTC (rev 6301) @@ -1,34 +1,33 @@ package org.openscience.cdk.modeling.forcefield; -import java.util.Vector; +import java.io.*; +import java.lang.*; +import java.util.*; +import javax.vecmath.*; +import org.openscience.cdk.*; -import javax.vecmath.GVector; -import javax.vecmath.Point3d; -import javax.vecmath.Tuple3d; -import javax.vecmath.Vector3d; - -import org.openscience.cdk.Atom; -import org.openscience.cdk.AtomContainer; - /** * To work with the coordinates of the molecule, like get the 3d coordinates of * the atoms or calculate the distance between two atoms. * * @author vlabarta * @cdk.created 2005-03-03 - * @cdk.module forcefield */ -public class ForceFieldTools { +public abstract class ForceFieldTools { - Point3d atomiCoordinates = new Point3d(); - Point3d atomjCoordinates = new Point3d(); - Point3d atomkCoordinates = new Point3d(); - Point3d atomlCoordinates = new Point3d(); + static Vector3d xji = null; + static Vector3d xjk = null; + static Vector3d xlk = null; + static Vector3d v1 = null; + static Vector3d v2 = null; - /** - * Constructor for the ForceFieldTools object - */ - public ForceFieldTools() { } + static Point3d atomiCoordinates = new Point3d(); + static Point3d atomjCoordinates = new Point3d(); + static Point3d atomkCoordinates = new Point3d(); + static Point3d atomlCoordinates = new Point3d(); + static Point3d atom1Coordinates = new Point3d(); + static Point3d atom2Coordinates = new Point3d(); + /** @@ -38,7 +37,7 @@ *@param molecule molecule store in an AtomContainer *@return GVector with 3xN coordinates (N: atom numbers) */ - public GVector getCoordinates3xNVector(AtomContainer molecule) { + public static GVector getCoordinates3xNVector(AtomContainer molecule) { //System.out.println("molecule: " + molecule.toString()); //System.out.println("Atoms number = " + molecule.getAtomCount()); @@ -70,7 +69,7 @@ *@param molecule molecule store in an AtomContainer *@return Vector with the N coordinates 3d of a molecule of N atoms */ - public Vector getPoint3dCoordinates(AtomContainer molecule) { + public static Vector getPoint3dCoordinates(AtomContainer molecule) { //System.out.println("molecule: " + molecule.toString()); //System.out.println("Atoms number = " + molecule.getAtomCount()); @@ -98,13 +97,14 @@ *@param atom2 Second atom. *@return Distance between the two atoms. */ - public double distanceBetweenTwoAtoms(Atom atom1, Atom atom2) { + public static double distanceBetweenTwoAtoms(Atom atom1, Atom atom2) { - Point3d atom1Coordinates = new Point3d(atom1.getPoint3d()); - Point3d atom2Coordinates = new Point3d(atom2.getPoint3d()); - double atomsDistance = 0; - atomsDistance = atom1Coordinates.distance(atom2Coordinates); - //System.out.println("atomsDistance = " + atomsDistance); + atom1Coordinates = atom1.getPoint3d(); + atom2Coordinates = atom2.getPoint3d(); + + double atomsDistance = atom1Coordinates.distance(atom2Coordinates); + + System.out.println("distanceBetweenTwoAtoms, atomsDistance = " + atomsDistance); return atomsDistance; } @@ -119,13 +119,17 @@ *@param atom2Position Atom position in the molecule (from 0 to N-1) for the second atom. *@return Distance between the two atoms. */ - public double distanceBetweenTwoAtomsFrom3xNCoordinates(GVector coords3d, int atom1Position, int atom2Position) { + public static double distanceBetweenTwoAtomsFrom3xNCoordinates(GVector coords3d, int atom1Position, int atom2Position) { - Point3d atom1Coordinates = new Point3d(coords3d.getElement(3 * atom1Position), coords3d.getElement(3 * atom1Position + 1), coords3d.getElement(3 * atom1Position + 2)); - Point3d atom2Coordinates = new Point3d(coords3d.getElement(3 * atom2Position), coords3d.getElement(3 * atom2Position + 1), coords3d.getElement(3 * atom2Position + 2)); + atom1Coordinates.x = coords3d.getElement(3 * atom1Position); + atom1Coordinates.y = coords3d.getElement(3 * atom1Position + 1); + atom1Coordinates.z = coords3d.getElement(3 * atom1Position + 2); + atom2Coordinates.x = coords3d.getElement(3 * atom2Position); + atom2Coordinates.y = coords3d.getElement(3 * atom2Position + 1); + atom2Coordinates.z = coords3d.getElement(3 * atom2Position + 2); + double atomsDistance = 0; atomsDistance = atom1Coordinates.distance(atom2Coordinates); - //System.out.println("atomsDistance = " + atomsDistance); return atomsDistance; } @@ -142,7 +146,7 @@ * 0 to N-1) for the second atom. *@return Distance between the two atoms in the molecule. */ - public double distanceBetweenTwoAtomsFromNCoordinates3d(Vector atoms3dCoordinates, int atomNum1, int atomNum2) { + public static double distanceBetweenTwoAtomsFromNCoordinates3d(Vector atoms3dCoordinates, int atomNum1, int atomNum2) { Point3d atom13dCoord = (Point3d) atoms3dCoordinates.get(atomNum1); Point3d atom23dCoord = (Point3d) atoms3dCoordinates.get(atomNum2); @@ -162,7 +166,7 @@ *@param molecule AtomContainer *@return the molecule as AtomContainer */ - public AtomContainer assignCoordinatesToMolecule(GVector moleculeCoords, AtomContainer molecule) { + public static AtomContainer assignCoordinatesToMolecule(GVector moleculeCoords, AtomContainer molecule) { for (int i = 0; i < molecule.getAtomCount(); i++) { molecule.getAtomAt(i).setX3d(moleculeCoords.getElement(i * 3)); molecule.getAtomAt(i).setY3d(moleculeCoords.getElement(i * 3 + 1)); @@ -182,7 +186,7 @@ *@param atomNumM2 Atom position in the second molecule. *@return Distance between the two atoms. */ - public double distanceBetweenTwoAtomFromTwo3xNCoordinates(GVector atomsCoordinatesVector1, GVector atomsCoordinatesVector2, int atomNumM1, int atomNumM2) { + public static double distanceBetweenTwoAtomFromTwo3xNCoordinates(GVector atomsCoordinatesVector1, GVector atomsCoordinatesVector2, int atomNumM1, int atomNumM2) { double atomsDistance = 0; double difference = 0; @@ -205,7 +209,7 @@ *@param atomk Atom k. *@return Angle value. */ - public double angleBetweenTwoBonds(Atom atomi, Atom atomj, Atom atomk) { + public static double angleBetweenTwoBonds(Atom atomi, Atom atomj, Atom atomk) { Vector3d bondij = new Vector3d(); bondij.sub((Tuple3d)atomi.getPoint3d(), (Tuple3d)atomj.getPoint3d()); @@ -226,14 +230,14 @@ *@param atomkPosition Atom k position. *@return Angle value. */ - public double angleBetweenTwoBondsFrom3xNCoordinates(GVector coords3d,int atomiPosition,int atomjPosition,int atomkPosition) { + public static double angleBetweenTwoBondsFrom3xNCoordinates(GVector coords3d,int atomiPosition,int atomjPosition,int atomkPosition) { - this.atomiCoordinates.set(coords3d.getElement(3 * atomiPosition), coords3d.getElement(3 * atomiPosition + 1), coords3d.getElement(3 * atomiPosition + 2)); - this.atomjCoordinates.set(coords3d.getElement(3 * atomjPosition), coords3d.getElement(3 * atomjPosition + 1), coords3d.getElement(3 * atomjPosition + 2)); - this.atomkCoordinates.set(coords3d.getElement(3 * atomkPosition), coords3d.getElement(3 * atomkPosition + 1), coords3d.getElement(3 * atomkPosition + 2)); + atomiCoordinates.set(coords3d.getElement(3 * atomiPosition), coords3d.getElement(3 * atomiPosition + 1), coords3d.getElement(3 * atomiPosition + 2)); + atomjCoordinates.set(coords3d.getElement(3 * atomjPosition), coords3d.getElement(3 * atomjPosition + 1), coords3d.getElement(3 * atomjPosition + 2)); + atomkCoordinates.set(coords3d.getElement(3 * atomkPosition), coords3d.getElement(3 * atomkPosition + 1), coords3d.getElement(3 * atomkPosition + 2)); Vector3d bondij = new Vector3d(); - bondij.sub((Tuple3d)this.atomiCoordinates, (Tuple3d)atomjCoordinates); + bondij.sub((Tuple3d)atomiCoordinates, (Tuple3d)atomjCoordinates); Vector3d bondjk = new Vector3d(); bondjk.sub((Tuple3d)atomkCoordinates, (Tuple3d)atomjCoordinates); @@ -254,21 +258,21 @@ *@param atoml Atom l. *@return Torsion angle value. */ - public double torsionAngle(Atom atomi, Atom atomj, Atom atomk, Atom atoml) { + public static double torsionAngle(Atom atomi, Atom atomj, Atom atomk, Atom atoml) { - Vector3d xji = new Vector3d((Tuple3d) atomi.getPoint3d()); + xji = new Vector3d((Tuple3d) atomi.getPoint3d()); xji.sub(atomj.getPoint3d()); - Vector3d xjk = new Vector3d((Tuple3d) atomk.getPoint3d()); + xjk = new Vector3d((Tuple3d) atomk.getPoint3d()); xjk.sub(atomj.getPoint3d()); - Vector3d xlk = new Vector3d((Tuple3d) atomk.getPoint3d()); + xlk = new Vector3d((Tuple3d) atomk.getPoint3d()); xlk.sub(atoml.getPoint3d()); - Vector3d v1 = new Vector3d(); + v1 = new Vector3d(); // v1 = xji x xjk / |xji x xjk| v1.cross(xji, xjk); v1.normalize(); - Vector3d v2 = new Vector3d(); + v2 = new Vector3d(); // v2 = xjk x xlk / |xjk x xlk| v2.cross(xjk, xlk); v2.normalize(); @@ -291,25 +295,25 @@ *@param atomlPosition Atom l position. *@return Torsion angle value. */ - public double torsionAngleFrom3xNCoordinates(GVector coords3d, int atomiPosition, int atomjPosition, int atomkPosition, int atomlPosition) { + public static double torsionAngleFrom3xNCoordinates(GVector coords3d, int atomiPosition, int atomjPosition, int atomkPosition, int atomlPosition) { - this.atomiCoordinates.set(coords3d.getElement(3 * atomiPosition), coords3d.getElement(3 * atomiPosition + 1), coords3d.getElement(3 * atomiPosition + 2)); - this.atomjCoordinates.set(coords3d.getElement(3 * atomjPosition), coords3d.getElement(3 * atomjPosition + 1), coords3d.getElement(3 * atomjPosition + 2)); - this.atomkCoordinates.set(coords3d.getElement(3 * atomkPosition), coords3d.getElement(3 * atomkPosition + 1), coords3d.getElement(3 * atomkPosition + 2)); - this.atomlCoordinates.set(coords3d.getElement(3 * atomlPosition), coords3d.getElement(3 * atomlPosition + 1), coords3d.getElement(3 * atomlPosition + 2)); + atomiCoordinates.set(coords3d.getElement(3 * atomiPosition), coords3d.getElement(3 * atomiPosition + 1), coords3d.getElement(3 * atomiPosition + 2)); + atomjCoordinates.set(coords3d.getElement(3 * atomjPosition), coords3d.getElement(3 * atomjPosition + 1), coords3d.getElement(3 * atomjPosition + 2)); + atomkCoordinates.set(coords3d.getElement(3 * atomkPosition), coords3d.getElement(3 * atomkPosition + 1), coords3d.getElement(3 * atomkPosition + 2)); + atomlCoordinates.set(coords3d.getElement(3 * atomlPosition), coords3d.getElement(3 * atomlPosition + 1), coords3d.getElement(3 * atomlPosition + 2)); - Vector3d xji = new Vector3d((Tuple3d)this.atomiCoordinates); - xji.sub(this.atomjCoordinates); - Vector3d xjk = new Vector3d((Tuple3d)this.atomkCoordinates); - xjk.sub(this.atomjCoordinates); - Vector3d xlk = new Vector3d((Tuple3d)this.atomkCoordinates); - xlk.sub(this.atomlCoordinates); + xji = new Vector3d((Tuple3d)atomiCoordinates); + xji.sub(atomjCoordinates); + xjk = new Vector3d((Tuple3d)atomkCoordinates); + xjk.sub(atomjCoordinates); + xlk = new Vector3d((Tuple3d)atomkCoordinates); + xlk.sub(atomlCoordinates); - Vector3d v1 = new Vector3d(); // v1 = xji x xjk / |xji x xjk| + v1 = new Vector3d(); // v1 = xji x xjk / |xji x xjk| v1.cross(xji, xjk); v1.normalize(); - Vector3d v2 = new Vector3d(); // v2 = xjk x xlk / |xjk x xlk| + v2 = new Vector3d(); // v2 = xjk x xlk / |xjk x xlk| v2.cross(xjk, xlk); v2.normalize(); @@ -332,7 +336,7 @@ return torsion; } - public double toDegrees(double angleRad){ + public static double toDegrees(double angleRad){ return angleRad*180/Math.PI; } Modified: trunk/cdk/src/org/openscience/cdk/modeling/forcefield/MMFF94EnergyFunction.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/modeling/forcefield/MMFF94EnergyFunction.java 2006-05-22 14:42:53 UTC (rev 6300) +++ trunk/cdk/src/org/openscience/cdk/modeling/forcefield/MMFF94EnergyFunction.java 2006-05-22 14:49:56 UTC (rev 6301) @@ -6,7 +6,7 @@ import javax.vecmath.GVector; import org.openscience.cdk.AtomContainer; -import org.openscience.cdk.tools.LoggingTool; +//import org.openscience.cdk.tools.LoggingTool; /** @@ -26,8 +26,7 @@ GMatrix energyHessian = null; double[] forHessian = null; - ForceFieldTools fft = new ForceFieldTools(); - private LoggingTool logger; + //private LoggingTool logger; BondStretching bs = new BondStretching(); AngleBending ab = new AngleBending(); @@ -35,7 +34,7 @@ Torsions t =new Torsions(); VanDerWaalsInteractions vdwi = new VanDerWaalsInteractions(); ElectrostaticInteractions ei = new ElectrostaticInteractions(); - int count = 0; + int functionEvaluationNumber = 0; /** * Constructor for the MMFF94EnergyFunction object @@ -49,7 +48,7 @@ vdwi.setMMFF94VanDerWaalsParameters(molecule, mmff94Tables); ei.setMMFF94ElectrostaticParameters(molecule, mmff94Tables); - logger = new LoggingTool(this); + //logger = new LoggingTool(this); } @@ -72,21 +71,21 @@ + ei.functionMMFF94SumEQ(coords3d) ; - count += 1; -/* if (count == 1 | count % 50 == 0) { - System.out.println("count = " + count); - System.out.println("bs.functionMMFF94SumEB(coords3d) = " + bs.functionMMFF94SumEB(coords3d)); - System.out.println("ab.functionMMFF94SumEA(coords3d) = " + ab.functionMMFF94SumEA(coords3d)); - System.out.println("sbi.functionMMFF94SumEBA(coords3d)) = " + sbi.getFunctionMMFF94SumEBA()); - System.out.println("t.functionMMFF94SumET(coords3d) = " + t.functionMMFF94SumET(coords3d)); - System.out.println("vdwi.functionMMFF94SumEvdW(coords3d) = " + vdwi.getFunctionMMFF94SumEvdW()); - System.out.println("ei.functionMMFF94SumEQ(coords3d) = " + ei.functionMMFF94SumEQ(coords3d)); - System.out.println("energy = " + energy); - } + functionEvaluationNumber += 1; +// if (functionEvaluationNumber == 1 | functionEvaluationNumber % 50 == 0) { +// System.out.println("functionEvaluationNumber = " + functionEvaluationNumber); +// System.out.println("bs.functionMMFF94SumEB(coords3d) = " + bs.functionMMFF94SumEB(coords3d)); +// System.out.println("ab.functionMMFF94SumEA(coords3d) = " + ab.functionMMFF94SumEA(coords3d)); +// System.out.println("sbi.functionMMFF94SumEBA(coords3d)) = " + sbi.getFunctionMMFF94SumEBA()); +// System.out.println("t.functionMMFF94SumET(coords3d) = " + t.functionMMFF94SumET(coords3d)); +// System.out.println("vdwi.functionMMFF94SumEvdW(coords3d) = " + vdwi.getFunctionMMFF94SumEvdW()); +// System.out.println("ei.functionMMFF94SumEQ(coords3d) = " + ei.functionMMFF94SumEQ(coords3d)); + //System.out.println("energy(" + functionEvaluationNumber + ") = " + energy); +// } - moleculeCurrentCoordinates.set(coord3d); +// moleculeCurrentCoordinates.set(coord3d); -*/ return energy; + return energy; } Modified: trunk/cdk/src/org/openscience/cdk/modeling/forcefield/NewtonRaphsonMethod.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/modeling/forcefield/NewtonRaphsonMethod.java 2006-05-22 14:42:53 UTC (rev 6300) +++ trunk/cdk/src/org/openscience/cdk/modeling/forcefield/NewtonRaphsonMethod.java 2006-05-22 14:49:56 UTC (rev 6301) @@ -42,12 +42,12 @@ //As.print(As.getRowDimension(), As.getColumnDimension()); double[] realEigenvalues = As.eig().getRealEigenvalues(); double[] imagEigenvalues = As.eig().getImagEigenvalues(); - //logger.debug(" "); - //logger.debug("Hs EigenValues :"); - /*for (int i=0; i < As.getColumnDimension(); i++) { - logger.debug("Eigen value " + i + ": real part = " + realEigenvalues[i]); - logger.debug(", imaginary part = " + imagEigenvalues[i]); - }*/ + System.out.println(" "); + System.out.println("Hs EigenValues :"); + for (int i=0; i < As.getColumnDimension(); i++) { + System.out.println("Eigen value " + i + ": real part = " + realEigenvalues[i]); + System.out.println(", imaginary part = " + imagEigenvalues[i]); + } } Modified: trunk/cdk/src/org/openscience/cdk/modeling/forcefield/VanDerWaalsInteractions.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/modeling/forcefield/VanDerWaalsInteractions.java 2006-05-22 14:42:53 UTC (rev 6300) +++ trunk/cdk/src/org/openscience/cdk/modeling/forcefield/VanDerWaalsInteractions.java 2006-05-22 14:49:56 UTC (rev 6301) @@ -7,8 +7,8 @@ import javax.vecmath.GVector; import org.openscience.cdk.AtomContainer; -import org.openscience.cdk.qsar.IMolecularDescriptor; import org.openscience.cdk.qsar.descriptors.atomic.BondsToAtomDescriptor; +import org.openscience.cdk.qsar.IMolecularDescriptor; import org.openscience.cdk.qsar.result.IntegerResult; import org.openscience.cdk.tools.LoggingTool; @@ -50,7 +50,7 @@ GVector dIvdw = null; //int[][] distances = null; //Better check common atom connected - IMolecularDescriptor shortestPathBetweenToAtoms=new BondsToAtomDescriptor(); + IMolecularDescriptor shortestPathBetweenToAtoms = new BondsToAtomDescriptor(); Object[] params = {new Integer(0), new Integer(0)}; int vdwInteractionNumber; @@ -78,7 +78,6 @@ double[] ivdw = null; double vdwScale14 = 1; // Scale factor for 1-4 interactions. To take in the future from mmff94.prm files. - ForceFieldTools ffTools = new ForceFieldTools(); private LoggingTool logger; /** @@ -231,7 +230,7 @@ for (int l = 0; l < vdwInteractionNumber; l++) { - r[l] = ffTools.distanceBetweenTwoAtomsFrom3xNCoordinates(coords3d, vdWiAtomPosition[l][0], vdWiAtomPosition[l][1]); + r[l] = ForceFieldTools.distanceBetweenTwoAtomsFrom3xNCoordinates(coords3d, vdWiAtomPosition[l][0], vdWiAtomPosition[l][1]); //logger.debug("r[" + l + "]= " + r[l]); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |