Skip to content
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

Change namespace A::B{} to namespace A{namespace B{}} #309

Closed
wants to merge 43 commits into from

Conversation

PeizeLin
Copy link
Collaborator

Change namespace A::B{} to namespace A{namespace B{}}, since namespace A::B{} is a C++17 feature.

mohanchen and others added 30 commits March 28, 2024 09:02
* update timer, add std

* update the format of esolver_fp.cpp

* add description in esolver_fp.h

* update a few esolver files

* update esolver description for LCAO

* update some formats of esolver codes

* update esolver_ks_pw.cpp formats

* update formats of esolver_ks_pw.cpp and esolver_ks_pw.h

* update esolver_ks_lcao_tddft.cpp formats

* update format of esolver_sdft_pw.cpp

* update the format of esolver_sdft_pw_tool.cpp

* keep formating esolver_ks_pw.cpp

* formating esolver_of_interface.cpp

* change GlobalC::ucell to ucell in esolver_ks.cpp

* remove some GlobalC::ucell in esolver_sdft_pw.cpp
…ad_cube. (#3824)

Removed references to GlobalV variables
(defined in module_base/global_variable.h)
in function  and (which depends on ).
… MD calculation (#3837)

Co-authored-by: dyzheng <zhengdy@bjaisi.com>
* Delete examples/tddft/Absoption_spectrum/H2_length directory

* Delete examples/tddft/Absoption_spectrum/H2_vel directory

* Add files via upload

* Update input-main.md
* update timer, add std

* update the format of esolver_fp.cpp

* add description in esolver_fp.h

* update a few esolver files

* update esolver description for LCAO

* update some formats of esolver codes

* update esolver_ks_pw.cpp formats

* update formats of esolver_ks_pw.cpp and esolver_ks_pw.h

* update esolver_ks_lcao_tddft.cpp formats

* update format of esolver_sdft_pw.cpp

* update the format of esolver_sdft_pw_tool.cpp

* keep formating esolver_ks_pw.cpp

* formating esolver_of_interface.cpp

* change GlobalC::ucell to ucell in esolver_ks.cpp

* remove some GlobalC::ucell in esolver_sdft_pw.cpp

* refactor the code before getting rid of RA in esolver_lcao

* refactor before getting rid of LOWF

* refactor before getting rid of LCAO_hamilt.h and LCAO_matrix.h

* refactor wavefunc_in_pw

* refactor density matrix

* refactor the format cal_dm_psi.cpp

* format forces.cpp

* refactor esolver_of_tool.cpp

* change member function beforescf in Esolver to before_scf

* change afterscf to after_scf

* change updatepot to update_pot

* change eachiterinit to iter_init, change eachiterfinish to iter_finish

* refactor esolvers, change member function names of most esolvers

* reformat esolver.h

* update tests for esolvers
some variables initialized
* update timer, add std

* update the format of esolver_fp.cpp

* add description in esolver_fp.h

* update a few esolver files

* update esolver description for LCAO

* update some formats of esolver codes

* update esolver_ks_pw.cpp formats

* update formats of esolver_ks_pw.cpp and esolver_ks_pw.h

* update esolver_ks_lcao_tddft.cpp formats

* update format of esolver_sdft_pw.cpp

* update the format of esolver_sdft_pw_tool.cpp

* keep formating esolver_ks_pw.cpp

* formating esolver_of_interface.cpp

* change GlobalC::ucell to ucell in esolver_ks.cpp

* remove some GlobalC::ucell in esolver_sdft_pw.cpp

* refactor the code before getting rid of RA in esolver_lcao

* refactor before getting rid of LOWF

* refactor before getting rid of LCAO_hamilt.h and LCAO_matrix.h

* refactor wavefunc_in_pw

* refactor density matrix

* refactor the format cal_dm_psi.cpp

* format forces.cpp

* refactor esolver_of_tool.cpp

* change member function beforescf in Esolver to before_scf

* change afterscf to after_scf

* change updatepot to update_pot

* change eachiterinit to iter_init, change eachiterfinish to iter_finish

* refactor esolvers, change member function names of most esolvers

* reformat esolver.h

* update tests for esolvers

* add TITLE in esolver_ks_lcao

* update esolver_ks_lcao

* update esolver_lcao

* update timer::tick in esolver_lcao

* try to delete LCAO_Matrix in LCAO_Hamilt, and try to delete Parallel_Orbitals in Force_k

* fix the compiling issue with LCAO_hamilt.hpp

* try to divide the FORCE_k.cpp into several small files
* Update berryphase.cpp

Initialize ik_1 and ik_2 in berryphase.cpp

* Update berryphase.cpp

Initialize modulus in berryphase.cpp
* update timer, add std

* update the format of esolver_fp.cpp

* add description in esolver_fp.h

* update a few esolver files

* update esolver description for LCAO

* update some formats of esolver codes

* update esolver_ks_pw.cpp formats

* update formats of esolver_ks_pw.cpp and esolver_ks_pw.h

* update esolver_ks_lcao_tddft.cpp formats

* update format of esolver_sdft_pw.cpp

* update the format of esolver_sdft_pw_tool.cpp

* keep formating esolver_ks_pw.cpp

* formating esolver_of_interface.cpp

* change GlobalC::ucell to ucell in esolver_ks.cpp

* remove some GlobalC::ucell in esolver_sdft_pw.cpp

* refactor the code before getting rid of RA in esolver_lcao

* refactor before getting rid of LOWF

* refactor before getting rid of LCAO_hamilt.h and LCAO_matrix.h

* refactor wavefunc_in_pw

* refactor density matrix

* refactor the format cal_dm_psi.cpp

* format forces.cpp

* refactor esolver_of_tool.cpp

* change member function beforescf in Esolver to before_scf

* change afterscf to after_scf

* change updatepot to update_pot

* change eachiterinit to iter_init, change eachiterfinish to iter_finish

* refactor esolvers, change member function names of most esolvers

* reformat esolver.h

* update tests for esolvers

* add TITLE in esolver_ks_lcao

* update esolver_ks_lcao

* update esolver_lcao

* update timer::tick in esolver_lcao

* try to delete LCAO_Matrix in LCAO_Hamilt, and try to delete Parallel_Orbitals in Force_k

* fix the compiling issue with LCAO_hamilt.hpp

* try to divide the FORCE_k.cpp into several small files

* divide FORCE_k into foverlap_k.cpp ftvnl_dphi_k.cpp fvl_dphi_k.cpp fvnl_dbeta_k.cpp four files

* get rid of UHM in FORCE_k.cpp

* cannot compile, but I have modified some files in order to get rid of Gint_k and Gint_Gamma in UHM

* keep updating, cannot run

* update write_Vxc, cannot run yet

* keep updating gint_gamma and gint_k

* update LCAO_matrix.cpp

* divide force files, and update Makefile.Objects

* update LCAO_hamilt.cpp
initialize variable
* Fix: not use static member in DFTUNew

* Test: add unit test of DFTUNew

* Test: add nspin=2 test and delete GlobalV::CURRENT_SPIN in DFTUNew

* add annotation for dftu.h

* Refactor: new dftu code with suggestions by developers

---------

Co-authored-by: dyzheng <zhengdy@bjaisi.com>
…nction (#3893)

* fix a bug in get_dmk_vector() and make some refactor of get-function

* override to avoid compile error
* refactor sparse output

* read HexxR in CSR

* parallel support

* remove test code

* comments

* recover multiple process

* refactor singleR

* change func names
* initialize some variables

* fix a semicolon

* Update sincos.cpp

* Update mathzone_add1.cpp

* Update mathzone_add1.cpp

* Update opt_DCsrch.cpp

* Update broyden_mixing.cpp

* Update pulay_mixing.cpp

* Update math_sphbes_test.cpp

* Update ORB_gen_tables.cpp

* Update ORB_table_phi.cpp

* Update math_sphbes_test.cpp
Co-authored-by: dyzheng <zhengdy@bjaisi.com>
Co-authored-by: Lukai Lin <14197186+lukai-lin@user.noreply.gitee.com>
Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
Co-authored-by: charches <charches@DESKTOP-AB7IADE>
Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
Initialize variable "no_use_c4"

Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
bot10032 and others added 13 commits April 3, 2024 16:20
Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
* update timer, add std

* update the format of esolver_fp.cpp

* add description in esolver_fp.h

* update a few esolver files

* update esolver description for LCAO

* update some formats of esolver codes

* update esolver_ks_pw.cpp formats

* update formats of esolver_ks_pw.cpp and esolver_ks_pw.h

* update esolver_ks_lcao_tddft.cpp formats

* update format of esolver_sdft_pw.cpp

* update the format of esolver_sdft_pw_tool.cpp

* keep formating esolver_ks_pw.cpp

* formating esolver_of_interface.cpp

* change GlobalC::ucell to ucell in esolver_ks.cpp

* remove some GlobalC::ucell in esolver_sdft_pw.cpp

* refactor the code before getting rid of RA in esolver_lcao

* refactor before getting rid of LOWF

* refactor before getting rid of LCAO_hamilt.h and LCAO_matrix.h

* refactor wavefunc_in_pw

* refactor density matrix

* refactor the format cal_dm_psi.cpp

* format forces.cpp

* refactor esolver_of_tool.cpp

* change member function beforescf in Esolver to before_scf

* change afterscf to after_scf

* change updatepot to update_pot

* change eachiterinit to iter_init, change eachiterfinish to iter_finish

* refactor esolvers, change member function names of most esolvers

* reformat esolver.h

* update tests for esolvers

* add TITLE in esolver_ks_lcao

* update esolver_ks_lcao

* update esolver_lcao

* update timer::tick in esolver_lcao

* try to delete LCAO_Matrix in LCAO_Hamilt, and try to delete Parallel_Orbitals in Force_k

* fix the compiling issue with LCAO_hamilt.hpp

* try to divide the FORCE_k.cpp into several small files

* divide FORCE_k into foverlap_k.cpp ftvnl_dphi_k.cpp fvl_dphi_k.cpp fvnl_dbeta_k.cpp four files

* get rid of UHM in FORCE_k.cpp

* cannot compile, but I have modified some files in order to get rid of Gint_k and Gint_Gamma in UHM

* keep updating, cannot run

* update write_Vxc, cannot run yet

* keep updating gint_gamma and gint_k

* update LCAO_matrix.cpp

* divide force files, and update Makefile.Objects

* update LCAO_hamilt.cpp

* delete genH pointer in UHM

* divide LCAO_hamilt.cpp into small codes, grid_init.cpp is the first one

* update grid_init in esolver_ks_lcao

* add a new namespace named sparse_format, most of the functions that originally belong to LCAO_hamilt should be moved to sparse_format

* cannot find the mismatch of DFTU

* fix the DFTU error

* update
* update timer, add std

* update the format of esolver_fp.cpp

* add description in esolver_fp.h

* update a few esolver files

* update esolver description for LCAO

* update some formats of esolver codes

* update esolver_ks_pw.cpp formats

* update formats of esolver_ks_pw.cpp and esolver_ks_pw.h

* update esolver_ks_lcao_tddft.cpp formats

* update format of esolver_sdft_pw.cpp

* update the format of esolver_sdft_pw_tool.cpp

* keep formating esolver_ks_pw.cpp

* formating esolver_of_interface.cpp

* change GlobalC::ucell to ucell in esolver_ks.cpp

* remove some GlobalC::ucell in esolver_sdft_pw.cpp

* refactor the code before getting rid of RA in esolver_lcao

* refactor before getting rid of LOWF

* refactor before getting rid of LCAO_hamilt.h and LCAO_matrix.h

* refactor wavefunc_in_pw

* refactor density matrix

* refactor the format cal_dm_psi.cpp

* format forces.cpp

* refactor esolver_of_tool.cpp

* change member function beforescf in Esolver to before_scf

* change afterscf to after_scf

* change updatepot to update_pot

* change eachiterinit to iter_init, change eachiterfinish to iter_finish

* refactor esolvers, change member function names of most esolvers

* reformat esolver.h

* update tests for esolvers

* add TITLE in esolver_ks_lcao

* update esolver_ks_lcao

* update esolver_lcao

* update timer::tick in esolver_lcao

* try to delete LCAO_Matrix in LCAO_Hamilt, and try to delete Parallel_Orbitals in Force_k

* fix the compiling issue with LCAO_hamilt.hpp

* try to divide the FORCE_k.cpp into several small files

* divide FORCE_k into foverlap_k.cpp ftvnl_dphi_k.cpp fvl_dphi_k.cpp fvnl_dbeta_k.cpp four files

* get rid of UHM in FORCE_k.cpp

* cannot compile, but I have modified some files in order to get rid of Gint_k and Gint_Gamma in UHM

* keep updating, cannot run

* update write_Vxc, cannot run yet

* keep updating gint_gamma and gint_k

* update LCAO_matrix.cpp

* divide force files, and update Makefile.Objects

* update LCAO_hamilt.cpp

* delete genH pointer in UHM

* divide LCAO_hamilt.cpp into small codes, grid_init.cpp is the first one

* update grid_init in esolver_ks_lcao

* add a new namespace named sparse_format, most of the functions that originally belong to LCAO_hamilt should be moved to sparse_format

* cannot find the mismatch of DFTU

* fix the DFTU error

* update

* enable the test_memory function again by setting calcalculation parameter in INPUT file

* update memory record functions
Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
…(#3898)

* initial the file source/module_ri/RI_2D_Comm.cpp

* the second initialization of module_ri/RI_2D_Comm.cpp

* initialize the file ABFS-Construct-PCA

* initialize the file ABF_Costruct_

* initialize the file ABFs_Construct-PCA.cpp

---------

Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
* update timer, add std

* update the format of esolver_fp.cpp

* add description in esolver_fp.h

* update a few esolver files

* update esolver description for LCAO

* update some formats of esolver codes

* update esolver_ks_pw.cpp formats

* update formats of esolver_ks_pw.cpp and esolver_ks_pw.h

* update esolver_ks_lcao_tddft.cpp formats

* update format of esolver_sdft_pw.cpp

* update the format of esolver_sdft_pw_tool.cpp

* keep formating esolver_ks_pw.cpp

* formating esolver_of_interface.cpp

* change GlobalC::ucell to ucell in esolver_ks.cpp

* remove some GlobalC::ucell in esolver_sdft_pw.cpp

* refactor the code before getting rid of RA in esolver_lcao

* refactor before getting rid of LOWF

* refactor before getting rid of LCAO_hamilt.h and LCAO_matrix.h

* refactor wavefunc_in_pw

* refactor density matrix

* refactor the format cal_dm_psi.cpp

* format forces.cpp

* refactor esolver_of_tool.cpp

* change member function beforescf in Esolver to before_scf

* change afterscf to after_scf

* change updatepot to update_pot

* change eachiterinit to iter_init, change eachiterfinish to iter_finish

* refactor esolvers, change member function names of most esolvers

* reformat esolver.h

* update tests for esolvers

* add TITLE in esolver_ks_lcao

* update esolver_ks_lcao

* update esolver_lcao

* update timer::tick in esolver_lcao

* try to delete LCAO_Matrix in LCAO_Hamilt, and try to delete Parallel_Orbitals in Force_k

* fix the compiling issue with LCAO_hamilt.hpp

* try to divide the FORCE_k.cpp into several small files

* divide FORCE_k into foverlap_k.cpp ftvnl_dphi_k.cpp fvl_dphi_k.cpp fvnl_dbeta_k.cpp four files

* get rid of UHM in FORCE_k.cpp

* cannot compile, but I have modified some files in order to get rid of Gint_k and Gint_Gamma in UHM

* keep updating, cannot run

* update write_Vxc, cannot run yet

* keep updating gint_gamma and gint_k

* update LCAO_matrix.cpp

* divide force files, and update Makefile.Objects

* update LCAO_hamilt.cpp

* delete genH pointer in UHM

* divide LCAO_hamilt.cpp into small codes, grid_init.cpp is the first one

* update grid_init in esolver_ks_lcao

* add a new namespace named sparse_format, most of the functions that originally belong to LCAO_hamilt should be moved to sparse_format

* cannot find the mismatch of DFTU

* fix the DFTU error

* update

* enable the test_memory function again by setting calcalculation parameter in INPUT file

* update memory record functions

* add sparse_format_u

* keep refactoring LCAO_hamilt

* rename sparse format files, which are originally defined in LCAO_hamilt.h

* add spar_u.h and spar_u.cpp

* update sparse matrix

* add spar_exx

* update LCAO_hamilt.cpp

* tear down LCAO_hamilt.h and .cpp, DONE.

* keep updating spar

* fix the bugs after deleting LCAO_hamilt

* continue

* fix some errors when compiling

* fix compiling errors in DOS

* fix errors without uhm

* remove directly use of LM in spar_hsr.cpp

* update spa_ files

* keep cleaning the mass left by UHM

* finnaly, all files can be compiled without uhm

* previous commit has problems, now it has been fixed.

* fix makefile bugs

* fix exx compiling errors

* fix exx problems

* update exx

* fix exx

* in some sense, the exx code is a disaster

* let's fix exx again

* fix undefination

* fix a bug in LCAO Refactor Step 4, I accidently forgot to add & for Grid_Driver& _grid in output_mat_sparse.h

---------

Co-authored-by: maki49 <1579492865@qq.com>
* Docs: update the default recommended requirements for conda

* update variant grammar
* Use template to reconstruct parse_expression

* Feature: output R matrix at each MD step

* Modify'matrix_HS' to 'matrix' for R matrix output

* Merge branches 'develop' and 'develop' of https://github.com/1041176461/abacus-develop into develop

* Fix: modify index in parse_expression

* Fix: add regfree for parse_expression

* Doc: update phonopy doc

* Doc: update phonopy doc

* fix tdos plot for nspin=2

* optimize dosplot for nspin=2

* fix legend for dosplot

---------

Co-authored-by: jiyuang <jiyuyang@mail.ustc.com>
Co-authored-by: Qianrui <76200646+Qianruipku@users.noreply.github.com>
…#3890)

* add a new input parameter uramping, default is -1.0

* add a new member uramping in dftu.h and value it in Input_conv::Convert()

* add a new member U0 in dftu.h and value it in Input_conv::Convert()

* set U zero if uramping > 0.1 in Input_conv::Convert()

* add a new member function DFTU::uramping_update() to change U during SCF

* add a new member function DFTU::U_converged() to check if U=U0

* add uramping in esolver_lcao::iter_init() and change conv_elec

* make some minor changes

* fix bug which only restart once

* add a new member mixing_restart_count in Charge_Mixing

* add U output at iter 1

* fix build error without LCAO

* add some output of U value during U-Raming

* add some docs about uramping

* modify under some comments

* add a space in output

* add docs abouht DFTU in converge.md

* add recommendations of mixing_restart in input-main.md

* add some comment to explain why mixing_restart_count is int instead of bool

* add ref & in mix_dmr()

* add a new CI case 260_NO_DJ_PK_PU_AFM_URAMPING

* rename chgmix->mixing_restart as mixing_restart_step to avoid misunderstanding between GlobalV::MIXING_RESTART

* keep verbosity of judge in esolver to remind others mixing_dmr is only called in this case.

---------

Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
… for pw basis (#3903)

* add new_dav method which is same to davidson method for pw basis

* add new_dav method for pw basis which is more efficient than origin dav method

* fix ilaenv interface bug

* update new_dav method 3.5

* implement new_dav method for pw basis (cpu version, one core)

* fix bug of dav method for pw basis

* debug for new davidson method

* opt some value setting for new_dav files

* format and reorganize the code

* fix CUDA compile bug

* format diago_newdav.cpp

* Implement multi-core parallelism of the new davidson method

* fix build bug for without mpi

* replace new-dav of subspace-dav

* change file name from diago_newdav to diago_subspacedav

* fix build bug for tests

* change the name of subspacedav to dav_subspace

* fix build bug in Integration Test

---------

Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
…h soc (#3933)

* release force warning in noncollinear case

* foverlap and ft pulay

* fix ft foverlap add VNL_pulay

* FH and pulay force of VNL with soc

* noncollinear stress calculation

* treat GlobalV::NSPIN and GlobalV::NPOL

* treat globalV

* treat GlobalC::ucell

* treat GlobalC::ORB

* treat GridD

* rewrite some if sentence

* treat GlobalC GlobalV and if sentence

* treat nspin_

---------

Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
avoiding matrix transposition can computational efficiency.
@PeizeLin PeizeLin closed this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet