Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix desorption checking logic in Analysis.Diatomic #376

Merged
merged 5 commits into from
Mar 7, 2025
Merged

Conversation

Alexsp32
Copy link
Member

@Alexsp32 Alexsp32 commented Mar 7, 2025

Analysis.Diatomic.surface_distance_condition was incorrectly calling Analysis.Diatomic.surface_normal_height without a surface_normal argument, which was included in a symdiff call to find all non-diatomic atom indices instead.

This resulted in these atom indices being returned as Float64s, which caused indexing to fail down the line.

Fixes #367.

@Alexsp32 Alexsp32 requested a review from reinimaurer1 March 7, 2025 10:29
@@ -152,32 +152,32 @@ function minimum_distance_translation(config::AbstractVector, ind1::Int, ind2::I
return minimum_distance_translation(get_positions(config),ind1,ind2,simulation.cell;cutoff=cutoff)
end

function pbc_distance(config::Matrix, ind1, ind2, sim::AbstractSimulation; args...)
function pbc_distance(config::Matrix, ind1::int_or_index, ind2::int_or_index, sim::AbstractSimulation; args...)
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I link this int_or_index

Copy link
Member

@reinimaurer1 reinimaurer1 left a comment

Choose a reason for hiding this comment

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

looks good

@Alexsp32 Alexsp32 merged commit 9c54748 into main Mar 7, 2025
8 of 12 checks passed
@Alexsp32 Alexsp32 deleted the fix-diatomic-367 branch March 7, 2025 16:02
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.

🧪 Missing index rounding in Analysis.Diatomic.get_desorption_angle
2 participants