@@ -26,6 +26,7 @@ class cal_pseudo_test : public testing::Test
2626{
2727 protected:
2828 surchem solvent_model;
29+ UnitCell ucell;
2930};
3031
3132TEST_F (cal_pseudo_test, gauss_charge)
@@ -41,7 +42,7 @@ TEST_F(cal_pseudo_test, gauss_charge)
4142 double wfcecut;
4243 bool gamma_only;
4344
44- Setcell::setupcell (GlobalC:: ucell);
45+ Setcell::setupcell (ucell);
4546
4647 wfcecut = 80 ;
4748 gamma_only = false ;
@@ -60,7 +61,7 @@ TEST_F(cal_pseudo_test, gauss_charge)
6061#endif
6162 // pwtest.initgrids(lat0,latvec,wfcecut);
6263
63- GlobalC::rhopw->initgrids (GlobalC:: ucell.lat0 , GlobalC:: ucell.latvec , wfcecut);
64+ GlobalC::rhopw->initgrids (ucell.lat0 , ucell.latvec , wfcecut);
6465
6566 GlobalC::rhopw->initparameters (gamma_only, wfcecut, distribution_type, xprime);
6667 GlobalC::rhopw->setuptransform ();
@@ -75,7 +76,7 @@ TEST_F(cal_pseudo_test, gauss_charge)
7576 Structure_Factor sf;
7677 sf.nbspline = -1 ;
7778
78- solvent_model.gauss_charge (GlobalC:: ucell, GlobalC::rhopw, N, &sf);
79+ solvent_model.gauss_charge (ucell, GlobalC::rhopw, N, &sf);
7980
8081 EXPECT_NEAR (N[14 ].real (), 0.002 , 1e-9 );
8182 EXPECT_NEAR (N[16 ].real (), -0.001573534 , 1e-9 );
@@ -88,7 +89,7 @@ TEST_F(cal_pseudo_test, cal_pseudo)
8889 std::string precision_flag, device_flag;
8990 precision_flag = " double" ;
9091 device_flag = " cpu" ;
91-
92+ Setcell::setupcell (ucell);
9293 ModulePW::PW_Basis pwtest (device_flag, precision_flag);
9394 GlobalC::rhopw = &pwtest;
9495 ModuleBase::Matrix3 latvec;
@@ -115,7 +116,7 @@ TEST_F(cal_pseudo_test, cal_pseudo)
115116#endif
116117 // pwtest.initgrids(lat0,latvec,wfcecut);
117118
118- GlobalC::rhopw->initgrids (GlobalC:: ucell.lat0 , GlobalC:: ucell.latvec , wfcecut);
119+ GlobalC::rhopw->initgrids (ucell.lat0 , ucell.latvec , wfcecut);
119120 GlobalC::rhopw->initparameters (gamma_only, wfcecut, distribution_type, xprime);
120121 GlobalC::rhopw->setuptransform ();
121122 GlobalC::rhopw->collect_local_pw ();
@@ -135,7 +136,7 @@ TEST_F(cal_pseudo_test, cal_pseudo)
135136 }
136137
137138 complex <double >* PS_TOTN = new complex <double >[npw];
138- solvent_model.cal_pseudo (GlobalC:: ucell, GlobalC::rhopw, Porter_g, PS_TOTN, &sf);
139+ solvent_model.cal_pseudo (ucell, GlobalC::rhopw, Porter_g, PS_TOTN, &sf);
139140
140141 EXPECT_NEAR (PS_TOTN[16 ].real (), 0.098426466 , 1e-9 );
141142 EXPECT_NEAR (PS_TOTN[14 ].real (), 0.102 , 1e-9 );
0 commit comments