-
Notifications
You must be signed in to change notification settings - Fork 90
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
adding ElementCustomIonPotential + new GP example using it (with doc)… #251
Conversation
gkemlin
commented
Jun 5, 2020
•
edited
Loading
edited
- new element for to generate AtomicLocal term with custom potential
- new example of 1D GP with SCF and forces using ElementCustomIonPotential with docs
- small typo in 2D GP example
- modified Model.jl to detect 1D/2D models and automatically disable symmetry
… + typo in GP magnetism
Also should that custom type be in the example file rather than in elements.jl? I think it makes sense since it's so simple. Also if in the DFTK source it poses the question of should Coulomb be a particular case of this, which I'm not sure we want to bother with. |
I think that it's only 18 lines of code at the end of the |
I think it's better outside: better to have a small code base that makes simple extensions easy than have all the extensions in the code. |
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.
Nice example. Yes I agree no need to put this into the main code. Maybe at some point when we find we need it more often.
examples/custom_potential.jl
Outdated
L = 0.5; | ||
# We set the potential in its real and Fourier forms | ||
pot_real(x) = exp(-(x/L)^2) | ||
pot_fourier(q::T) where {T <: Real} = exp(- (q*L)^2 / 4); | ||
# And finally we build the elements and set their positions in the `atoms` | ||
# array. Not that in this exemple, `pot_real` is not necessary as all application | ||
# array. Note that, in this example, `pot_real` is not required as all applications |
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.
No comma after that.