Skip to content

Commit adaf075

Browse files
committed
Add override to avoid compile warning.
1 parent d67800c commit adaf075

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

source/module_esolver/esolver_gets.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,9 @@ void ESolver_GetS::runner(UnitCell& ucell, const int istep)
143143
ModuleBase::timer::tick("ESolver_GetS", "runner");
144144
}
145145

146+
void ESolver_GetS::after_all_runners(UnitCell& ucell) {};
147+
double ESolver_GetS::cal_energy() {};
148+
void ESolver_GetS::cal_force(UnitCell& ucell, ModuleBase::matrix& force) {};
149+
void ESolver_GetS::cal_stress(UnitCell& ucell, ModuleBase::matrix& stress) {};
150+
146151
} // namespace ModuleESolver

source/module_esolver/esolver_gets.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ class ESolver_GetS : public ESolver_KS<std::complex<double>>
1818

1919
void before_all_runners(UnitCell& ucell, const Input_para& inp) override;
2020

21-
void after_all_runners(UnitCell& ucell){};
21+
void after_all_runners(UnitCell& ucell) override;
2222

2323
void runner(UnitCell& ucell, const int istep) override;
2424

2525
//! calculate total energy of a given system
26-
double cal_energy() {};
26+
double cal_energy() override;
2727

2828
//! calcualte forces for the atoms in the given cell
29-
void cal_force(UnitCell& ucell, ModuleBase::matrix& force) {};
29+
void cal_force(UnitCell& ucell, ModuleBase::matrix& force) override;
3030

3131
//! calcualte stress of given cell
32-
void cal_stress(UnitCell& ucell, ModuleBase::matrix& stress) {};
32+
void cal_stress(UnitCell& ucell, ModuleBase::matrix& stress) override;
3333

3434
protected:
3535
// 2d block - cyclic distribution info

source/module_esolver/esolver_ks.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,15 @@ void ESolver_KS<T, Device>::runner(UnitCell& ucell, const int istep)
475475
return;
476476
};
477477

478+
template <typename T, typename Device>
479+
void ESolver_KS<T, Device>::before_scf(UnitCell& ucell, const int istep)
480+
{
481+
ModuleBase::TITLE("ESolver_KS", "before_scf");
482+
483+
//! 1) call before_scf() of ESolver_FP
484+
ESolver_FP::before_scf(ucell, istep);
485+
}
486+
478487
template <typename T, typename Device>
479488
void ESolver_KS<T, Device>::iter_init(UnitCell& ucell, const int istep, const int iter)
480489
{

source/module_esolver/esolver_ks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ESolver_KS : public ESolver_FP
3737

3838
protected:
3939
//! Something to do before SCF iterations.
40-
virtual void before_scf(UnitCell& ucell, const int istep) {};
40+
virtual void before_scf(UnitCell& ucell, const int istep) override;
4141

4242
//! Something to do before hamilt2density function in each iter loop.
4343
virtual void iter_init(UnitCell& ucell, const int istep, const int iter);

source/module_esolver/esolver_ks_pw.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ void ESolver_KS_PW<T, Device>::before_scf(UnitCell& ucell, const int istep)
243243
{
244244
ModuleBase::TITLE("ESolver_KS_PW", "before_scf");
245245

246-
//! 1) call before_scf() of ESolver_FP
247-
ESolver_FP::before_scf(ucell, istep);
246+
//! 1) call before_scf() of ESolver_KS
247+
ESolver_KS<T, Device>::before_scf(ucell, istep);
248248

249249
if (ucell.cell_parameter_updated)
250250
{

source/module_esolver/lcao_before_scf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(UnitCell& ucell, const int istep)
4444
{
4545
ModuleBase::TITLE("ESolver_KS_LCAO", "before_scf");
4646

47-
//! 1) call before_scf() of ESolver_FP
48-
ESolver_FP::before_scf(ucell, istep);
47+
//! 1) call before_scf() of ESolver_KS
48+
ESolver_KS<TK>::before_scf(ucell, istep);
4949

5050
if (ucell.ionic_position_updated)
5151
{

0 commit comments

Comments
 (0)