LCAO refactor step 4#3921
Conversation
Fix undefination in LCAO4 branch
…rid_Driver& _grid in output_mat_sparse.h
kirk0830
left a comment
There was a problem hiding this comment.
From this PR I have seen there are several main problems blocking further LCAO development:
- inconsistent abbreviation
- inconsistent uppercase and lowercase
- too much inflated parameter table of too nested functions
- ill-defined class
- macro inserted parameter list
I really do not recommend to use using namespace std;
jinzx10
left a comment
There was a problem hiding this comment.
I've just got one small issue regarding the template function "cal_HR_exx" .
In module_hamilt_lcao/hamilt_lcaodft, this template function was declared in spar_exx.h, implemented in LCAO_hamilt.hpp, and used in spar_hsr.cpp. As such, I think this function is going to be instantiated & compiled during the compilation of spar_hsr.cpp. I notice that there's an independent source file "spar_exx.cpp", which include the template declaration & definition but does not explicitly instantiate the function. In this case, I think this cpp file does not work as it was supposed to do: its compiled object (spar_exx.o) would not contains the function "cal_HR_exx".
The above can be verified by by investigating the symbols of the object files. As shown below, spar_exx.o does not contain any symbol about cal_HR_exx, while spar_hsr.o does.

This little "mismatch" does not break anything because eventually the function is instantiated and compiled. Yet I think, for the sake of clarity, it might be better to either explicitly instantiate cal_HR_exx in spar_exx.cpp or just remove it.
|
Thanks for the comments, further refactoring by more developers is indeed needed. |
The LCAO_hamilt.cpp was not adapted to current framework of the LCAO line. Most of the functions in the file are now only used for generating H-related matrices with the sparse format. Therefore, a series of spar_.cpp and spar_.h files are desinged instead in the LCAO code directory.
Linked Issue
Fix #3920
Fix #3866