Esempio n. 1
0
            // ! Wildcards used to minimize memory requirements
            // NONBONDED  NBXMOD 5  ATOM CDIEL FSHIFT VATOM VDISTANCE VFSWITCH -
            //      CUTNB 14.0  CTOFNB 12.0  CTONNB 10.0  EPS 1.0  E14FAC 1.0  WMIN 1.5
            // !
            // !V(Lennard-Jones) = Eps,i,j[(Rmin,i,j/ri,j)**12 - 2(Rmin,i,j/ri,j)**6]
            // !
            // !epsilon: kcal/mole, Eps,i,j = sqrt(eps,i * eps,j)
            // !Rmin/2: A, Rmin,i,j = Rmin/2,i + Rmin/2,j
            // !
            // !atom  ignored    epsilon      Rmin/2   ignored   eps,1-4       Rmin/2,1-4
            // !
            // HT       0.0       -0.0460    0.2245 ! TIP3P
            // HN1      0.0       -0.0460    0.2245
            // CN7      0.0       -0.02      2.275  0.0   -0.01 1.90 !equivalent to protein CT1
            // CN7B     0.0       -0.02      2.275  0.0   -0.01 1.90 !equivalent to protein CT1
            // ...
            /////////////////////////////////////////////////////////////
            public virtual void Compute(Universe.Nonbonded14 nonbonded, Vector[] coords, ref double energy, ref Vector[] forces, ref MatrixByArr[,] hessian, double[,] pwfrc = null, double[,] pwspr = null)
            {
                Universe.Atom atom1 = nonbonded.atoms[0];
                Universe.Atom atom2 = nonbonded.atoms[1];
                double        radi  = atom1.Rmin2_14; radi = (double.IsNaN(radi) == false) ? radi : atom1.Rmin2;
                double        radj  = atom2.Rmin2_14; radj = (double.IsNaN(radj) == false) ? radj : atom2.Rmin2;
                double        epsi  = atom1.eps_14; epsi = (double.IsNaN(epsi) == false) ? epsi : atom1.epsilon;
                double        epsj  = atom2.eps_14; epsj = (double.IsNaN(epsj) == false) ? epsj : atom2.epsilon;

                Compute(nonbonded, coords, ref energy, ref forces, ref hessian, radi, radj, epsi, epsj, pwfrc, pwspr);
            }
Esempio n. 2
0
            public static PPotential Elec(Universe.Nonbonded14 nonbonded, Vector[] coords, double ee)
            {
                Universe.Atom atom1 = nonbonded.atoms[0]; Vector coord1 = coords[atom1.ID];
                Universe.Atom atom2 = nonbonded.atoms[1]; Vector coord2 = coords[atom2.ID];

                //double ee = 1; // 80

                double pch1 = atom1.Charge;
                double pch2 = atom2.Charge;

                return(Elec(coord1, coord2, pch1, pch2, ee));
            }
Esempio n. 3
0
            public static PPotential LJ(Universe.Nonbonded14 nonbonded, Vector[] coords)
            {
                Universe.Atom atom1 = nonbonded.atoms[0]; Vector coord1 = coords[atom1.ID];
                Universe.Atom atom2 = nonbonded.atoms[1]; Vector coord2 = coords[atom2.ID];

                double rad1 = atom1.Rmin2_14; rad1 = (double.IsNaN(rad1) == false) ? rad1 : atom1.Rmin2;
                double rad2 = atom2.Rmin2_14; rad2 = (double.IsNaN(rad2) == false) ? rad2 : atom2.Rmin2;
                double eps1 = atom1.eps_14; eps1 = (double.IsNaN(eps1) == false) ? eps1 : atom1.epsilon;
                double eps2 = atom2.eps_14; eps2 = (double.IsNaN(eps2) == false) ? eps2 : atom2.epsilon;

                return(LJ(coord1, coord2, rad1, rad2, eps1, eps2));
            }
