Skip to content

Commit 82cb3f1

Browse files
committed
change ucell in the test
1 parent a5024fe commit 82cb3f1

File tree

10 files changed

+15
-14
lines changed

10 files changed

+15
-14
lines changed

source/module_hamilt_pw/hamilt_pwdft/hamilt_pw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class HamiltPW : public Hamilt<T, Device>
3838
protected:
3939
// used in sPhi, which are calculated in hPsi or sPhi
4040
const pseudopot_cell_vnl* ppcell = nullptr;
41-
const UnitCell* const ucell;
41+
const UnitCell* const ucell = nullptr;
4242
mutable T* vkb = nullptr;
4343
Real* qq_nt = nullptr;
4444
T* qq_so = nullptr;

source/module_hamilt_pw/hamilt_stodft/test/test_hamilt_sto.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void elecstate::Potential::cal_v_eff(Charge const*, UnitCell const*, ModuleBase:
1111
void elecstate::Potential::cal_fixed_v(double*){}
1212

1313
template <typename T, typename Device>
14-
hamilt::HamiltPW<T, Device>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* p_kv, pseudopot_cell_vnl*){}
14+
hamilt::HamiltPW<T, Device>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* p_kv, pseudopot_cell_vnl*,const UnitCell*){}
1515
template <typename T, typename Device>
1616
hamilt::HamiltPW<T, Device>::~HamiltPW(){
1717
delete this->ops;
@@ -70,7 +70,7 @@ class TestHamiltSto : public ::testing::Test
7070
p_kv = new K_Vectors();
7171
std::vector<int> ngk = {2};
7272
p_kv->ngk = ngk;
73-
hamilt_sto = new hamilt::HamiltSdftPW<std::complex<double>, base_device::DEVICE_CPU>(pot, wfc_basis, p_kv, nullptr, npol, &emin, &emax);
73+
hamilt_sto = new hamilt::HamiltSdftPW<std::complex<double>, base_device::DEVICE_CPU>(pot, wfc_basis, p_kv, nullptr, nullptr, npol, &emin, &emax);
7474
hamilt_sto->ops = new TestOp<std::complex<double>, base_device::DEVICE_CPU>();
7575
}
7676

source/module_hamilt_pw/hamilt_stodft/test/test_sto_tool.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
***********************************************/
99

1010
template <typename T, typename Device>
11-
hamilt::HamiltPW<T, Device>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* p_kv,pseudopot_cell_vnl*){}
11+
hamilt::HamiltPW<T, Device>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* p_kv,pseudopot_cell_vnl*,const UnitCell*){}
1212
template <typename T, typename Device>
1313
hamilt::HamiltPW<T, Device>::~HamiltPW(){};
1414
template <typename T, typename Device>
@@ -21,9 +21,10 @@ hamilt::HamiltSdftPW<T, Device>::HamiltSdftPW(elecstate::Potential* pot_in,
2121
ModulePW::PW_Basis_K* wfc_basis,
2222
K_Vectors* p_kv,
2323
pseudopot_cell_vnl* nlpp,
24+
const UnitCell* ucell,
2425
const int& npol,
2526
double* emin_in,
26-
double* emax_in): HamiltPW<T, Device>(pot_in, wfc_basis, p_kv, nlpp), ngk(p_kv->ngk){}
27+
double* emax_in): HamiltPW<T, Device>(pot_in, wfc_basis, p_kv, nlpp,ucell), ngk(p_kv->ngk){}
2728
template <typename T, typename Device>
2829
void hamilt::HamiltSdftPW<T, Device>::hPsi_norm(const T* psi_in, T* hpsi, const int& nbands){}
2930

source/module_hsolver/test/diago_bpcg_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class DiagoBPCGPrepare
9797
double *en = new double[npw];
9898
int ik = 1;
9999
hamilt::Hamilt<std::complex<double>>* ha;
100-
ha =new hamilt::HamiltPW<std::complex<double>>(nullptr, nullptr, nullptr, nullptr);
100+
ha =new hamilt::HamiltPW<std::complex<double>>(nullptr, nullptr, nullptr, nullptr,nullptr);
101101
int* ngk = new int [1];
102102
//psi::Psi<std::complex<double>> psi(ngk,ik,nband,npw);
103103
psi::Psi<std::complex<double>> psi;

