Exemplo n.º 1
0
   void DCHedron::IncorporateOld(TrialMol& oldMol)
   {
      bendEnergy = 0;
      const Forcefield& ff = data->ff;
      for (uint b = 0; b < nBonds; ++b)
      {
	 
         oldMol.OldThetaAndPhi(bonded[b], focus, theta[b], phi[b]);
         double thetaEnergy = ff.angles->Calc(angleKinds[b][b], theta[b]);
         thetaWeight[b] += exp(-ff.beta * thetaEnergy);
         bendEnergy += thetaEnergy;
	 
	 if (b!=0)
	 {
	    double phiEnergy = 0;
	    phiWeight[b] = 0;
	    for (uint c = 0; c < b; ++c)
	    {
	       double cosTerm = cos(theta[b]) * cos(theta[c]);
	       double sinTerm = sin(theta[b]) * sin(theta[c]);
	       double bfcTheta = acos(sinTerm * cos(phi[b] - phi[c]) + 
				      cosTerm);
	       phiEnergy += ff.angles->Calc(angleKinds[b][c], bfcTheta);
	    }
	    phiWeight[b] = exp(-ff.beta * phiEnergy);
	    bendEnergy += phiEnergy;
	 }
      }
   }
Exemplo n.º 2
0
 void DCLinkNoDih::IncorporateOld(TrialMol& oldMol)
 {
    double dummy;
    oldMol.OldThetaAndPhi(atom, focus, theta, dummy);
    const Forcefield& ff = data->ff;
    bendEnergy = ff.angles->Calc(angleKind, theta);
    bendWeight += exp(-ff.beta * bendEnergy);
 }
Exemplo n.º 3
0
void DCHedron::IncorporateOld(TrialMol& oldMol, uint molIndex)
{
  bendEnergy = 0.0;
  oneThree = 0.0;
  const Forcefield& ff = data->ff;
  for (uint b = 0; b < nBonds; ++b) {

    oldMol.OldThetaAndPhi(bonded[b], focus, theta[b], phi[b]);
    double thetaEnergy = data->ff.angles->Calc(angleKinds[b][b], theta[b]);
    double distSq = oldMol.OldDistSq(prev, bonded[b]);
    double nonbondedEn =
      data->calc.IntraEnergy_1_3(distSq, prev, bonded[b], molIndex);

    thetaWeight[b] += exp(-1 * data->ff.beta * (thetaEnergy + nonbondedEn));
    bendEnergy += thetaEnergy;
    oneThree += nonbondedEn;

    if (b != 0) {
      double phiEnergy = 0.0;
      nonbondedEn = 0.0;
      phiWeight[b] = 0.0;
      for (uint c = 0; c < b; ++c) {
        double cosTerm = cos(theta[b]) * cos(theta[c]);
        double sinTerm = sin(theta[b]) * sin(theta[c]);
        double bfcTheta = acos(sinTerm * cos(phi[b] - phi[c]) +
                               cosTerm);

        double distSq = oldMol.OldDistSq(bonded[c], bonded[b]);
        nonbondedEn +=  data->calc.IntraEnergy_1_3(distSq, bonded[c],
                        bonded[b], molIndex);

        phiEnergy += ff.angles->Calc(angleKinds[b][c], bfcTheta);

      }
      phiWeight[b] = exp(-ff.beta * (phiEnergy + nonbondedEn));
      bendEnergy += phiEnergy;
      oneThree += nonbondedEn;
    }
  }
}