Esempio n. 4
0
        public static bool GetPwEnrgFrcSprNbnd(bool vdW, bool elec
                                               , Universe.Nonbonded14 nonbonded14
                                               , IList <Vector> coords
                                               , double D // = 80 // dielectric constant
                                               , out double Eij
                                               , out double Fij
                                               , out double Kij
                                               )
        {
            Eij = Fij = Kij = double.NaN;

            Universe.Atom atom0 = nonbonded14.atoms[0];
            Universe.Atom atom1 = nonbonded14.atoms[1];
            int           id0   = atom0.ID; if (coords[id0] == null)
            {
                return(false);
            }
            int id1 = atom1.ID; if (coords[id1] == null)
            {
                return(false);
            }

            Vector coord0 = coords[id0];
            Vector coord1 = coords[id1];

            double ri0 = atom0.Rmin2_14; if (double.IsNaN(ri0))
            {
                ri0 = atom0.Rmin2;
            }
            double rj0 = atom1.Rmin2_14; if (double.IsNaN(rj0))
            {
                rj0 = atom1.Rmin2;
            }
            double qi = atom0.Charge;
            double qj = atom1.Charge;
            double ei = atom0.eps_14; if (double.IsNaN(ei))
            {
                ei = atom0.epsilon;
            }
            double ej = atom1.eps_14; if (double.IsNaN(ej))

            {
                ej = atom1.epsilon;
            }

            GetPwEnrgFrcSprNbnd(vdW, elec
                                , coord0, ri0, qi, ei
                                , coord1, rj0, qj, ej
                                , D
                                , out Eij, out Fij, out Kij
                                );
            return(true);
        }
Esempio n. 5
0
            public virtual void Compute(Universe.Nonbonded14 nonbonded, Vector[] coords, ref double energy, ref Vector[] forces, ref MatrixByArr[,] hessian, double[,] pwfrc = null, double[,] pwspr = null)
            {
                Universe.Atom atom1 = nonbonded.atoms[0];
                Universe.Atom atom2 = nonbonded.atoms[1];
                double        pchij = atom1.Charge * atom2.Charge;

                if (double.IsNaN(pchij))
                {
                    HDebug.Assert(false);
                    return;
                }
                Compute(coords, ref energy, ref forces, ref hessian, pchij, pwfrc, pwspr);
            }
Esempio n. 6
0
            public virtual void Compute(Universe.Nonbonded14 nonbonded, Vector[] coords, ref double energy, ref Vector[] forces, ref MatrixByArr[,] hessian, double[,] pwfrc = null, double[,] pwspr = null)
            {
                Universe.Atom atom1 = nonbonded.atoms[0];
                Universe.Atom atom2 = nonbonded.atoms[1];
                double        radi  = atom1.Rmin2_14; radi = (double.IsNaN(radi) == false) ? radi : atom1.Rmin2;
                double        radj  = atom2.Rmin2_14; radj = (double.IsNaN(radj) == false) ? radj : atom2.Rmin2;
                double        epsi  = atom1.eps_14;   epsi = (double.IsNaN(epsi) == false) ? epsi : atom1.epsilon;
                double        epsj  = atom2.eps_14;   epsj = (double.IsNaN(epsj) == false) ? epsj : atom2.epsilon;
                double        radij = (radi + radj);

                if (divideRadijByTwo)
                {
                    radij = radij / 2;
                }
                double epsij = Math.Sqrt(epsi * epsj);

                if (double.IsNaN(radij) || double.IsNaN(epsij))
                {
                    HDebug.Assert(false);
                    return;
                }
                Compute(coords, ref energy, ref forces, ref hessian, radij, epsij, pwfrc, pwspr);
            }
Esempio n. 7
0
 public virtual void Compute(Universe.Nonbonded14 nonbonded, Vector[] coords, ref double energy, ref Vector[] forces, ref MatrixByArr[,] hessian, double[,] pwfrc = null, double[,] pwspr = null)
 {
     Universe.Atom atom1 = nonbonded.atoms[0];
     Universe.Atom atom2 = nonbonded.atoms[1];
     Compute(atom1, atom2, coords, ref energy, ref forces, ref hessian, pwfrc, pwspr);
 }