-
Notifications
You must be signed in to change notification settings - Fork 19
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
Woods-Saxon confinement #90
base: main
Are you sure you want to change the base?
Conversation
@samtsevich I have generalized parts of the infrastructure. To be continued here: |
d27e6b3
to
4a12518
Compare
4a12518
to
5f459c1
Compare
9e5998a
to
424c38f
Compare
@samtsevich I have switched over to an all numeric integration of the confinement potential and abstracted out the potentials form. In the future we could now easily add 'arbitrary' potentials without involved modifications. Validation is still pending, but I'm mostly confident that it works as intended, as the results of the previous analytical power compression are reproduced, i.e. the regression tests pass. |
4eb1087
to
f292839
Compare
f292839
to
60c892b
Compare
@samtsevich I think this is fully operational now. Any ideas on how to further validate the newly implemented WS compression? |
Wow that was fast, thank you so much! Not sure if we can validate it e.g. against published parametrizations (Chou's paper, or my lithium-graphite) because the atomic solvers and probably other finer details are all different and/or not available. Did you already give it a test run with some actual SK table generation? |
I have generated some SK-files but did not perform the actual DFTB calculation. The two-center integration does not explicitly depend on the confinement potential, so I guess it is fine. The new numeric approach to the confinement in the one-center part seems to perfectly reproduce the analytical power compression and the WS implementation follows the same code path (but of course with a different functional form). You have way more experience with the WS compression than I have, would it be possible that you briefly check for a 'qualitatively correct/expected behavior'? But it is not urgent (at least not from my side). |
I'll check soon with lithium (for which I haven't yet managed to get a great parametrization with the power compression). I'll update as soon as I test it! |
Thanks a lot 👍. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, thanks Tammo! I've made a few comments on the code design.
slateratom/lib/confinement.F90
Outdated
type(TPowerConfInp) :: power | ||
|
||
!> Woods-Saxon confinement input structure | ||
type(TWsConfInp) :: ws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the components allocatable and allocate on demand? There is less chance, that they are used uninitialized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I was already thinking about this, don't know why I ultimately decided to not make use of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be addressed by the latest commit.
slateratom/lib/confinement.F90
Outdated
contains | ||
|
||
procedure(getPotOnGrid), deferred :: getPotOnGrid | ||
procedure(getSupervec), deferred :: getSupervec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need getSupervec()
? Both implementations are exact identical, if I have seen correctly. Let's introduce it only, if we really need it. Or, alternatively, create a concrete implementation in this base class, so that derived classes have only to define getPotOnGrid()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, I was trying to sharpen my Fortran OOP skills with this PR and would be very interested in your opinion/feedback. The getSupervec()
routine is a 1:1 duplicate and does not depend on this
. I wasn't quite sure how to handle this case in the most elegant way. Since it does not depend on the compression type, can it be associated with the overarching abstract type (is this what you meant by 'create a concrete implementation in this base class'?) or should it just live on its own in the confinement module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- An abstract type can have non-deferred (normal) type bound procedures with actual implementation.
- You could either specify the routine there. You might then use the
nopass
option, so thatthis
is not even passed to the routine. - Alternatively, you just use it as a simple function outside. I don't have any strong opinions on this, but probably the way, how the integrals are calculated is independent from the actual potential form, so probably having it outside as a standalone function is more logical...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see 👍. I have seen nopass
in other projects before and always wanted to use it, seems like a reasonable opportunity for that. See the latest commit.
@vanderhe |
Tested, it seems to work fine! |
@aradi |
Bálint currently is still on vacation and will pick up work next week. I would estimate that a realistic time frame for this PR getting reviewed/merged is 1-2 weeks from now. From my side this is the final version, so I would suggest that you resort to this branch until it gets merged into main. |
@aradi I had to push an additional commit to this branch that fixes a bug in the shelf search. Nothing dramatic, but the previous version was not recognizing matching calculations in the shelf anymore. |
Co-authored-by: Ben Hourahine <[email protected]>
@aradi Shall we merge this with a merge commit, as discussed? |
Implements the Woods-Saxon confinement potential.
sktools
to WS confinement and hand over toslateratom
slateratom
Closes #89.
Please do not squash, but use merge commit.