Skip to content

Feature: Implement ext-WT KEDF for OFDFT#7231

Open
sunliang98 wants to merge 8 commits intodeepmodeling:developfrom
sunliang98:ext_wt
Open

Feature: Implement ext-WT KEDF for OFDFT#7231
sunliang98 wants to merge 8 commits intodeepmodeling:developfrom
sunliang98:ext_wt

Conversation

@sunliang98
Copy link
Copy Markdown
Collaborator

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • An integrate test 07_OFDFT/34_OF_KE_extWT

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the extended Wang–Teter (ext-WT) kinetic energy density functional for OFDFT, wiring it into input parsing, the KEDF manager pipeline, and adding an integration test case.

Changes:

  • Add new KEDF_ExtWT implementation and integrate it into OFDFT build + runtime selection (of_kinetic=ext-wt).
  • Extend input parsing/documentation with ext-wt option and new parameter of_extwt_kappa.
  • Add and register an OFDFT integration test case 07_OFDFT/34_OF_KE_extWT.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/07_OFDFT/CASES_CPU.txt Registers the new CPU test case.
tests/07_OFDFT/34_OF_KE_extWT/STRU Adds structure for the new ext-WT OFDFT test.
tests/07_OFDFT/34_OF_KE_extWT/result.ref Adds reference outputs for regression checking.
tests/07_OFDFT/34_OF_KE_extWT/README Documents the new test case intent/parameters.
tests/07_OFDFT/34_OF_KE_extWT/KPT Defines k-point setup for the test.
tests/07_OFDFT/34_OF_KE_extWT/INPUT Defines OFDFT input using of_kinetic ext-wt.
source/source_pw/module_ofdft/kedf_manager.h Adds ownership of KEDF_ExtWT in manager.
source/source_pw/module_ofdft/kedf_manager.cpp Hooks ext-wt into init/potential/energy/stress paths.
source/source_pw/module_ofdft/kedf_extwt.h Declares the new ext-WT KEDF class/API.
source/source_pw/module_ofdft/kedf_extwt.cpp Implements ext-WT kernel, energy, potential (stress stubbed).
source/source_pw/module_ofdft/CMakeLists.txt Builds kedf_extwt.cpp.
source/source_io/module_parameter/read_input_item_ofdft.cpp Allows of_kinetic=ext-wt and adds of_extwt_kappa.
source/source_io/module_parameter/input_parameter.h Adds of_extwt_kappa to input parameter struct.
docs/advanced/input_files/input-main.md Documents ext-wt and of_extwt_kappa.
Comments suppressed due to low confidence (1)

source/source_pw/module_ofdft/kedf_manager.h:30

  • KEDF_Manager owns xwm_ (see member declaration) but the destructor doesn't delete it, which will leak memory when KEDF_Manager is destroyed (e.g., in repeated solver instantiations or tests). Please delete xwm_ in the destructor alongside the other KEDF pointers.
    ~KEDF_Manager()
    {
        delete this->lkt_;
        delete this->tf_;
        delete this->vw_;
        delete this->wt_;
        delete this->extwt_;
#ifdef __MLALGO
        delete this->ml_;
#endif
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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