Change vrad to Real.

This commit is contained in:
Ye Luo 2022-01-25 14:51:39 -06:00
parent 8ab49f5c10
commit 45157f3947
2 changed files with 12 additions and 12 deletions

View File

@ -178,10 +178,10 @@ NonLocalECPComponent::RealType NonLocalECPComponent::calculateProjector(RealType
lpolprev = lpol[l];
}
ValueType lsum = 0.0;
RealType lsum = 0.0;
for (int l = 0; l < nchannel; l++)
lsum += vrad[l] * lpol[angpp_m[l]];
knot_pots[j] = std::real(lsum * psiratio[j]);
knot_pots[j] = lsum * std::real(psiratio[j]);
pairpot += knot_pots[j];
}
@ -390,12 +390,12 @@ NonLocalECPComponent::RealType NonLocalECPComponent::evaluateOneWithForces(Parti
for (int l = 0; l < nchannel; l++)
{
lsum += std::real(vrad[l]) * lpol[angpp_m[l]];
lsum += vrad[l] * lpol[angpp_m[l]];
gradpotterm_ += vgrad[l] * lpol[angpp_m[l]] * std::real(psiratio[j]);
gradlpolyterm_ += std::real(vrad[l]) * dlpol[angpp_m[l]] * cosgrad[j] * std::real(psiratio[j]);
gradwfnterm_ += std::real(vrad[l]) * lpol[angpp_m[l]] * wfngrad[j];
gradlpolyterm_ += vrad[l] * dlpol[angpp_m[l]] * cosgrad[j] * std::real(psiratio[j]);
gradwfnterm_ += vrad[l] * lpol[angpp_m[l]] * wfngrad[j];
}
knot_pots[j] = std::real(lsum * psiratio[j]);
knot_pots[j] = lsum * std::real(psiratio[j]);
pairpot += knot_pots[j];
force_iat += gradpotterm_ + gradlpolyterm_ - gradwfnterm_;
}
@ -580,13 +580,13 @@ NonLocalECPComponent::RealType NonLocalECPComponent::evaluateOneWithForces(Parti
{
//Note. Because we are computing "forces", there's a -1 difference between this and
//direct finite difference calculations.
lsum += std::real(vrad[l]) * lpol[angpp_m[l]];
lsum += vrad[l] * lpol[angpp_m[l]];
gradpotterm_ += vgrad[l] * lpol[angpp_m[l]] * std::real(psiratio[j]);
gradlpolyterm_ += std::real(vrad[l]) * dlpol[angpp_m[l]] * cosgrad[j] * std::real(psiratio[j]);
gradwfnterm_ += std::real(vrad[l]) * lpol[angpp_m[l]] * wfngrad[j];
pulaytmp_ -= std::real(vrad[l]) * lpol[angpp_m[l]] * pulay_quad[j];
gradlpolyterm_ += vrad[l] * dlpol[angpp_m[l]] * cosgrad[j] * std::real(psiratio[j]);
gradwfnterm_ += vrad[l] * lpol[angpp_m[l]] * wfngrad[j];
pulaytmp_ -= vrad[l] * lpol[angpp_m[l]] * pulay_quad[j];
}
knot_pots[j] = std::real(lsum * psiratio[j]);
knot_pots[j] = lsum * std::real(psiratio[j]);
pulaytmp_ += knot_pots[j] * pulay_ref;
pairpot += knot_pots[j];
force_iat += gradpotterm_ + gradlpolyterm_ - gradwfnterm_;

View File

@ -70,7 +70,7 @@ private:
//Array for P'_l[cos(theta)]
std::vector<RealType> dlpol;
//Array for v_l(r).
std::vector<ValueType> vrad;
std::vector<RealType> vrad;
//Array for (2l+1)*v'_l(r)/r.
std::vector<RealType> dvrad;
//$\Psi(...q...)/\Psi(...r...)$ for all quadrature points q.