Skip to content

Commit 17a7df5

Browse files
committed
change elesctate_gather of ucell_oemga
1 parent 3c248e0 commit 17a7df5

File tree

5 files changed

+4
-18
lines changed

5 files changed

+4
-18
lines changed

source/module_elecstate/elecstate_getters.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
namespace elecstate
99
{
1010

11-
double get_ucell_tpiba()
12-
{
13-
return GlobalC::ucell.tpiba;
14-
}
1511

1612
int get_xc_func_type()
1713
{

source/module_elecstate/elecstate_getters.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
namespace elecstate
88
{
99

10-
/// @brief get the value of .tpiba
11-
double get_ucell_tpiba();
1210
/// @brief get the value of XC_Functional::func_type
1311
int get_xc_func_type();
1412

source/module_elecstate/elecstate_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void ElecStatePW<T, Device>::rhoBandK(const psi::Psi<T, Device>& psi)
222222
j,
223223
npw,
224224
this->basis->npwk_max,
225-
static_cast<Real>(get_ucell_tpiba()),
225+
static_cast<Real>(ucell->tpiba),
226226
this->basis->template get_gcar_data<Real>(),
227227
this->basis->template get_kvec_c_data<Real>(),
228228
&psi(ibnd, 0),

source/module_elecstate/elecstate_pw_cal_tau.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void ElecStatePW<T, Device>::cal_tau(const psi::Psi<T, Device>& psi)
3838
j,
3939
npw,
4040
this->basis->npwk_max,
41-
static_cast<Real>(get_ucell_tpiba()),
41+
static_cast<Real>(ucell->tpiba),
4242
this->basis->template get_gcar_data<Real>(),
4343
this->basis->template get_kvec_c_data<Real>(),
4444
&psi(ibnd, 0),

source/module_elecstate/test/elecstate_magnetism_test.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ Charge::~Charge()
3131
{
3232
}
3333

34-
double elecstate::get_ucell_omega()
35-
{
36-
return 500.0;
37-
}
3834

3935
class MagnetismTest : public ::testing::Test
4036
{
@@ -57,10 +53,6 @@ TEST_F(MagnetismTest, Magnetism)
5753
EXPECT_EQ(nullptr, magnetism->start_magnetization);
5854
}
5955

60-
TEST_F(MagnetismTest, GlobalInfo)
61-
{
62-
EXPECT_EQ(500.0, elecstate::get_ucell_omega());
63-
}
6456

6557
TEST_F(MagnetismTest, JudgeParallel)
6658
{
@@ -91,7 +83,7 @@ TEST_F(MagnetismTest, ComputeMagnetizationS2)
9183
chr->rho[1][ir] = 1.01;
9284
}
9385
double* nelec_spin = new double[2];
94-
magnetism->compute_magnetization(chr->nrxx, chr->nxyz, chr->rho, nelec_spin);
86+
magnetism->compute_magnetization(500.0, chr->nrxx, chr->nxyz, chr->rho, nelec_spin);
9587
EXPECT_DOUBLE_EQ(-0.5, magnetism->tot_magnetization);
9688
EXPECT_DOUBLE_EQ(0.5, magnetism->abs_magnetization);
9789
EXPECT_DOUBLE_EQ(4.75, nelec_spin[0]);
@@ -125,7 +117,7 @@ TEST_F(MagnetismTest, ComputeMagnetizationS4)
125117
chr->rho[3][ir] = 1.00;
126118
}
127119
double* nelec_spin = new double[4];
128-
magnetism->compute_magnetization(chr->nrxx, chr->nxyz, chr->rho, nelec_spin);
120+
magnetism->compute_magnetization(500.0, chr->nrxx, chr->nxyz, chr->rho, nelec_spin);
129121
EXPECT_DOUBLE_EQ(100.0, magnetism->abs_magnetization);
130122
EXPECT_DOUBLE_EQ(50.0*std::sqrt(2.0), magnetism->tot_magnetization_nc[0]);
131123
EXPECT_DOUBLE_EQ(50.0, magnetism->tot_magnetization_nc[1]);

0 commit comments

Comments
 (0)