Skip to content

Commit 736c1b6

Browse files
committed
Refactor: add const for Grid_Driver
1 parent 1f9779d commit 736c1b6

File tree

95 files changed

+663
-669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+663
-669
lines changed

source/module_cell/module_neighbor/sltk_grid_driver.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ Grid_Driver::~Grid_Driver()
2121
{
2222
}
2323

24-
25-
void Grid_Driver::Find_atom(
26-
const UnitCell &ucell,
27-
const ModuleBase::Vector3<double> &cartesian_pos,
28-
const int &ntype,
29-
const int &nnumber,
30-
AdjacentAtomInfo *adjs)
24+
void Grid_Driver::Find_atom(const UnitCell& ucell,
25+
const ModuleBase::Vector3<double>& cartesian_pos,
26+
const int& ntype,
27+
const int& nnumber,
28+
AdjacentAtomInfo* adjs) const
3129
{
3230
ModuleBase::timer::tick("Grid_Driver","Find_atom");
3331
// std::cout << "lenght in Find atom = " << atomlink[offset].fatom.getAdjacentSet()->getLength() << std::endl;

source/module_cell/module_neighbor/sltk_grid_driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Grid_Driver : public Grid
7070
const ModuleBase::Vector3<double>& cartesian_posi,
7171
const int& ntype,
7272
const int& nnumber,
73-
AdjacentAtomInfo* adjs = nullptr);
73+
AdjacentAtomInfo* adjs = nullptr) const;
7474

7575
//==========================================================
7676
// EXPLAIN : The adjacent information for the input

source/module_elecstate/module_dm/density_matrix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class DensityMatrix
6666
* @param GridD_in pointer of Grid_Driver object (used to find ajacent atoms)
6767
* @param ucell pointer of UnitCell object
6868
*/
69-
void init_DMR(Grid_Driver* GridD_in, const UnitCell* ucell);
69+
void init_DMR(const Grid_Driver* GridD_in, const UnitCell* ucell);
7070

