Skip to content

Commit c9ea546

Browse files
committed
add const for variable functions
1 parent 3f9e462 commit c9ea546

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

source/source_lcao/module_deltaspin/spin_constrain.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ double SpinConstrain<TK>::cal_escon()
3434
}
3535

3636
template <typename TK>
37-
double SpinConstrain<TK>::get_escon()
37+
double SpinConstrain<TK>::get_escon() const
3838
{
3939
return this->escon_;
4040
}
@@ -67,7 +67,7 @@ void SpinConstrain<TK>::set_nspin(int nspin_in)
6767

6868
/// get nspin
6969
template <typename TK>
70-
int SpinConstrain<TK>::get_nspin()
70+
int SpinConstrain<TK>::get_nspin() const
7171
{
7272
return this->nspin_;
7373
}
@@ -439,35 +439,35 @@ void SpinConstrain<TK>::set_input_parameters(double sc_thr_in,
439439

440440
/// get sc_thr
441441
template <typename TK>
442-
double SpinConstrain<TK>::get_sc_thr()
442+
double SpinConstrain<TK>::get_sc_thr() const
443443
{
444444
return this->sc_thr_;
445445
}
446446

447447
/// get nsc
448448
template <typename TK>
449-
int SpinConstrain<TK>::get_nsc()
449+
int SpinConstrain<TK>::get_nsc() const
450450
{
451451
return this->nsc_;
452452
}
453453

454454
/// get nsc_min
455455
template <typename TK>
456-
int SpinConstrain<TK>::get_nsc_min()
456+
int SpinConstrain<TK>::get_nsc_min() const
457457
{
458458
return this->nsc_min_;
459459
}
460460

461461
/// get alpha_trial
462462
template <typename TK>
463-
double SpinConstrain<TK>::get_alpha_trial()
463+
double SpinConstrain<TK>::get_alpha_trial() const
464464
{
465465
return this->alpha_trial_;
466466
}
467467

468468
/// get sccut
469469
template <typename TK>
470-
double SpinConstrain<TK>::get_sccut()
470+
double SpinConstrain<TK>::get_sccut() const
471471
{
472472
return this->restrict_current_;
473473
}
@@ -481,7 +481,7 @@ void SpinConstrain<TK>::set_sc_drop_thr(double sc_drop_thr_in)
481481

482482
/// get sc_drop_thr
483483
template <typename TK>
484-
double SpinConstrain<TK>::get_sc_drop_thr()
484+
double SpinConstrain<TK>::get_sc_drop_thr() const
485485
{
486486
return this->sc_drop_thr_;
487487
}

source/source_lcao/module_deltaspin/spin_constrain.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class SpinConstrain
6666
*/
6767
double cal_escon();
6868

69-
double get_escon();
69+
double get_escon() const;
7070

7171
void run_lambda_loop(int outer_step,
7272
bool rerun = true);
@@ -181,7 +181,7 @@ class SpinConstrain
181181
/// set nspin
182182
void set_nspin(int nspin);
183183
/// get nspin
184-
int get_nspin();
184+
int get_nspin() const;
185185
/// zero atomic magnetic moment
186186
void zero_Mi();
187187
/// get decay_grad
@@ -202,17 +202,17 @@ class SpinConstrain
202202
double sccut_in,
203203
double sc_drop_thr_in);
204204
/// get sc_thr
205-
double get_sc_thr();
205+
double get_sc_thr() const;
206206
/// get nsc
207-
int get_nsc();
207+
int get_nsc() const;
208208
/// get nsc_min
209-
int get_nsc_min();
209+
int get_nsc_min() const;
210210
/// get alpha_trial
211-
double get_alpha_trial();
211+
double get_alpha_trial() const;
212212
/// get sccut
213-
double get_sccut();
213+
double get_sccut() const;
214214
/// get sc_drop_thr
215-
double get_sc_drop_thr();
215+
double get_sc_drop_thr() const;
216216
/// @brief set orbital parallel info
217217
void set_ParaV(Parallel_Orbitals* ParaV_in);
218218
/// @brief set parameters for solver

source/source_pw/module_ofdft/kedf_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void KEDF_Manager::get_potential(
166166
*
167167
* @return kinetic energy
168168
*/
169-
double KEDF_Manager::get_energy()
169+
double KEDF_Manager::get_energy() const
170170
{
171171
double kinetic_energy = 0.0;
172172

source/source_pw/module_ofdft/kedf_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class KEDF_Manager
4141
ModuleBase::matrix& rpot
4242
);
4343

44-
double get_energy();
44+
double get_energy() const;
4545

4646
void get_energy_density(
4747
const double* const* prho,

0 commit comments

Comments
 (0)