Skip to content

Conversation

DanielMarchand
Copy link
Contributor

  • Added a basic example to examples/stresses
  • Added stress attributes to structure
  • Added ability to read stress lines from input file

Some points for discussion:

  • I've made stress as 3x3 vectors, internal usage very similar to box
  • We might need to be careful on normalization the stress is on the one-hand vector-like so we normalize like a box. On the other hand, I think there will be per-atom stress normalization (which I don't implement)
  • I've made some attempts to isolate the stress aspects, since not every simulation will use stress. For example, there is the hasStress attribute
  • I accidentally modified the PhysicalUnits function. I've restored the original version but the git diff is a bit messy in that part of the code.

@codecov-io
Copy link

codecov-io commented Apr 3, 2021

Codecov Report

Merging #103 (d7af344) into master (3f03449) will decrease coverage by 0.09%.
The diff coverage is 48.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
- Coverage   71.85%   71.75%   -0.10%     
==========================================
  Files         129      129              
  Lines       14022    14049      +27     
==========================================
+ Hits        10075    10081       +6     
- Misses       3947     3968      +21     
Flag Coverage Δ
cpp 74.52% <48.71%> (-0.12%) ⬇️
python 71.75% <48.71%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/libnnp/Structure.cpp 75.66% <48.71%> (-2.87%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f03449...d7af344. Read the comment docs.

@singraber singraber added core Touches the libnnp core library enhancement New feature or request training Related to NNP training labels Apr 7, 2021
@singraber singraber self-assigned this Apr 7, 2021
@singraber
Copy link
Member

Hey Daniel,

thanks for working on this, looking good so far!

I have one question: maybe I am wrong but I don't think we can have another normalization for the pressure tensor because there is currently already a "normalized" energy and length unit. Since the pressure tensor will be of (energy/length^3) units this already fixes the numeric magnitude, right? I have not thought about this in detail...

However, it is important to consider that many programs will output the pressure tensor in units like kBar or Pa, hence this should be converted before used as an input in the data file. Have you already done this in your example? Thanks a lot anyway for providing an example, this is very helpful!

Best,

Andi

@DanielMarchand
Copy link
Contributor Author

DanielMarchand commented Apr 8, 2021

Hi Andi,

I have one question: maybe I am wrong but I don't think we can have another normalization for the pressure tensor because there is currently already a "normalized" energy and length unit. Since the pressure tensor will be of (energy/length^3) units this already fixes the numeric magnitude, right? I have not thought about this in detail...

This is a very good point and I hadn't thought of it. If this is what happens for the forces then the stresses should follow the same pattern.

However, it is important to consider that many programs will output the pressure tensor in units like kBar or Pa, hence this should be converted before used as an input in the data file. Have you already done this in your example? Thanks a lot anyway for providing an example, this is very helpful!

Thanks for thinking of this, yep, this has already been handled! (In my case the output was in GPa and I've converted everything to Hartree/Bohr^3 units). I actually have the stresses for 5000 structures and a reasonably well-trained NNP for them. A good early goal could be to test the analytic prediction of stresses (we should be able to get results that are at least reasonable for most structures).

Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Touches the libnnp core library enhancement New feature or request training Related to NNP training
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants