Skip to content

Commit 05066b9

Browse files
committed
save
1 parent 60403f5 commit 05066b9

File tree

2 files changed

+46
-47
lines changed

2 files changed

+46
-47
lines changed

source/module_rdmft/rdmft.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <complex>
2121
#include <fstream>
2222
#include <sstream>
23+
#include <algorithm>
2324

2425
// used by class Veff_rdmft
2526
//#include "veff_lcao.h"
@@ -219,7 +220,7 @@ void RDMFT<TK, TR>::cal_Hk_Hpsi()
219220
{
220221
hsk_TV->set_zero_hk();
221222
hsk_hartree->set_zero_hk();
222-
set_zero_vector(HK_XC);
223+
std::fill(HK_XC.begin(), HK_XC.end(), 0.0);
223224

224225
// get the HK with ik-th k vector, the result is stored in HK_TV, HK_hartree and HK_XC respectively
225226
V_local->contributeHk(ik);
@@ -236,7 +237,6 @@ void RDMFT<TK, TR>::cal_Hk_Hpsi()
236237
#ifdef __EXX
237238
if(GlobalC::exx_info.info_global.cal_exx)
238239
{
239-
// set_zero_vector(HK_exx_XC);
240240
hsk_exx_XC->set_zero_hk();
241241

242242
V_exx_XC->contributeHk(ik);
@@ -248,7 +248,6 @@ void RDMFT<TK, TR>::cal_Hk_Hpsi()
248248
#endif
249249
if( !only_exx_type )
250250
{
251-
// set_zero_vector(HK_dft_XC);
252251
hsk_dft_XC->set_zero_hk();
253252

254253
V_dft_XC->contributeHk(ik);

source/module_rdmft/rdmft_tools.h

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -51,41 +51,41 @@ namespace rdmft
5151
{
5252

5353

54-
//for print matrix
55-
template <typename TK>
56-
void printMatrix_pointer(int M, int N, const TK* matrixA, std::string nameA)
57-
{
58-
std::cout << "\n" << nameA << ": \n";
59-
for(int i=0; i<M; ++i)
60-
{
61-
for(int j=0; j<N; ++j)
62-
{
63-
if( j%5 == 0 ) { std::cout << "\n";
64-
}
65-
std::cout << *(matrixA+i*N+j) << " ";
66-
}
67-
std::cout << "\n";
68-
}
69-
std::cout << std::endl;
70-
}
71-
72-
73-
template <typename TK>
74-
void printMatrix_vector(int M, int N, const std::vector<TK>& matrixA, std::string nameA)
75-
{
76-
std::cout << "\n" << nameA << ": \n";
77-
for(int i=0; i<M; ++i)
78-
{
79-
for(int j=0; j<N; ++j)
80-
{
81-
if( j%5 == 0 ) { std::cout << "\n";
82-
}
83-
std::cout << matrixA[i*N+j] << " ";
84-
}
85-
std::cout << "\n\n";
86-
}
87-
std::cout << std::endl;
88-
}
54+
// //for print matrix
55+
// template <typename TK>
56+
// void printMatrix_pointer(int M, int N, const TK* matrixA, std::string nameA)
57+
// {
58+
// std::cout << "\n" << nameA << ": \n";
59+
// for(int i=0; i<M; ++i)
60+
// {
61+
// for(int j=0; j<N; ++j)
62+
// {
63+
// if( j%5 == 0 ) { std::cout << "\n";
64+
// }
65+
// std::cout << *(matrixA+i*N+j) << " ";
66+
// }
67+
// std::cout << "\n";
68+
// }
69+
// std::cout << std::endl;
70+
// }
71+
72+
73+
// template <typename TK>
74+
// void printMatrix_vector(int M, int N, const std::vector<TK>& matrixA, std::string nameA)
75+
// {
76+
// std::cout << "\n" << nameA << ": \n";
77+
// for(int i=0; i<M; ++i)
78+
// {
79+
// for(int j=0; j<N; ++j)
80+
// {
81+
// if( j%5 == 0 ) { std::cout << "\n";
82+
// }
83+
// std::cout << matrixA[i*N+j] << " ";
84+
// }
85+
// std::cout << "\n\n";
86+
// }
87+
// std::cout << std::endl;
88+
// }
8989

9090

9191
// now support XC_func_rdmft = "hf", "muller", "power", "pbe", "pbe0". "wp22" and "cwp22" is realizing.
@@ -101,15 +101,15 @@ void set_zero_vector(std::vector<TK>& HK)
101101
}
102102

103103

104-
template <typename TK>
105-
void set_zero_psi(psi::Psi<TK>& wfc)
106-
{
107-
TK* pwfc_in = &wfc(0, 0, 0);
108-
#ifdef _OPENMP
109-
#pragma omp parallel for schedule(static, 1024)
110-
#endif
111-
for(int i=0; i<wfc.size(); ++i) pwfc_in[i] = 0.0;
112-
}
104+
// template <typename TK>
105+
// void set_zero_psi(psi::Psi<TK>& wfc)
106+
// {
107+
// TK* pwfc_in = &wfc(0, 0, 0);
108+
// #ifdef _OPENMP
109+
// #pragma omp parallel for schedule(static, 1024)
110+
// #endif
111+
// for(int i=0; i<wfc.size(); ++i) pwfc_in[i] = 0.0;
112+
// }
113113

114114

115115
template <typename TK>

0 commit comments

Comments
 (0)