Skip to content

Commit 6c488db

Browse files
committed
change some variable to static
1 parent 56cb9bb commit 6c488db

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

source/module_esolver/lcao_before_scf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(UnitCell& ucell, const int istep)
132132
orb_.Phi,
133133
ucell,
134134
this->gd);
135-
ModuleGint::Gint::set_gint_info(gint_info);
135+
ModuleGint::Gint::init_gint_info(gint_info);
136136

137137
psi_u.clear();
138138
psi_u.shrink_to_fit();

source/module_hamilt_lcao/module_gint/new_grid_tech/biggrid.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace ModuleGint
44
{
5+
std::shared_ptr<const LocalCellInfo> BigGrid::localcell_info_ = nullptr;
6+
std::shared_ptr<const UnitCellInfo> BigGrid::unitcell_info_ = nullptr;
7+
std::shared_ptr<const BigGridInfo> BigGrid::biggrid_info_ = nullptr;
58

6-
BigGrid::BigGrid(int idx, std::shared_ptr<const LocalCellInfo> localcell_info)
7-
: idx_(idx), localcell_info_(localcell_info),
8-
unitcell_info_(localcell_info->get_unitcell_info()),
9-
biggrid_info_(localcell_info_->get_biggrid_info()) {}
9+
BigGrid::BigGrid(int idx): idx_(idx){}
1010

1111
void BigGrid::add_atom(const GintAtom* atom)
1212
{

source/module_hamilt_lcao/module_gint/new_grid_tech/biggrid.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ class BigGrid
8080
const int idx_;
8181

8282
// local cell info
83-
std::shared_ptr<const LocalCellInfo> localcell_info_;
83+
static std::shared_ptr<const LocalCellInfo> localcell_info_;
8484

8585
// unitcell info
86-
std::shared_ptr<const UnitCellInfo> unitcell_info_;
86+
static std::shared_ptr<const UnitCellInfo> unitcell_info_;
8787

8888
// the big grid info
89-
std::shared_ptr<const BigGridInfo> biggrid_info_;
89+
static std::shared_ptr<const BigGridInfo> biggrid_info_;
9090
};
9191

9292
} // namespace ModuleGint

source/module_hamilt_lcao/module_gint/new_grid_tech/gint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Gint
1616

1717
// note that gint_info_ is a static member variable
1818
// it is shared by all instances of Gint
19-
static void set_gint_info(std::shared_ptr<GintInfo> gint_info)
19+
static void init_gint_info(std::shared_ptr<GintInfo> gint_info)
2020
{
2121
gint_info_ = gint_info;
2222
}

source/module_hamilt_lcao/module_gint/new_grid_tech/gint_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ GintInfo::GintInfo(
3838

3939
for (int i = 0; i < localcell_info_->get_bgrids_num(); i++)
4040
{
41-
biggrids_.push_back(std::make_shared<BigGrid>(i, localcell_info_));
41+
biggrids_.push_back(std::make_shared<BigGrid>(i));
4242
}
4343

4444
// initialize the atoms

0 commit comments

Comments
 (0)