Skip to content

Commit

Permalink
revert some incorrect changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dzzz2001 committed Jan 18, 2025
1 parent f20de93 commit 7cfd5ef
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 43 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,3 @@ time.json
__pycache__
abacus.json
*.npy
r0*/*
tests/*
TD*/*
cmake/*
*.nsys-rep
*.sh
1 change: 0 additions & 1 deletion deps/LibComm
Submodule LibComm deleted from ec9845
1 change: 0 additions & 1 deletion deps/LibRI
Submodule LibRI deleted from bd299f
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include "operator_lcao/td_nonlocal_lcao.h"
#include "operator_lcao/veff_lcao.h"

#include <memory>
namespace hamilt
{

Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#ifdef __EXX
#include "module_ri/Exx_LRI.h"
#endif
#include <memory>
namespace hamilt
{

Expand Down
25 changes: 1 addition & 24 deletions source/module_hamilt_lcao/module_gint/new_gint/gint_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,4 @@ inline int floor_div(const int a, const int b)
inline int ceil_div(const int a, const int b)
{
return a / b + (a % b != 0 && (a ^ b) > 0);
};

// for debug
#include <iostream>
#include <fstream>
#include <string>

template <typename T>
void writeArrayToFile(T* array, int n, const std::string& filename) {
std::ofstream outFile(filename);

if (!outFile.is_open()) {
std::cerr << "can't open file: " << filename << std::endl;
return;
}

for (int i = 0; i < n; ++i) {
outFile <<array[i] << std::endl;
}

outFile.close();

std::cout << "successfully write data to: " << filename << std::endl;
}
};
12 changes: 6 additions & 6 deletions source/module_io/write_eband_terms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ void write_eband_terms(const int nspin,
hamilt::HContainer<TR> v_pp_local_R_ao(pv);
if_gamma_fix(v_pp_local_R_ao);
std::vector<std::vector<double>> e_orb_pp_local;
// hamilt::Veff<hamilt::OperatorLCAO<TK, TR>> v_pp_local_op(gint, &v_pp_local_k_ao, kv.kvec_d, &pot_local, &v_pp_local_R_ao, &ucell, orb_cutoff, &gd, nspin);
// v_pp_local_op.contributeHR();
hamilt::Veff<hamilt::OperatorLCAO<TK, TR>> v_pp_local_op(gint, &v_pp_local_k_ao, kv.kvec_d, &pot_local, &v_pp_local_R_ao, &ucell, orb_cutoff, &gd, nspin);
v_pp_local_op.contributeHR();
for (int ik = 0;ik < kv.get_nks();++ik)
{
v_pp_local_k_ao.set_zero_hk();
// dynamic_cast<hamilt::OperatorLCAO<TK, TR>*>(&v_pp_local_op)->contributeHk(ik);
dynamic_cast<hamilt::OperatorLCAO<TK, TR>*>(&v_pp_local_op)->contributeHk(ik);
e_orb_pp_local.emplace_back(orbital_energy(ik, nbands,
cVc(v_pp_local_k_ao.get_hk(), &psi(ik, 0, 0), nbasis, nbands, *pv, p2d), p2d));
}
Expand Down Expand Up @@ -143,9 +143,9 @@ void write_eband_terms(const int nspin,
std::vector<hamilt::Veff<hamilt::OperatorLCAO<TK, TR>>*> v_hartree_op(nspin0);
for (int is = 0; is < nspin0; ++is)
{
// v_hartree_op[is] = new hamilt::Veff<hamilt::OperatorLCAO<TK, TR>>(gint,
// &v_hartree_k_ao, kv.kvec_d, &pot_hartree, &v_hartree_R_ao[is], &ucell, orb_cutoff, &gd, nspin);
// v_hartree_op[is]->contributeHR();
v_hartree_op[is] = new hamilt::Veff<hamilt::OperatorLCAO<TK, TR>>(gint,
&v_hartree_k_ao, kv.kvec_d, &pot_hartree, &v_hartree_R_ao[is], &ucell, orb_cutoff, &gd, nspin);
v_hartree_op[is]->contributeHR();
}
std::vector<std::vector<double>> e_orb_hartree;
for (int ik = 0;ik < kv.get_nks();++ik)
Expand Down
6 changes: 3 additions & 3 deletions source/module_io/write_vxc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ void write_Vxc(const int nspin,
std::vector<hamilt::Veff<hamilt::OperatorLCAO<TK, TR>>*> vxcs_op_ao(nspin0);
for (int is = 0; is < nspin0; ++is)
{
// vxcs_op_ao[is] = new hamilt::Veff<hamilt::OperatorLCAO<TK, TR>>(gint,
// &vxc_k_ao, kv.kvec_d, potxc, &vxcs_R_ao[is], &ucell, orb_cutoff, &gd, nspin);
vxcs_op_ao[is] = new hamilt::Veff<hamilt::OperatorLCAO<TK, TR>>(gint,
&vxc_k_ao, kv.kvec_d, potxc, &vxcs_R_ao[is], &ucell, orb_cutoff, &gd, nspin);

// vxcs_op_ao[is]->contributeHR();
vxcs_op_ao[is]->contributeHR();
}
std::vector<std::vector<double>> e_orb_locxc; // orbital energy (local XC)
std::vector<std::vector<double>> e_orb_tot; // orbital energy (total)
Expand Down

0 comments on commit 7cfd5ef

Please sign in to comment.