Skip to content

Commit 21a1149

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent cd76ed0 commit 21a1149

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

source/module_lr/potentials/kernel_xc.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ void LR::KernelXC::f_xc_libxc(const int& nspin, const double& omega, const doubl
6666
#ifdef _OPENMP
6767
#pragma omp parallel for schedule(static, 1024)
6868
#endif
69-
for (int ir = 0; ir < nrxx; ++ir) rhor[ir] = rho[ir * nspin + is];
69+
for (int ir = 0; ir < nrxx; ++ir) { rhor[ir] = rho[ir * nspin + is];
70+
}
7071
gdr[is].resize(nrxx);
7172
LR_Util::grad(rhor.data(), gdr[is].data(), rho_basis_, tpiba);
7273
}
@@ -77,8 +78,9 @@ void LR::KernelXC::f_xc_libxc(const int& nspin, const double& omega, const doubl
7778
#ifdef _OPENMP
7879
#pragma omp parallel for schedule(static, 1024)
7980
#endif
80-
for (int ir = 0; ir < nrxx; ++ir)
81+
for (int ir = 0; ir < nrxx; ++ir) {
8182
sigma[ir] = gdr[0][ir] * gdr[0][ir];
83+
}
8284
}
8385
else
8486
{
@@ -145,13 +147,16 @@ void LR::KernelXC::f_xc_libxc(const int& nspin, const double& omega, const doubl
145147
{
146148
// 0. drho
147149
this->grad_kernel_set_.emplace("drho_gs", std::vector<ModuleBase::Vector3<double>>(nrxx));
148-
for (int ir = 0; ir < nrxx; ++ir)this->grad_kernel_set_["drho_gs"][ir] = gdr[0][ir];
150+
for (int ir = 0; ir < nrxx; ++ir) {this->grad_kernel_set_["drho_gs"][ir] = gdr[0][ir];
151+
}
149152
// 1. $2f^{\rho\sigma}*\nabla\rho$
150153
this->grad_kernel_set_.emplace("2_v2rhosigma_drho", std::vector<ModuleBase::Vector3<double>>(nrxx));
151-
for (int ir = 0; ir < nrxx; ++ir)this->grad_kernel_set_["2_v2rhosigma_drho"][ir] = gdr[0][ir] * v2rs.at(ir) * 2.;
154+
for (int ir = 0; ir < nrxx; ++ir) {this->grad_kernel_set_["2_v2rhosigma_drho"][ir] = gdr[0][ir] * v2rs.at(ir) * 2.;
155+
}
152156
// 2. $4f^{\sigma\sigma}*\nabla\rho$
153157
this->grad_kernel_set_.emplace("4_v2sigma2_drho", std::vector<ModuleBase::Vector3<double>>(nrxx));
154-
for (int ir = 0; ir < nrxx; ++ir)this->grad_kernel_set_["4_v2sigma2_drho"][ir] = sigma.at(ir) * v2s2.at(ir) * 4.;
158+
for (int ir = 0; ir < nrxx; ++ir) {this->grad_kernel_set_["4_v2sigma2_drho"][ir] = sigma.at(ir) * v2s2.at(ir) * 4.;
159+
}
155160
}
156161
// else if (2 == nspin) // wrong, to be fixed
157162
// {
@@ -210,9 +215,9 @@ void LR::KernelXC::f_xc_libxc(const int& nspin, const double& omega, const doubl
210215
} // end for( xc_func_type &func : funcs )
211216
XC_Functional_Libxc::finish_func(funcs);
212217

213-
if (1 == PARAM.inp.nspin || 2 == PARAM.inp.nspin) return;
218+
if (1 == PARAM.inp.nspin || 2 == PARAM.inp.nspin) { return;
214219
// else if (4 == PARAM.inp.nspin)
215-
else//NSPIN != 1,2,4 is not supported
220+
} else//NSPIN != 1,2,4 is not supported
216221
{
217222
throw std::domain_error("PARAM.inp.nspin =" + std::to_string(PARAM.inp.nspin)
218223
+ " unfinished in " + std::string(__FILE__) + " line " + std::to_string(__LINE__));

0 commit comments

Comments
 (0)