public static OBMol obminimizeUFF(OBMol mol, double crit, int steps) { bool sd = false; bool cut = false; bool newton = false; bool hydrogens = true; double rvdw = 6.0; double rele = 10.0; int freq = 10; //var watch = Stopwatch.StartNew(); OBForceField ff = OBForceField.FindForceField("UFF"); //watch.Stop(); //watch.Start(); ff.Setup(mol); ff.SetVDWCutOff(rvdw); ff.SetElectrostaticCutOff(rele); ff.SetUpdateFrequency(freq); ff.EnableCutOff(cut); ff.ConjugateGradientsInitialize(steps, crit); bool done = true; while (done) { done = ff.ConjugateGradientsTakeNSteps(1); //ff.GetCoordinates(mol); } ff.GetCoordinates(mol); //watch.Stop();//doesn't look like there is much I can do to optimize this, energy minimization just takes time return(mol); }
public static OBMol conformersearch(OBMol mol, int steps) { bool cut = false; bool newton = false; bool hydrogens = true; double rvdw = 6.0; double rele = 10.0; int freq = 10; OBForceField rotsearch = OBForceField.FindForceField("MMFF94"); rotsearch.Setup(mol); rotsearch.SetVDWCutOff(rvdw); rotsearch.SetElectrostaticCutOff(rele); rotsearch.SetUpdateFrequency(freq); rotsearch.EnableCutOff(cut); rotsearch.RandomRotorSearch((uint)steps); //rotsearch.WeightedRotorSearch(3,10);//this is very computationally expensive rotsearch.GetCoordinates(mol); return(mol); }