fix(phys): accumulate epitaxy strain per layer - #68
Merged
Conversation
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
This fixes artificial quasi-Bragg intensity generated by broad, strain-coupled EpitaxyInterface profiles.
Previously, the interface calculated a strain for every structural layer but advanced each complete unit-cell cycle using only the final layer’s strain. For multi-layer cells, this introduced a displacement modulation with the layer-cycle period, leaking intensity into systematic extinctions and anti-Bragg positions.
The interface now:
Calculates the occupancy-weighted physical height of every structural layer.
Accumulates interface positions layer by layer.
Handles the upper and lower materials’ layer spacings independently.
Preserves the existing strain-coupling and bulk-anchoring conventions.
Regression coverage includes an analytic layer-origin test and a RuO₂/TiO₂ CTR test that reproduces the original quasi-Bragg artifact.
Validation
pytest orgui/datautils/xrayutils/test/test_CTRcalc.py: 109 passed, 4 skipped
pytest orgui/datautils/xrayutils/test/test_CTRoptical_profile.py: 28 passed
ruff check orgui/datautils/xrayutils: passed
RuO₂/TiO₂ anti-Bragg amplitude reduced from approximately 0.124 to 0.0101.
FeReO₄/TiO₂ anti-Bragg amplitude reduced from approximately 1.073 to 0.0637.