Skip to content

Remove PARAM in source_cell (including tests); revert the dependency between unitcell in source_cell and ORB files in source_basis; update some agent governance#7644

Merged
mohanchen merged 57 commits into
deepmodeling:developfrom
mohanchen:20260715
Jul 21, 2026

Conversation

@mohanchen

Copy link
Copy Markdown
Collaborator

Revert the dependency between unitcell in source_cell and ORB files in source_basis

abacus_fixer added 3 commits July 15, 2026 22:27
This commit implements dependency inversion to decouple source_cell from
source_basis ORB files. The key changes are:

1. Created abstract base class NonlocalInfoBase in source_cell/nonlocal_info_base.h
   - Provides pure virtual interface for non-local pseudopotential data access
   - Eliminates source_cell's direct dependency on ORB headers

2. Implemented adapter class LCAONonlocalInfo in source_lcao/LCAO_nonlocal_info.h
   - Inherits from NonlocalInfoBase
   - Wraps the existing InfoNonlocal class
   - Provides type-safe access to underlying LCAO-specific non-local data

3. Modified UnitCell to use NonlocalInfoBase* instead of InfoNonlocal
   - Changed from value member to pointer
   - Added proper cleanup in destructor

4. Moved setup_nonlocal.h/cpp from source_cell to source_lcao
   - Consolidates LCAO-specific code in the appropriate module
   - Updated include paths in dependent files

5. Updated all call sites to use the new abstract interface
   - Replaced direct member access with getter methods
   - Ensured const-correctness throughout

This design follows the Dependency Inversion Principle:
- High-level module (source_cell) now depends on abstraction (NonlocalInfoBase)
- Low-level module (source_lcao) implements the abstraction
- source_cell no longer depends on source_basis ORB headers
@mohanchen
mohanchen requested a review from Critsium-xy July 15, 2026 15:37
@mohanchen mohanchen added Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels Jul 15, 2026
Comment thread source/source_lcao/module_rt/snap_psibeta_half_tddft.h
Comment thread source/source_lcao/LCAO_init_basis.cpp Outdated
Comment thread source/source_cell/unitcell.h Outdated
Comment thread source/source_lcao/module_lr/esolver_lrtd_lcao.cpp Outdated
Comment thread source/source_cell/cal_atoms_info.h Outdated

@Critsium-xy Critsium-xy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM now. But the title should be modified before merge because this PR includes some codes for other functions.

@mohanchen mohanchen changed the title Revert the dependency between unitcell in source_cell and ORB files in source_basis Remove PARAM in source_cell (including tests); revert the dependency between unitcell in source_cell and ORB files in source_basis; update some agent governance Jul 21, 2026
@mohanchen
mohanchen merged commit bf54db6 into deepmodeling:develop Jul 21, 2026
18 checks passed
@Critsium-xy Critsium-xy linked an issue Jul 21, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[source_cell] parameter.h is widely used in source_cell's code

3 participants