logsdail / carmm

Scripts for creation, manipulation and analysis of geometric and electronic structure of molecular models
GNU General Public License v3.0
5 stars 17 forks source link

New functionality for generating slab consistent bulk model #134

Closed AkashHiregange closed 6 months ago

codecov[bot] commented 9 months ago

Codecov Report

Attention: Patch coverage is 98.38710% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 88.23%. Comparing base (2dc2644) to head (7f9bcb2).

Files Patch % Lines
carmm/build/slab_consistent_bulk_generator.py 97.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #134 +/- ## ========================================== + Coverage 88.03% 88.23% +0.19% ========================================== Files 78 80 +2 Lines 3202 3264 +62 ========================================== + Hits 2819 2880 +61 - Misses 383 384 +1 ``` | [Flag](https://app.codecov.io/gh/logsdail/carmm/pull/134/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Logsdail) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/logsdail/carmm/pull/134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Logsdail) | `88.23% <98.38%> (+0.19%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Logsdail#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

OscarvanVuren commented 9 months ago

Surely there must be a Numpy function to check if a float is close to an integer within tolerance? Perhaps I expect too much from Numpy though

logsdail commented 9 months ago

Ah OK, so perhaps my comment makes no difference. I thought it was a bonding distance cutoff.


From: AkashHiregange @.> Sent: 14 November 2023 15:13 To: logsdail/carmm @.> Cc: Andrew Logsdail @.>; Comment @.> Subject: Re: [logsdail/carmm] New functionality for generating slab consistent bulk model (PR #134)

External email to Cardiff University - Take care when replying/opening attachments or links. Nid ebost mewnol o Brifysgol Caerdydd yw hwn - Cymerwch ofal wrth ateb/agor atodiadau neu ddolenni.

@AkashHiregange commented on this pull request.


In carmm/build/slab_consistent_bulk_generator.pyhttps://github.com/logsdail/carmm/pull/134#discussion_r1392759720:

  • bulk atoms in a slab structure. This new bulk structure will be consistent with the slab model and the
  • computed bulk energy for this structure will help to obtain surface energies that are convergent with
  • increasing slab thickness. Further detailed information is available in the following literature article.
  • Schultz, Peter A.
  • "First-principles calculations of metal surfaces. I. Slab-consistent bulk reference for convergent surface
  • properties." Physical Review B 103.19 (2021): 195426.
  • How this functionality works:
    1. the difference between the x,y and z coordinates of an atom and its corresponding periodic image will be a linear
  • combination of the cell vectors a,b and c.
    1. This idea is extended here in case of a slab model where the linear combination check
  • is considered only w.r.t to the a and b vectors
  • Args:
    • slab: ASE Atoms object representing the slab structure
    • cutoff_distance: Cutoff distance for identifying neighboring atoms (default is 10.0). This will be used to

This is the distance that is used to check the co-ordination environment of a given atom. For example, the distances between a given atom and all other atoms that lie within a 10 angstrom radius is checked. But since the atoms at the bottom of the slab have no atoms below it, I had to force it check for atoms that have a z-coordinate value great than current atom that is being checked (dist <= cutoff_distance and slab[ind].position[2] / atom_i.position[2] >= 0.9999]). But, I will have a chat with Harry to look into it

— Reply to this email directly, view it on GitHubhttps://github.com/logsdail/carmm/pull/134#discussion_r1392759720, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFMK4M7TF7SBS7QYY2CMCBTYEODC5AVCNFSM6AAAAAA7K2JBJKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOMRZHE4DQOBYG4. You are receiving this because you commented.Message ID: @.***>

AkashHiregange commented 9 months ago

Surely there must be a Numpy function to check if a float is close to an integer within tolerance? Perhaps I expect too much from Numpy though

I tried to search for such functionality within numpy, but couldn't find one.

OscarvanVuren commented 9 months ago

I tried to search for such functionality within numpy, but couldn't find one.

Fair. I had a look too and failed to find such a routine.

GaryLZW commented 6 months ago

Looks good to me!