Skip to content

Commit 35b35db

Browse files
authored
Merge branch 'develop' into dsp
2 parents 948056b + 7e6eee7 commit 35b35db

File tree

15 files changed

+34
-63
lines changed

15 files changed

+34
-63
lines changed

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
uses: actions/checkout@v4
1616
- name: Install Requirements for Coverage Testing
1717
run: |
18-
apt update && apt install -y lcov
18+
apt update && apt install -y lcov gpg
1919
- name: Building
2020
run: |
21-
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
21+
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
2222
cmake --build build -j`nproc`
2323
cmake --install build
2424
- name: Testing

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
--from-ref ${{ github.event.pull_request.base.sha }}
4040
--to-ref ${{ github.event.pull_request.head.sha }}
4141
continue-on-error: true
42-
- uses: pre-commit-ci/lite-action@v1.0.3
42+
- uses: pre-commit-ci/lite-action@v1.1.0
4343

4444
- name: Build
4545
run: |

source/module_elecstate/elecstate_lcao_tddft.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,8 @@ void ElecStateLCAO_TDDFT::psiToRho_td(const psi::Psi<std::complex<double>>& psi)
2222

2323
// this part for calculating DMK in 2d-block format, not used for charge now
2424
// psi::Psi<std::complex<double>> dm_k_2d();
25-
26-
if (PARAM.inp.ks_solver == "genelpa" || PARAM.inp.ks_solver == "scalapack_gvx"
27-
|| PARAM.inp.ks_solver == "lapack") // Peize Lin test 2019-05-15
28-
{
29-
elecstate::cal_dm_psi(this->DM->get_paraV_pointer(), this->wg, psi, *(this->DM));
30-
this->DM->cal_DMR();
31-
}
25+
elecstate::cal_dm_psi(this->DM->get_paraV_pointer(), this->wg, psi, *(this->DM));
26+
this->DM->cal_DMR();
3227