source/module_hsolver/test/diago_cg_float_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class DiagoCGPrepare
108108
float *en = new float[npw];
109109
int ik = 1;
110110
hamilt::Hamilt<std::complex<float>>* ha;
111-
ha =new hamilt::HamiltPW<std::complex<float>>(nullptr, nullptr, nullptr, nullptr);
111+
ha =new hamilt::HamiltPW<std::complex<float>>(nullptr, nullptr, nullptr, nullptr,nullptr);
112112
int* ngk = new int [1];
113113
//psi::Psi<std::complex<float>> psi(ngk,ik,nband,npw);
114114
psi::Psi<std::complex<float>> psi;

source/module_hsolver/test/diago_cg_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class DiagoCGPrepare
104104
double *en = new double[npw];
105105
int ik = 1;
106106
hamilt::Hamilt<std::complex<double>>* ha;
107-
ha =new hamilt::HamiltPW<std::complex<double>>(nullptr, nullptr, nullptr, nullptr);
107+
ha =new hamilt::HamiltPW<std::complex<double>>(nullptr, nullptr, nullptr, nullptr,nullptr);
108108
int* ngk = new int [1];
109109
//psi::Psi<std::complex<double>> psi(ngk,ik,nband,npw);
110110
psi::Psi<std::complex<double>> psi;

source/module_hsolver/test/diago_david_float_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class DiagoDavPrepare
8282
//do Diago_David::diag()
8383
float* en = new float[npw];
8484
hamilt::Hamilt<std::complex<float>> *phm;
85-
phm = new hamilt::HamiltPW<std::complex<float>>(nullptr, nullptr, nullptr, nullptr);
85+
phm = new hamilt::HamiltPW<std::complex<float>>(nullptr, nullptr, nullptr, nullptr,nullptr);
8686

8787
#ifdef __MPI
8888
const hsolver::diag_comm_info comm_info = {MPI_COMM_WORLD, mypnum, nprocs};

source/module_hsolver/test/diago_david_real_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class DiagoDavPrepare
8181
//do Diago_David::diag()
8282
double* en = new double[npw];
8383
hamilt::Hamilt<double>* phm;
84-
phm = new hamilt::HamiltPW<double>(nullptr, nullptr, nullptr, nullptr);
84+
phm = new hamilt::HamiltPW<double>(nullptr, nullptr, nullptr, nullptr,nullptr);
8585

8686
#ifdef __MPI
8787
const hsolver::diag_comm_info comm_info = {MPI_COMM_WORLD, mypnum, nprocs};

source/module_hsolver/test/diago_david_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class DiagoDavPrepare
8181
//do Diago_David::diag()
8282
double* en = new double[npw];
8383
hamilt::Hamilt<std::complex<double>> *phm;
84-
phm = new hamilt::HamiltPW<std::complex<double>>(nullptr, nullptr, nullptr, nullptr);
84+
phm = new hamilt::HamiltPW<std::complex<double>>(nullptr, nullptr, nullptr, nullptr,nullptr);
8585

8686
#ifdef __MPI
8787
const hsolver::diag_comm_info comm_info = {MPI_COMM_WORLD, mypnum, nprocs};

source/module_hsolver/test/diago_mock.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ template<> void hamilt::HamiltPW<double>::updateHk(const int ik)
574574
return;
575575
}
576576

577-
template<> hamilt::HamiltPW<double>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* pkv, pseudopot_cell_vnl*)
577+
template<> hamilt::HamiltPW<double>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* pkv, pseudopot_cell_vnl*,const UnitCell*)
578578
{
579579
this->ops = new OperatorMock<double>;
580580
}
@@ -589,7 +589,7 @@ template<> void hamilt::HamiltPW<std::complex<double>>::updateHk(const int ik)
589589
return;
590590
}
591591

592-
template<> hamilt::HamiltPW<std::complex<double>>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* pkv, pseudopot_cell_vnl*)
592+
template<> hamilt::HamiltPW<std::complex<double>>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* pkv, pseudopot_cell_vnl*,const UnitCell*)
593593
{
594594
this->ops = new OperatorMock<std::complex<double>>;
595595
}
@@ -604,7 +604,7 @@ template<> void hamilt::HamiltPW<std::complex<float>>::updateHk(const int ik)
604604
return;
605605
}
606606

607-
template<> hamilt::HamiltPW<std::complex<float>>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* pkv, pseudopot_cell_vnl*)
607+
template<> hamilt::HamiltPW<std::complex<float>>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* pkv, pseudopot_cell_vnl*,const UnitCell*)
608608
{
609609
this->ops = new OperatorMock<std::complex<float>>;
610610
}

0 commit comments

Comments
 (0)