Skip to content

Commit 8c4bc2f

Browse files
committed
Remove check_f_delta().
1 parent 37517e6 commit 8c4bc2f

File tree

7 files changed

+23
-45
lines changed

7 files changed

+23
-45
lines changed

source/module_hamilt_lcao/module_deepks/deepks_force.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -263,32 +263,6 @@ void DeePKS_domain::cal_f_delta(const hamilt::HContainer<double>* dmr,
263263
return;
264264
}
265265

266-
// prints forces and stress from DeePKS (LCAO)
267-
void DeePKS_domain::check_f_delta(const int nat, ModuleBase::matrix& f_delta, ModuleBase::matrix& svnl_dalpha)
268-
{
269-
ModuleBase::TITLE("DeePKS_domain", "check_F_delta");
270-
271-
std::ofstream ofs("F_delta.dat");
272-
ofs << std::setprecision(10);
273-
274-
for (int iat = 0; iat < nat; iat++)
275-
{
276-
ofs << f_delta(iat, 0) << " " << f_delta(iat, 1) << " " << f_delta(iat, 2) << std::endl;
277-
}
278-
279-
std::ofstream ofs1("stress_delta.dat");
280-
ofs1 << std::setprecision(10);
281-
for (int ipol = 0; ipol < 3; ipol++)
282-
{
283-
for (int jpol = 0; jpol < 3; jpol++)
284-
{
285-
ofs1 << svnl_dalpha(ipol, jpol) << " ";
286-
}
287-
ofs1 << std::endl;
288-
}
289-
return;
290-
}
291-
292266
template void DeePKS_domain::cal_f_delta<double>(const hamilt::HContainer<double>* dmr,
293267
const UnitCell& ucell,
294268
const LCAO_Orbitals& orb,

source/module_hamilt_lcao/module_deepks/deepks_force.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ namespace DeePKS_domain
2121
// This file contains subroutines for calculating F_delta,
2222
// which is defind as sum_mu,nu rho_mu,nu d/dX (<chi_mu|alpha>V(D)<alpha|chi_nu>)
2323

24-
// There are 2 subroutines in this file:
24+
// There are 1 subroutine in this file:
2525
// 1. cal_f_delta, which is used for F_delta calculation
26-
// 2. check_f_delta, which prints F_delta into F_delta.dat for checking
2726

2827
template <typename TK>
2928
void cal_f_delta(const hamilt::HContainer<double>* dmr,
@@ -39,8 +38,6 @@ void cal_f_delta(const hamilt::HContainer<double>* dmr,
3938
ModuleBase::matrix& f_delta,
4039
const bool isstress,
4140
ModuleBase::matrix& svnl_dalpha);
42-
43-
void check_f_delta(const int nat, ModuleBase::matrix& f_delta, ModuleBase::matrix& svnl_dalpha);
4441
} // namespace DeePKS_domain
4542

4643
#endif

source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,14 @@ void test_deepks<T>::check_f_delta_and_stress_delta()
389389
fvnl_dalpha,
390390
cal_stress,
391391
svnl_dalpha);
392-
DeePKS_domain::check_f_delta(ucell.nat, fvnl_dalpha, svnl_dalpha);
392+
std::ofstream ofs_f("F_delta.dat");
393+
std::ofstream ofs_s("stress_delta.dat");
394+
ofs_f << std::setprecision(10);
395+
ofs_s << std::setprecision(10);
396+
fvnl_dalpha.print(ofs_f);
397+
ofs_f.close();
398+
svnl_dalpha.print(ofs_s);
399+
ofs_s.close();
393400

394401
this->compare_with_ref("F_delta.dat", "F_delta_ref.dat");
395402
this->compare_with_ref("stress_delta.dat", "stress_delta_ref.dat");
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
-0.001311934522 0.0005253265646 0.003958601889
2-
9.413138319e-05 7.995452788e-05 -0.009899538194
3-
-0.004487176496 1.637013236e-05 0.001471794325
4-
0.002672934873 0.004945265475 0.002072204459
5-
0.003032044761 -0.0055669167 0.002396937523
1+
-0.001311934522 0.0005253265646 0.003958601889
2+
9.413138319e-05 7.995452788e-05 -0.009899538194
3+
-0.004487176496 1.637013236e-05 0.001471794325
4+
0.002672934873 0.004945265475 0.002072204459
5+
0.003032044761 -0.0055669167 0.002396937523
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
-1.339663125e-07 4.35875257e-09 -7.32591443e-09
2-
4.35875257e-09 -1.616390428e-07 4.489755833e-09
3-
-7.32591443e-09 4.489755833e-09 -1.981139263e-07
1+
-1.339663125e-07 4.330236026e-09 -7.262009516e-09
2+
4.330236026e-09 -1.616390428e-07 4.577413226e-09
3+
-7.262009516e-09 4.577413226e-09 -1.981139263e-07
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
0.001927511403 0.002216346196 0.001021128399
2-
-0.00185327459 -0.0009686234405 0.0005694745218
3-
-7.42368129e-05 -0.001247722756 -0.001590602921
1+
0.001927511403 0.002216346196 0.001021128399
2+
-0.00185327459 -0.0009686234405 0.0005694745218
3+
-7.42368129e-05 -0.001247722756 -0.001590602921
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
-1.222217201e-06 -9.226694044e-07 -1.793998509e-09
2-
-9.226694044e-07 -5.946175402e-08 8.325163035e-07
3-
-1.793998509e-09 8.325163035e-07 1.112869552e-06
1+
-1.222217201e-06 -9.226694044e-07 -1.793998509e-09
2+
-9.226694044e-07 -5.946175402e-08 8.325163035e-07
3+
-1.793998509e-09 8.325163035e-07 1.112869552e-06

0 commit comments

Comments
 (0)