Repository navigation
refactor(dfpt): split the DFPT_PW_Data response-field slots to dfpt_pw_data_resp.cpp - #8261
Merged
mohanchen merged 5 commits intoNov 2, 2026
Merged
Conversation
…w_data_resp.cpp The bound-safe getters/setters of the per-direction / per-q response fields (u_active, docc, v_sc, the displacement / E-field response stashes and the drho / dv slot family) move verbatim from dfpt_pw_data.cpp (791 -> 402 lines) to the new dfpt_pw_data_resp.cpp (413 lines); the driver state (lifecycle, q delegation, validate_q_ ordering, the dpsi / convergence ledger, dynmat / phonon tensors, drhoc) stays behind. Class declaration and call sites unchanged; build surfaces updated (Makefile.Objects, module_dfpt CMakeLists). MODULE_DFPT 10/10; si_G anchor rerun verified bit-identical frequencies and dyn file against the E5 baseline.
…e test targets dfpt_pw_data_resp.cpp dereferences the Plus_U_Base reservation in u_active, which is only forward-declared in dfpt_pw_data.h -- include dftu_base.h for the complete type (the main build surfaces list only made the link error invisible in the test targets). The test targets that compile dfpt_pw_data.cpp directly also need the new dfpt_pw_data_resp.cpp in their SOURCES. Rebuild from deleted binaries + full MODULE_DFPT ctest: 10/10.
Zanthoxylum
force-pushed
the
refactor-dfpt-pw-data-io
branch
from
November 2, 2026 07:33
ffee306 to
114bbce
Compare
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
No split-induced correctness regression found. Static review covered the moved method bodies, affected callers and build source lists; no build or runtime tests were run.
After the response-field split, dfpt_pw_data.cpp only passes and stores a Plus_U_Base pointer; the forward declaration in dfpt_pw_data.h is sufficient and the complete type is needed only by u_active() in dfpt_pw_data_resp.cpp. All DFPT test binaries rebuilt from deleted binaries (make rc=0); full MODULE_DFPT ctest: 10/10.
…ata-io # Conflicts: # source/source_pw/module_dfpt/test/CMakeLists.txt # source/source_pw/module_dfpt/test_serial/CMakeLists.txt
mohanchen
approved these changes
Nov 2, 2026
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
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.
Summary
The largest DFPT module file,
dfpt_pw_data.cpp(791 lines), is splitby subsystem. The bound-safe getters/setters of the per-direction /
per-q response fields (
u_active,docc,v_sc, the displacement /E-field response stashes
drho_disp/dpsi_disp/pos_resp/dpsi_efield, and thedrho_r/drho_g/dv_r/dv_recip_c/dv_rcslot family) move verbatim to the newdfpt_pw_data_resp.cpp(413 lines). The driver state stays behind indfpt_pw_data.cpp(402 lines): lifecycle (init/clean/allocate), theq-list delegation and
validate_q_ordering, the dpsi / convergence /residual ledger, and the dynmat / phonon-frequency / dielectric / Born
tensors.
move).
source/Makefile.Objects,source/source_pw/module_dfpt/CMakeLists.txt(pyabacus does not list DFPT sources).
What did NOT change
No behavior change: the moved bodies are verbatim.
Verification
si_GfullDFPT rerun — phonon frequencies and the QE-format
dyn.q0outputbit-identical to the pre-move results.
Documentation
No docs change needed: internal file organization only, no INPUT,
interface, or behavior change.