Skip to content

Commit b5264df

Browse files
committed
fix compile
1 parent 3b096c6 commit b5264df

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

source/module_hsolver/hsolver_pw.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace hsolver
1212
template <typename T, typename Device = base_device::DEVICE_CPU>
1313
class HSolverPW
1414
{
15-
private:
15+
protected:
1616
// Note GetTypeReal<T>::type will
1717
// return T if T is real type(float, double),
1818
// otherwise return the real type of T(complex<float>, complex<double>)
@@ -84,12 +84,12 @@ class HSolverPW
8484
const bool need_subspace; // for cg or dav_subspace
8585
const bool initialed_psi;
8686

87-
private:
87+
protected:
8888
Device* ctx = {};
8989

9090
int rank_in_pool = 0;
9191
int nproc_in_pool = 1;
92-
92+
private:
9393
/// @brief calculate the threshold for iterative-diagonalization for each band
9494
void cal_ethr_band(const double& wk, const double* wg, const double& ethr, std::vector<double>& ethrs);
9595

source/module_hsolver/hsolver_pw_sdft.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void HSolverPW_SDFT<Device>::solve(hamilt::Hamilt<std::complex<double>, Device>*
4444
{
4545
this->updatePsiK(pHamilt, psi, ik);
4646
// template add precondition calculating here
47-
update_precondition(precondition, ik, this->wfc_basis->npwk[ik], pes->pot->get_vl_of_0());
47+
this->update_precondition(precondition, ik, this->wfc_basis->npwk[ik], pes->pot->get_vl_of_0());
4848
/// solve eigenvector and eigenvalue for H(k)
4949
double* p_eigenvalues = &(pes->ekb(ik, 0));
5050
this->hamiltSolvePsiK(pHamilt, psi, precondition, p_eigenvalues);

source/module_hsolver/test/test_hsolver_sdft.cpp

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,24 @@ class TestHSolverPW_SDFT : public ::testing::Test
138138
wavefunc wf;
139139
StoChe<double> stoche;
140140
hamilt::HamiltSdftPW<std::complex<double>>* p_hamilt_sto = nullptr;
141-
hsolver::HSolverPW_SDFT hs_d = hsolver::HSolverPW_SDFT(&kv,
142-
&pwbk,
143-
&wf,
144-
stowf,
145-
stoche,
146-
p_hamilt_sto,
147-
"scf",
148-
"pw",
149-
"cg",
150-
false,
151-
PARAM.sys.use_uspp,
152-
PARAM.input.nspin,
153-
hsolver::DiagoIterAssist<std::complex<double>>::SCF_ITER,
154-
hsolver::DiagoIterAssist<std::complex<double>>::PW_DIAG_NMAX,
155-
hsolver::DiagoIterAssist<std::complex<double>>::PW_DIAG_THR,
156-
hsolver::DiagoIterAssist<std::complex<double>>::need_subspace,
157-
false);
141+
hsolver::HSolverPW_SDFT<base_device::DEVICE_CPU> hs_d = hsolver::HSolverPW_SDFT<base_device::DEVICE_CPU>(
142+
&kv,
143+
&pwbk,
144+
&wf,
145+
stowf,
146+
stoche,
147+
p_hamilt_sto,
148+
"scf",
149+
"pw",
150+
"cg",
151+
false,
152+
PARAM.sys.use_uspp,
153+
PARAM.input.nspin,
154+
hsolver::DiagoIterAssist<std::complex<double>>::SCF_ITER,
155+
hsolver::DiagoIterAssist<std::complex<double>>::PW_DIAG_NMAX,
156+
hsolver::DiagoIterAssist<std::complex<double>>::PW_DIAG_THR,
157+
hsolver::DiagoIterAssist<std::complex<double>>::need_subspace,
158+
false);
158159

159160
hamilt::Hamilt<std::complex<double>> hamilt_test_d;
160161

0 commit comments

Comments
 (0)