Revert the dependency between unitcell in source_cell and ORB files in source_basis#7644
Open
mohanchen wants to merge 7 commits into
Open
Revert the dependency between unitcell in source_cell and ORB files in source_basis#7644mohanchen wants to merge 7 commits into
mohanchen wants to merge 7 commits into
Conversation
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
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.
Revert the dependency between unitcell in source_cell and ORB files in source_basis