Skip to content

Commit 2a3fd0e

Browse files
committed
refactor some output information
1 parent 543287e commit 2a3fd0e

File tree

13 files changed

+75
-47
lines changed

13 files changed

+75
-47
lines changed

source/module_elecstate/module_pot/H_TDDFT_pw.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void H_TDDFT_pw::cal_fixed_v(double* vl_pseudo)
114114
{
115115
return;
116116
}
117-
std::cout << "calculate electric potential" << std::endl;
117+
//std::cout << "calculate electric potential" << std::endl;
118118

119119
ModuleBase::timer::tick("H_TDDFT_pw", "cal_fixed_v");
120120

@@ -280,7 +280,7 @@ int H_TDDFT_pw::check_ncut(int t_type)
280280

281281
void H_TDDFT_pw::update_At()
282282
{
283-
std::cout << "calculate electric potential" << std::endl;
283+
//std::cout << "calculate electric potential" << std::endl;
284284
// time evolve
285285
H_TDDFT_pw::istep++;
286286

@@ -289,6 +289,9 @@ void H_TDDFT_pw::update_At()
289289
{
290290
return;
291291
}
292+
293+
ModuleBase::timer::tick("H_TDDFT_pw", "update_At");
294+
292295
int count = 0;
293296
gauss_count = 0;
294297
trape_count = 0;
@@ -346,6 +349,8 @@ void H_TDDFT_pw::update_At()
346349
// total count++
347350
count++;
348351
}
352+
353+
ModuleBase::timer::tick("H_TDDFT_pw", "update_At");
349354
return;
350355
}
351356

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ void TDEkinetic<OperatorLCAO<TK, TR>>::init_td()
241241
// calculate At in cartesian coorinates.
242242
td_velocity.cal_cart_At(elecstate::H_TDDFT_pw::At);
243243
this->cart_At = td_velocity.cart_At;
244-
std::cout << "cart_At: " << cart_At[0] << " " << cart_At[1] << " " << cart_At[2] << std::endl;
244+
245+
// mohan update 2025-04-20
246+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ax(t)", cart_At[0]);
247+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ax(t)", cart_At[1]);
248+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ax(t)", cart_At[2]);
245249
}
246250

247251
template <typename TK, typename TR>

source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ void snap_psibeta_half_tddft(const LCAO_Orbitals& orb,
163163
const ModuleBase::Vector3<double> r_coor = r_ridial[ir] * r_angular_tmp;
164164
const ModuleBase::Vector3<double> tmp_r_coor = r_coor + dRa;
165165
const double tmp_r_coor_norm = tmp_r_coor.norm();
166-
if (tmp_r_coor_norm > Rcut1) {
166+
if (tmp_r_coor_norm > Rcut1)
167+
{
167168
continue;
168169
}
169170

@@ -181,12 +182,13 @@ void snap_psibeta_half_tddft(const LCAO_Orbitals& orb,
181182
const std::complex<double> exp_iAr = std::exp(ModuleBase::IMAG_UNIT * phase);
182183

183184
const ModuleBase::Vector3<double> tmp_r_coor_r_commu = r_coor + R0;
184-
const double temp_interpolation_value = ModuleBase::PolyInt::Polynomial_Interpolation(psi_1, mesh_r1, dk_1, tmp_r_coor_norm);
185+
const double interp_v = ModuleBase::PolyInt::Polynomial_Interpolation(psi_1,
186+
mesh_r1, dk_1, tmp_r_coor_norm);
187+
185188
for (int m0 = 0; m0 < 2 * L0 + 1; m0++)
186189
{
187190
std::complex<double> temp = exp_iAr * rly0[L0 * L0 + m0] * rly1[L1 * L1 + m1]
188-
* temp_interpolation_value
189-
* weights_angular;
191+
* interp_v * weights_angular;
190192
result_angular[m0] += temp;
191193

192194
if (calc_r)
@@ -199,7 +201,9 @@ void snap_psibeta_half_tddft(const LCAO_Orbitals& orb,
199201
}
200202

201203
int index_tmp = index;
202-
const double temp = ModuleBase::PolyInt::Polynomial_Interpolation(beta_r, mesh_r0, dk_0, r_ridial[ir]) * r_ridial[ir] * weights_ridial[ir];
204+
const double temp = ModuleBase::PolyInt::Polynomial_Interpolation(beta_r,
205+
mesh_r0, dk_0, r_ridial[ir]) * r_ridial[ir] * weights_ridial[ir];
206+
203207
if (!calc_r)
204208
{
205209
for (int m0 = 0; m0 < 2 * L0 + 1; m0++)

tests/integrate/601_NO_TDDFT_CH/INPUT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ calculation md
99
esolver_type tddft
1010

1111
#Parameter (Accuracy)
12-
ecutwfc 20
12+
ecutwfc 5
1313
scf_nmax 50
1414

1515
smearing_method gaussian
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
K_POINTS
22
0
33
Gamma
4-
2 2 2 0 0 0
4+
1 2 1 0 0 0
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
etotref -321.2089497177532
2-
etotperatomref -107.0696499059
3-
totalforceref 2.10083100
4-
totalstressref 198.29401300
5-
totaltimeref 14.01
1+
etotref -323.5397668883450
2+
etotperatomref -107.8465889628
3+
totalforceref 19.372571
4+
totalstressref 328.906753
5+
totaltimeref 2.06

tests/integrate/601_NO_TDDFT_ETRS/INPUT

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ calculation md
55
esolver_type tddft
66
gamma_only 0 # multiple k points
77
md_type nve
8-
md_dt 0.05 # md time step
8+
md_dt 0.05 # MD time step
9+
md_nstep 2 # number of MD steps
910
init_vel 1 # initial velocity
1011

1112
# occupations of bands
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
etotref -17.97090331943857
1+
etotref -17.97090331943867
22
etotperatomref -8.9854516597
33
totalforceref 48.470218
44
totalstressref 85.720449
5-
totaltimeref 1.51
5+
totaltimeref 0.78

tests/integrate/601_NO_TDDFT_restart/INPUT

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ scf_nmax 50
1515
ks_solver scalapack_gvx
1616
basis_type lcao
1717
gamma_only 0
18-
md_nstep 7
18+
md_nstep 2
1919

2020
mixing_type broyden
2121
mixing_beta 0.7

tests/integrate/601_NO_TDDFT_restart/KPT

100755100644
File mode changed.

0 commit comments

Comments
 (0)