3328
for (int is = 0; is < PARAM.inp.nspin; is++)
3429
{

source/module_elecstate/potentials/H_TDDFT_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int H_TDDFT_pw::check_ncut(int t_type)
227227
break;
228228

229229
case 3:
230-
ncut = 1;
230+
ncut = 2;
231231
break;
232232

233233
// case 4:

source/module_hsolver/diago_bpcg.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace hsolver {
2424
* @tparam Device The device used for calculations (e.g., cpu or gpu).
2525
*/
2626
template <typename T = std::complex<double>, typename Device = base_device::DEVICE_CPU>
27-
class DiagoBPCG : public DiagH<T, Device>
27+
class DiagoBPCG
2828
{
2929
private:
3030
// Note GetTypeReal<T>::type will
@@ -56,15 +56,15 @@ class DiagoBPCG : public DiagH<T, Device>
5656
void init_iter(const psi::Psi<T, Device> &psi_in);
5757

5858
/**
59-
* @brief Diagonalize the Hamiltonian using the CG method.
59+
* @brief Diagonalize the Hamiltonian using the BPCG method.
6060
*
61-
* This function is an override function for the CG method. It is called by the HsolverPW::solve() function.
61+
* This function is called by the HsolverPW::solve() function.
6262
*
6363
* @param phm_in A pointer to the hamilt::Hamilt object representing the Hamiltonian operator.
6464
* @param psi The input wavefunction psi matrix with [dim: n_basis x n_band, column major].
6565
* @param eigenvalue_in Pointer to the eigen array with [dim: n_band, column major].
6666
*/
67-
void diag(hamilt::Hamilt<T, Device> *phm_in, psi::Psi<T, Device> &psi, Real *eigenvalue_in) override;
67+
void diag(hamilt::Hamilt<T, Device> *phm_in, psi::Psi<T, Device> &psi, Real *eigenvalue_in);
6868

6969

7070
private:

source/module_hsolver/diago_cg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace hsolver {
1414

1515
template <typename T, typename Device = base_device::DEVICE_CPU>
16-
class DiagoCG final : public DiagH<T, Device>
16+
class DiagoCG final
1717
{
1818
// private: accessibility within class is private by default
1919
// Note GetTypeReal<T>::type will
@@ -36,11 +36,11 @@ class DiagoCG final : public DiagH<T, Device>
3636
const int& pw_diag_nmax,
3737
const int& nproc_in_pool);
3838

39-
~DiagoCG() override;
39+
~DiagoCG();
4040

4141
// virtual void init(){};
4242
// refactor hpsi_info
43-
// this is the override function diag() for CG method
43+
// this is the diag() function for CG method
4444
void diag(const Func& hpsi_func, const Func& spsi_func, ct::Tensor& psi, ct::Tensor& eigen, const ct::Tensor& prec = {});
4545

4646
private:

source/module_hsolver/diago_dav_subspace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace hsolver
1111
{
1212

1313
template <typename T = std::complex<double>, typename Device = base_device::DEVICE_CPU>
14-
class Diago_DavSubspace : public DiagH<T, Device>
14+
class Diago_DavSubspace
1515
{
1616
private:
1717
// Note GetTypeReal<T>::type will
@@ -29,7 +29,7 @@ class Diago_DavSubspace : public DiagH<T, Device>
2929
const bool& need_subspace_in,
3030
const diag_comm_info& diag_comm_in);
3131

32-
virtual ~Diago_DavSubspace() override;
32+
~Diago_DavSubspace();
3333

3434
// See diago_david.h for information on the HPsiFunc function type
3535
using HPsiFunc = std::function<void(T*, T*, const int, const int)>;

source/module_hsolver/diago_david.h

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

1010
template <typename T = std::complex<double>, typename Device = base_device::DEVICE_CPU>
11-
class DiagoDavid : public DiagH<T, Device>
11+
class DiagoDavid
1212
{
1313
private:
1414
// Note GetTypeReal<T>::type will
@@ -25,7 +25,7 @@ class DiagoDavid : public DiagH<T, Device>
2525
const bool use_paw_in,
2626
const diag_comm_info& diag_comm_in);
2727

28-
virtual ~DiagoDavid() override;
28+
~DiagoDavid();
2929

3030

3131
// declare type of matrix-blockvector functions.

source/module_hsolver/hsolver_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
228228
const std::initializer_list<std::string> _methods = {"cg", "dav", "dav_subspace", "bpcg"};
229229
if (std::find(std::begin(_methods), std::end(_methods), this->method) == std::end(_methods))
230230
{
231-
ModuleBase::WARNING_QUIT("HSolverPW::solve", "This method of DiagH is not supported!");
231+
ModuleBase::WARNING_QUIT("HSolverPW::solve", "This type of eigensolver is not supported!");
232232
}
233233

234234
// prepare for the precondition of diagonalization

source/module_hsolver/test/test_hsolver.cpp

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,28 +83,4 @@ class TestHSolver : public ::testing::Test
8383

8484
// double test_diagethr_d = hs_d.set_diagethr(0.0, 0, 0, 0.0);
8585
// EXPECT_EQ(test_diagethr_d, 0.0);
86-
// }
87-
namespace hsolver
88-
{
89-
template <typename T, typename Device = base_device::DEVICE_CPU>
90-
class DiagH_mock : public DiagH<T, Device>
91-
{
92-
private:
93-
using Real = typename GetTypeReal<T>::type;
94-
95-
public:
96-
DiagH_mock()
97-
{
98-
}
99-
~DiagH_mock()
100-
{
101-
}
102-
103-
void diag(hamilt::Hamilt<T, Device>* phm_in, psi::Psi<T, Device>& psi, Real* eigenvalue_in)
104-
{
105-
return;
106-
}
107-
};
108-
template class DiagH_mock<std::complex<float>>;
109-
template class DiagH_mock<std::complex<double>>;
110-
}
86+
// }

0 commit comments

Comments
 (0)