7171
/**
7272
* @brief initialize density matrix DMR from UnitCell and RA

source/module_elecstate/module_dm/density_matrix_io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace elecstate
1212

1313
// initialize density matrix DMR from UnitCell (mainly used in UnitTest)
1414
template <typename TK, typename TR>
15-
void DensityMatrix<TK, TR>::init_DMR(Grid_Driver* GridD_in, const UnitCell* ucell)
15+
void DensityMatrix<TK, TR>::init_DMR(const Grid_Driver* GridD_in, const UnitCell* ucell)
1616
{
1717
ModuleBase::TITLE("DensityMatrix", "init_DMR");
1818
// ensure _DMR is empty

source/module_hamilt_lcao/hamilt_lcaodft/FORCE.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Force_LCAO
5151
const bool isstress,
5252
ForceStressArrays& fsr, // mohan add 2024-06-16
5353
const UnitCell& ucell,
54-
Grid_Driver& gd,
54+
const Grid_Driver& gd,
5555
const psi::Psi<T>* psi,
5656
const elecstate::ElecState* pelec,
5757
ModuleBase::matrix& foverlap,
@@ -74,7 +74,7 @@ class Force_LCAO
7474

7575
// get the ds, dt, dvnl.
7676
void allocate(const UnitCell& ucell,
77-
Grid_Driver& gd,
77+
const Grid_Driver& gd,
7878
const Parallel_Orbitals& pv,
7979
ForceStressArrays& fsr, // mohan add 2024-06-15
8080
const TwoCenterBundle& two_center_bundle,

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void Force_Stress_LCAO<T>::getForceStress(const bool isforce,
3636
const bool istestf,
3737
const bool istests,
3838
const UnitCell& ucell,
39-
Grid_Driver& gd,
39+
const Grid_Driver& gd,
4040
Parallel_Orbitals& pv,
4141
const elecstate::ElecState* pelec,
4242
const psi::Psi<T>* psi,
@@ -870,7 +870,7 @@ void Force_Stress_LCAO<double>::integral_part(const bool isGammaOnly,
870870
const bool isforce,
871871
const bool isstress,
872872
const UnitCell& ucell,
873-
Grid_Driver& gd,
873+
const Grid_Driver& gd,
874874
ForceStressArrays& fsr, // mohan add 2024-06-15
875875
const elecstate::ElecState* pelec,
876876
const psi::Psi<double>* psi,
@@ -923,7 +923,7 @@ void Force_Stress_LCAO<std::complex<double>>::integral_part(const bool isGammaOn
923923
const bool isforce,
924924
const bool isstress,
925925
const UnitCell& ucell,
926-
Grid_Driver& gd,
926+
const Grid_Driver& gd,
927927
ForceStressArrays& fsr, // mohan add 2024-06-15
928928
const elecstate::ElecState* pelec,
929929
const psi::Psi<std::complex<double>>* psi,

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Force_Stress_LCAO
3434
const bool istestf,
3535
const bool istests,
3636
const UnitCell& ucell,
37-
Grid_Driver& gd,
37+
const Grid_Driver& gd,
3838
Parallel_Orbitals& pv,
3939
const elecstate::ElecState* pelec,
4040
const psi::Psi<T>* psi,
@@ -82,7 +82,7 @@ class Force_Stress_LCAO
8282
const bool isforce,
8383
const bool isstress,
8484
const UnitCell& ucell,
85-
Grid_Driver& gd,
85+
const Grid_Driver& gd,
8686
ForceStressArrays& fsr, // mohan add 2024-06-15
8787
const elecstate::ElecState* pelec,
8888
const psi::Psi<T>* psi,

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
template <>
1919
void Force_LCAO<double>::allocate(const UnitCell& ucell,
20-
Grid_Driver& gd,
20+
const Grid_Driver& gd,
2121
const Parallel_Orbitals& pv,
2222
ForceStressArrays& fsr, // mohan add 2024-06-15
2323
const TwoCenterBundle& two_center_bundle,
@@ -176,7 +176,7 @@ void Force_LCAO<double>::ftable(const bool isforce,
176176
const bool isstress,
177177
ForceStressArrays& fsr, // mohan add 2024-06-16
178178
const UnitCell& ucell,
179-
Grid_Driver& gd,
179+
const Grid_Driver& gd,
180180
const psi::Psi<double>* psi,
181181
const elecstate::ElecState* pelec,
182182
ModuleBase::matrix& foverlap,

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
template <>
2929
void Force_LCAO<std::complex<double>>::allocate(const UnitCell& ucell,
30-
Grid_Driver& gd,
30+
const Grid_Driver& gd,
3131
const Parallel_Orbitals& pv,
3232
ForceStressArrays& fsr, // mohan add 2024-06-15
3333
const TwoCenterBundle& two_center_bundle,
@@ -272,7 +272,7 @@ void Force_LCAO<std::complex<double>>::ftable(const bool isforce,
272272
const bool isstress,
273273
ForceStressArrays& fsr, // mohan add 2024-06-15
274274
const UnitCell& ucell,
275-
Grid_Driver& gd,
275+
const Grid_Driver& gd,
276276
const psi::Psi<std::complex<double>>* psi,
277277
const elecstate::ElecState* pelec,
278278
ModuleBase::matrix& foverlap,

source/module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ void init_basis_lcao(Parallel_Orbitals& pv,
2525
TwoCenterBundle& two_center_bundle,
2626
LCAO_Orbitals& orb);
2727

28-
2928
void build_Nonlocal_mu_new(const Parallel_Orbitals& pv,
3029
ForceStressArrays& fsr, // mohan 2024-06-16
3130
double* HlocR,
3231
const bool& calc_deri,
3332
const UnitCell& ucell,
3433
const LCAO_Orbitals& orb,
3534
const TwoCenterIntegrator& intor_orb_beta,
36-
Grid_Driver* GridD);
35+
const Grid_Driver* GridD);
3736

3837
/**
3938
* @brief prepare gird integration
@@ -164,7 +163,7 @@ void build_ST_new(ForceStressArrays& fsr,
164163
const LCAO_Orbitals& orb,
165164
const Parallel_Orbitals& pv,
166165
const TwoCenterBundle& two_center_bundle,
167-
Grid_Driver* GridD,
166+
const Grid_Driver* GridD,
168167
double* SHlocR,
169168
bool cal_syns = false,
170169
double dmax = 0.0);

0 commit comments

Comments
 (0)