forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 145
Refactor: new gint module #5869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 50 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
469cfb4
remove redundant parameters
dzzz2001 3a67b8f
version 0.0
dzzz2001 df73065
inline some simple functions
dzzz2001 c681070
change type alias
dzzz2001 1b9477e
version 0.1
dzzz2001 0b84ed3
version 0.2
dzzz2001 ad14583
for test
dzzz2001 a62c3dd
fix some bugs, the first correct version
dzzz2001 db36b26
improve efficiency ang rename some variables
dzzz2001 bfcc2fb
small change
dzzz2001 c1e5b4d
add openmp support to gint_vl
dzzz2001 4ecfb0c
remove some comments
dzzz2001 ef8f3f1
remove some comments
dzzz2001 e7d402a
remove some unused code related to spin in gint_k
dzzz2001 036cf85
enable rho calculation
dzzz2001 f223153
support fvl calculation
dzzz2001 747ade5
add nspin=4 support and change interface
dzzz2001 45a428c
change some raw pointer to shared_ptr
dzzz2001 b813dd3
rename hamilt::HContainer
dzzz2001 06f8ead
support tau calculation
dzzz2001 17a2f62
fix a bug
dzzz2001 10c2bb4
add vlocal metagga support
dzzz2001 4b0adb2
support force metagga calculation
dzzz2001 ad9157e
change shared_ptr to raw pointer of GintAtom
dzzz2001 0bf9da2
improve performance
dzzz2001 453206f
remove destructor
dzzz2001 d1fe00d
add timer
dzzz2001 db719d2
add timer
dzzz2001 a525613
improve performance
dzzz2001 d276af0
change 2D ptr to 1D ptr
dzzz2001 9de506c
modify zeros function
dzzz2001 d86de0f
replace array pool with vector
dzzz2001 e0fb551
Revert "Refactor:remove cal_tau from ElecStateLCAO (#5802)"
dzzz2001 12edd12
fix a bug
dzzz2001 5c39340
remove some rudundant functions
dzzz2001 4481063
simplify member function of biggrid_info
dzzz2001 b6c17ce
rename some variables
dzzz2001 56cb9bb
unify some variables name
dzzz2001 6c488db
change some variable to static
dzzz2001 d11d4c7
fix a bug and delete a redundant operation
dzzz2001 c9b37f2
add new gint interface
dzzz2001 f20de93
change new_grid_tech to new_gint
dzzz2001 7cfd5ef
revert some incorrect changes
dzzz2001 156ee88
Merge branch 'develop' into gint-new
dzzz2001 ea17559
add a unit test
dzzz2001 b267ee6
change some names
dzzz2001 af6f565
check nullptr
dzzz2001 78eef21
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 0c84005
Merge branch 'develop' into gint-new
dzzz2001 3b02824
Merge branch 'develop' into gint-new
dzzz2001 312699d
change DM to dm
dzzz2001 4b23da0
change HRGint to hr_gint
dzzz2001 afaf54d
Merge remote-tracking branch 'upstream/develop' into gint-new
dzzz2001 e472b8f
modify variable name
dzzz2001 12c9ce9
fix a bug
dzzz2001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,56 +1,49 @@ | ||
| #include "elecstate_lcao.h" | ||
| #include "elecstate_lcao_cal_tau.h" | ||
| #include "module_hamilt_lcao/module_gint/temp_gint/gint_interface.h" | ||
|
|
||
| #include "module_base/timer.h" | ||
|
|
||
| namespace elecstate | ||
| { | ||
|
|
||
| // calculate the kinetic energy density tau, multi-k case | ||
| void lcao_cal_tau_k(Gint_k* gint_k, | ||
| Charge* charge) | ||
| template <> | ||
| void ElecStateLCAO<std::complex<double>>::cal_tau(const psi::Psi<std::complex<double>>& psi) | ||
| { | ||
| ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); | ||
|
|
||
| for (int is = 0; is < PARAM.inp.nspin; is++) | ||
| { | ||
| ModuleBase::GlobalFunc::ZEROS(charge->kin_r[is], charge->nrxx); | ||
| ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); | ||
| } | ||
| Gint_inout inout1(charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin); | ||
| gint_k->cal_gint(&inout1); | ||
|
|
||
| #ifndef __NEW_GINT | ||
| Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin); | ||
| this->gint_k->cal_gint(&inout1); | ||
| #else | ||
| ModuleGint::cal_gint_tau(this->DM->get_DMR_vector(), PARAM.inp.nspin, this->charge->kin_r); | ||
| #endif | ||
| ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); | ||
| return; | ||
| } | ||
|
|
||
| // calculate the kinetic energy density tau, gamma-only case | ||
| void lcao_cal_tau_gamma(Gint_Gamma* gint_gamma, | ||
| Charge* charge) | ||
| template <> | ||
| void ElecStateLCAO<double>::cal_tau(const psi::Psi<double>& psi) | ||
| { | ||
| ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); | ||
|
|
||
| for (int is = 0; is < PARAM.inp.nspin; is++) | ||
| { | ||
| ModuleBase::GlobalFunc::ZEROS(charge->kin_r[is], charge->nrxx); | ||
| ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); | ||
| } | ||
| Gint_inout inout1(charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin); | ||
| gint_gamma->cal_gint(&inout1); | ||
| #ifndef __NEW_GINT | ||
| Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin); | ||
| this->gint_gamma->cal_gint(&inout1); | ||
| #else | ||
| ModuleGint::cal_gint_tau(this->DM->get_DMR_vector(), PARAM.inp.nspin, this->charge->kin_r); | ||
| #endif | ||
|
|
||
| ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); | ||
| return; | ||
| } | ||
| template <> | ||
| void lcao_cal_tau<double>(Gint_Gamma* gint_gamma, | ||
| Gint_k* gint_k, | ||
| Charge* charge) | ||
| { | ||
| lcao_cal_tau_gamma(gint_gamma, charge); | ||
| } | ||
| template <> | ||
| void lcao_cal_tau<complex<double>>(Gint_Gamma* gint_gamma, | ||
| Gint_k* gint_k, | ||
| Charge* charge) | ||
| { | ||
| lcao_cal_tau_k(gint_k, charge); | ||
| } | ||
|
|
||
| } // namespace elecstate | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.