forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: remove lcao_fun.cpp (#5481)
* Refactor: remove lcao_fun.cpp * use original format
- Loading branch information
Showing
8 changed files
with
115 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ if(ENABLE_LCAO) | |
lcao_gets.cpp | ||
lcao_others.cpp | ||
lcao_init_after_vc.cpp | ||
lcao_fun.cpp | ||
) | ||
endif() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,89 @@ | ||
#include "output_mat_sparse.h" | ||
|
||
#include "cal_r_overlap_R.h" | ||
#include "module_hamilt_pw/hamilt_pwdft/global.h" // for ucell | ||
#include "write_HS_R.h" | ||
#include "module_io/cal_r_overlap_R.h" | ||
#include "module_io/write_HS_R.h" | ||
|
||
namespace ModuleIO | ||
{ | ||
|
||
template <typename T> | ||
Output_Mat_Sparse<T>::Output_Mat_Sparse(int out_mat_hsR, | ||
int out_mat_dh, | ||
int out_mat_t, | ||
int out_mat_r, | ||
int istep, | ||
const ModuleBase::matrix& v_eff, | ||
const Parallel_Orbitals& pv, | ||
Gint_k& gint_k, // mohan add 2024-04-01 | ||
const TwoCenterBundle& two_center_bundle, | ||
const LCAO_Orbitals& orb, | ||
Grid_Driver& grid, // mohan add 2024-04-06 | ||
const K_Vectors& kv, | ||
hamilt::Hamilt<T>* p_ham) | ||
: _out_mat_hsR(out_mat_hsR), _out_mat_dh(out_mat_dh), _out_mat_t(out_mat_t), _out_mat_r(out_mat_r), _istep(istep), | ||
_v_eff(v_eff), _pv(pv), orb_(orb), _gint_k(gint_k), // mohan add 2024-04-01 | ||
two_center_bundle_(two_center_bundle), _grid(grid), // mohan add 2024-04-06 | ||
_kv(kv), _p_ham(p_ham) {} | ||
|
||
template <> | ||
void Output_Mat_Sparse<double>::write() | ||
void output_mat_sparse(const bool& out_mat_hsR, | ||
const bool& out_mat_dh, | ||
const bool& out_mat_t, | ||
const bool& out_mat_r, | ||
const int& istep, | ||
const ModuleBase::matrix& v_eff, | ||
const Parallel_Orbitals& pv, | ||
Gint_k& gint_k, | ||
const TwoCenterBundle& two_center_bundle, | ||
const LCAO_Orbitals& orb, | ||
UnitCell& ucell, | ||
Grid_Driver& grid, | ||
const K_Vectors& kv, | ||
hamilt::Hamilt<double>* p_ham) | ||
{ | ||
} | ||
|
||
template <> | ||
void Output_Mat_Sparse<std::complex<double>>::write() | ||
void output_mat_sparse(const bool& out_mat_hsR, | ||
const bool& out_mat_dh, | ||
const bool& out_mat_t, | ||
const bool& out_mat_r, | ||
const int& istep, | ||
const ModuleBase::matrix& v_eff, | ||
const Parallel_Orbitals& pv, | ||
Gint_k& gint_k, | ||
const TwoCenterBundle& two_center_bundle, | ||
const LCAO_Orbitals& orb, | ||
UnitCell& ucell, | ||
Grid_Driver& grid, | ||
const K_Vectors& kv, | ||
hamilt::Hamilt<std::complex<double>>* p_ham) | ||
{ | ||
LCAO_HS_Arrays HS_Arrays; // store sparse arrays | ||
|
||
//! generate a file containing the Hamiltonian and S(overlap) matrices | ||
if (_out_mat_hsR) | ||
if (out_mat_hsR) | ||
{ | ||
output_HSR(_istep, this->_v_eff, this->_pv, HS_Arrays, this->_grid, _kv, _p_ham); | ||
output_HSR(istep, v_eff, pv, HS_Arrays, grid, kv, p_ham); | ||
} | ||
|
||
//! generate a file containing the kinetic energy matrix | ||
if (_out_mat_t) | ||
if (out_mat_t) | ||
{ | ||
output_TR(_istep, | ||
GlobalC::ucell, | ||
this->_pv, | ||
HS_Arrays, | ||
this->_grid, | ||
two_center_bundle_, | ||
orb_ | ||
); // LiuXh add 2019-07-15 | ||
output_TR(istep, ucell, pv, HS_Arrays, grid, two_center_bundle, orb); | ||
} | ||
|
||
//! generate a file containing the derivatives of the Hamiltonian matrix (in Ry/Bohr) | ||
if (_out_mat_dh) | ||
if (out_mat_dh) | ||
{ | ||
output_dHR(_istep, | ||
this->_v_eff, | ||
this->_gint_k, // mohan add 2024-04-01 | ||
this->_pv, | ||
output_dHR(istep, | ||
v_eff, | ||
gint_k, // mohan add 2024-04-01 | ||
pv, | ||
HS_Arrays, | ||
this->_grid, // mohan add 2024-04-06 | ||
two_center_bundle_, | ||
orb_, | ||
_kv); // LiuXh add 2019-07-15 | ||
grid, // mohan add 2024-04-06 | ||
two_center_bundle, | ||
orb, | ||
kv); // LiuXh add 2019-07-15 | ||
} | ||
|
||
// add by jingan for out r_R matrix 2019.8.14 | ||
if (_out_mat_r) | ||
if (out_mat_r) | ||
{ | ||
cal_r_overlap_R r_matrix; | ||
r_matrix.init(this->_pv, orb_); | ||
if (_out_mat_hsR) | ||
r_matrix.init(pv, orb); | ||
if (out_mat_hsR) | ||
{ | ||
r_matrix.out_rR_other(_istep, HS_Arrays.output_R_coor); | ||
r_matrix.out_rR_other(istep, HS_Arrays.output_R_coor); | ||
} | ||
else | ||
{ | ||
r_matrix.out_rR(_istep); | ||
r_matrix.out_rR(istep); | ||
} | ||
} | ||
|
||
return; | ||
} | ||
|
||
template class Output_Mat_Sparse<double>; | ||
template class Output_Mat_Sparse<std::complex<double>>; | ||
|
||
} // namespace ModuleIO |
Oops, something went wrong.