public OBMol quickMinimization(OBMol mol, string coeff, string lmpdat, bool periodic)
        {
            double etol    = 0.0;
            double ftol    = 1.0e-6;
            int    maxiter = 40000;
            int    maxeval = 20000;
            double padding = 50;

            lammps.LAMMPSsettings minSettings = new lammps.LAMMPSsettings();
            if (periodic)
            {
                minSettings.boundary = "p p p";
                padding = 0;
            }

            moltoUFF(mol, coeff, lmpdat, false, padding);

            ///graphconverter.designgraphtoUFF(child, iodir + coeff, iodir + lmpdat, false);

            //LAMMPSinstance lammps = new LAMMPSinstance(iodir + data, lmpSettings);//, &lmpptr);
            lammps lmps = new lammps(minSettings);

            lmps.runCommand("read_data " + lmpdat);

            lmps.openFile(coeff);
            lmps.minimize(etol, ftol, maxiter, maxeval, "cg");
            double[,] pos = lmps.getAtomPos();
            OBFunctions.updatexyz(mol, pos);
            return(mol);
        }
예제 #2
0
        private OBMol QuickMinimization(OBMol mol, string coeff, string lmpdat, bool periodic, int rankMe)
        {
            double       padding = 50;
            const double etol    = 0.0;
            const double ftol    = 1.0e-6;
            const int    maxiter = 40000;
            const int    maxeval = 20000;


            var minSettings = new lammps.LAMMPSsettings();

            if (periodic)
            {
                minSettings.boundary = "p p p";
                padding = 0;
            }

            if (File.Exists(coeff))
            {
                File.Delete(coeff);
            }
            if (File.Exists(lmpdat))
            {
                File.Delete(lmpdat);
            }
            Converter.moltoUFF(mol, coeff, lmpdat, false, padding);


            string[] lmparg = { "", "-screen", "none", "-log", "log.lammps." + rankMe };
            using (var lmps = new lammps(minSettings, lmparg)) {
                lmps.runCommand("read_data " + lmpdat);
                lmps.openFile(coeff);
                lmps.minimize(etol, ftol, maxiter, maxeval, "cg");
                OBFunctions.updatexyz(mol, lmps.getAtomPos());
            }
            return(mol);
        }