FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

change vdwd3 from Fortran to C++ by 1041176461 · Pull Request #8 · deepmodeling/abacus-develop · GitHub

change vdwd3 from Fortran to C++ - #8

Closed
1041176461 wants to merge 2 commits into
deepmodeling:masterfrom
1041176461:master
Closed

change vdwd3 from Fortran to C++#8
1041176461 wants to merge 2 commits into
deepmodeling:masterfrom
1041176461:master

Conversation

Copy link
Copy Markdown
Collaborator

No description provided.

…valid)

2.modify ${LPA_LIB} to ${ELPA_LIB} in line 39 of Makefile.system
3.add keyword `const` in line 49 of matrix3.h
mohanchen closed this May 1, 2021

Copy link
Copy Markdown
Collaborator

we will wait for pr from abacusmodeling

mohanchen added a commit that referenced this pull request May 7, 2021
add in new contributions of deepks
dyzheng pushed a commit that referenced this pull request Oct 18, 2022
dyzheng referenced this pull request in dyzheng/abacus-develop Aug 1, 2024
adjust logic of calling cal_mag
ESROAMER referenced this pull request in ESROAMER/abacus-develop Nov 18, 2024
AroundPeking pushed a commit to AroundPeking/abacus-develop that referenced this pull request May 13, 2025
mohanchen added a commit that referenced this pull request Aug 29, 2026
* Refactor vnl_pw, step 1: extract getvnl into vnl_pw_getvnl.cpp

- Move getvnl<FPTYPE, Device> template body + 4 explicit
  instantiations (CPU/GPU float/double) from vnl_pw.cpp
  to new file vnl_pw_getvnl.cpp (~165 lines)
- Update CMakeLists.txt and Makefile.Objects accordingly
- vnl_pw.cpp reduced from 1797 to 1641 lines

Verification:
  cd build_max_para_test && make -j 30
  => build passed, no undefined reference

* Style: split multi-variable declarations in vnl_pw_getvnl.cpp

- One variable per line for better readability and maintainability
- Rename pointer variables: _tab -> tab_ptr, _indv -> indv_ptr,
  _nhtol -> nhtol_ptr, _nhtolm -> nhtolm_ptr
  (avoid leading underscore, use _ptr suffix)

Verification:
  cd build_max_para_test && make -j 30
  => build passed

* Doc: add one-variable-per-line rule to AGENTS.md

Rule #8 in Required Baseline: declare one variable per line;
do not use comma-separated declarations.

This improves readability, makes diffs cleaner, and helps
debugging with single-step execution.

* Refactor: replace new/delete with std::vector in vnl_pw_getvnl.cpp

- Replace int* h_atom_nh/na/nb with std::vector<int>
- Replace ModuleBase::Vector3<double>* _gk with std::vector<Vector3>
- Use .data() to get raw pointer for GPU sync operations
- Remove all delete[] calls (RAII handles cleanup automatically)

Benefits:
- Exception safety (no memory leak if exception thrown)
- Cleaner code (no manual memory management)
- Follows modern C++ best practices

Verification:
  cd build_max_para_test && make -j 30
  => build passed

* Doc: add doxygen comments to vnl_pw_getvnl.cpp

- Add file-level @file/@brief documentation
- Add getvnl() function documentation with workflow steps
- Add comment explaining explicit template instantiations

* Step 2: extract qrad/radial_fft_q into vnl_pw_qrad.cpp

- Move compute_qrad(), radial_fft_q() (CPU matrix version),
  radial_fft_q<FPTYPE,Device>() (template version), and
  4 explicit template instantiations to vnl_pw_qrad.cpp
- Replace new[]/delete[] with std::vector in compute_qrad()
- Add doxygen comments for all functions
- Update CMakeLists.txt and Makefile.Objects

Verification:
  cd build_max_para_test && make -j 30
  => build passed

* Step 3: extract cal_effective_D/newq/newd_* into vnl_pw_deeq.cpp

- Move cal_effective_D(), newq(), newd_so(), newd_nc() to vnl_pw_deeq.cpp
- Replace new[]/delete[] qnorm with std::vector in newq()
- Add doxygen comments for all functions
- Update CMakeLists.txt and Makefile.Objects
- Fix blas_connector.h include path (source_base/module_external/)

Verification:
  cd build_max_para_test && make -j 30
  => build passed

* refactor(pwdft): move LCAO alpha-channel VNL helpers to vnl_pw_alpha.cpp

Step 4 of vnl_pw.cpp split:
- Move Cal_C(), CG(), init_vnl_alpha() into new vnl_pw_alpha.cpp
- Wrap whole file with #ifdef __LCAO
- Drop dead commented-out getvnl_alpha block
- Replace new[]/delete[] with std::vector for jl/aux in init_vnl_alpha
- Sync CMakeLists.txt and Makefile.Objects

Verified: make -j 30 in build_max_para_test passes.

* refactor(pwdft): move init_vnl into vnl_pw_init_vnl.cpp

Step 5 of vnl_pw.cpp split:
- Move init_vnl() into new vnl_pw_init_vnl.cpp
- Replace new[]/delete[] with std::vector for jl/aux inside the tab fill loop
- Sync CMakeLists.txt and Makefile.Objects

Verified: make -j 30 in build_max_para_test passes.

* refactor(pwdft): clean up vnl_pw.cpp after split, drop unused includes

Step 6 of vnl_pw.cpp split (final):
- Keep only ctor/dtor, release_memory(), init(), print_vnl(),
  rescale_vnl() and the get_*_data<T>() template specializations
- Drop now-unused includes (clebsch_gordan, math_integral, math_polyint,
  math_sphbes, math_ylmreal, parallel_reduce, vnl_op, parallel_comm)
- Add file-level doxygen comment describing the new module layout

Verified: make -j 30 in build_max_para_test passes.

* Remove accidentally added empty CONNECT file

The empty CONNECT file was unintentionally added in commit 3b53f58
during the vnl_pw_qrad split. It is not referenced by any code, build
file, or script, so it is safe to delete.

* update format

* refactor(pwdft): replace raw new/delete arrays with std::vector in vl/vnl pseudopotential code

- convert pseudopot_cell_vl local buffers (vloc1d/aux1/aux) and member zp to std::vector
- convert pseudopot_cell_vnl::indv_ijkb0 to std::vector and drop manual delete
- use std::fill/std::copy instead of ZEROS/COPYARRAY helpers on vectors

* update AGENTS.md

* docs: add std::vector conversion guideline to AGENTS.md baseline

* style(pwdft): replace tab indentation with 4 spaces in vl_pw files

* refactor(pw): decouple print_vloc from PARAM and move it out of init_vloc

- print_vloc takes out_element_info and global_out_dir explicitly instead
  of reading PARAM internally
- callers invoke print_vloc right after init_vloc at all four call sites

* refactor(ofdft): cache PARAM.inp.nspin into local const in KEDF_XWM::get_energy

Cache PARAM.inp.nspin into a local const to reduce repeated global
parameter accesses, and add the missing newline at end of file.

---------

Co-authored-by: abacus_fixer <mohanchen@pku.eud.cn>
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
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.

2 participants


Back | FazBrowse Home | New Git URL