-
Notifications
You must be signed in to change notification settings - Fork 137
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
Support of all lammps dump coordinate style #179
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8805846
Update dump.py
xfanak c0a048e
Create test_lammps_dump_unfold.py
xfanak e763bfc
Create conf_unfold.dump
xfanak f5e2b66
Update dump.py
xfanak b96a291
Create conf_s_su.dump
xfanak 90dbbd1
Create test_lammps_dump_s_su.py
xfanak 2a4172e
Update dump.py
xfanak bde97b1
Update conf_unfold.dump
xfanak fc618b2
Update dump.py
xfanak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ITEM: TIMESTEP | ||
0 | ||
ITEM: NUMBER OF ATOMS | ||
2 | ||
ITEM: BOX BOUNDS xy xz yz pp pp pp | ||
0.0 5.0739861 1.2621856 | ||
0.0 2.7916155 1.2874292 | ||
0.0 2.2254033 0.7485898 | ||
ITEM: ATOMS id type xs ys zs | ||
1 1 0.0 0.0 0.0 | ||
2 2 0.2472745002 0.2527254533 0.2477701458 | ||
ITEM: TIMESTEP | ||
1 | ||
ITEM: NUMBER OF ATOMS | ||
2 | ||
ITEM: BOX BOUNDS xy xz yz pp pp pp | ||
0.0 5.0739861 1.2621856 | ||
0.0 2.7916155 1.2874292 | ||
0.0 2.2254033 0.7485898 | ||
ITEM: ATOMS id type xsu ysu zsu | ||
1 1 0.0 0.0 0.0 | ||
2 2 1.2472745002 1.2527254533 1.2477701458 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ITEM: TIMESTEP | ||
0 | ||
ITEM: NUMBER OF ATOMS | ||
2 | ||
ITEM: BOX BOUNDS xy xz yz pp pp pp | ||
0.0 5.0739861 1.2621856 | ||
0.0 2.7916155 1.2874292 | ||
0.0 2.2254033 0.7485898 | ||
ITEM: ATOMS id type xu yu zu | ||
1 1 5.073986099999999944e+00 2.791615499999999805e+00 2.225403299999999973e+00 | ||
2 2 6.336171700000000406e+00 3.493418300000000087e+00 2.776791800099999818e+00 | ||
ITEM: TIMESTEP | ||
0 | ||
ITEM: NUMBER OF ATOMS | ||
2 | ||
ITEM: BOX BOUNDS xy xz yz pp pp pp | ||
0.0 5.0739861 1.2621856 | ||
0.0 2.7916155 1.2874292 | ||
1.0 3.2254033 0.7485898 | ||
ITEM: ATOMS id type xu yu zu | ||
1 1 5.073986099999999944e+00 2.791615499999999805e+00 3.225403299999999973e+00 | ||
2 2 6.336171700000000406e+00 3.493418300000000087e+00 3.776791800099999818e+00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import numpy as np | ||
import unittest | ||
from context import dpdata | ||
from poscars.poscar_ref_oh import TestPOSCARoh | ||
|
||
class TestDump(unittest.TestCase, TestPOSCARoh): | ||
|
||
def setUp(self): | ||
self.system = dpdata.System(os.path.join('poscars', 'conf_s_su.dump'), | ||
type_map = ['O', 'H']) | ||
|
||
class TestDump2(unittest.TestCase, TestPOSCARoh): | ||
|
||
def setUp(self): | ||
self.tmp_system = dpdata.System(os.path.join('poscars', 'conf_s_su.dump'), | ||
type_map = ['O', 'H']) | ||
self.system = self.tmp_system.sub_system([1]) | ||
|
||
def test_nframes (self) : | ||
self.assertEqual(self.tmp_system.get_nframes(), 2) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import numpy as np | ||
import unittest | ||
from context import dpdata | ||
from poscars.poscar_ref_oh import TestPOSCARoh | ||
|
||
class TestDump(unittest.TestCase, TestPOSCARoh): | ||
|
||
def setUp(self): | ||
self.system = dpdata.System(os.path.join('poscars', 'conf_unfold.dump'), | ||
type_map = ['O', 'H']) | ||
|
||
class TestDump2(unittest.TestCase, TestPOSCARoh): | ||
|
||
def setUp(self): | ||
self.tmp_system = dpdata.System(os.path.join('poscars', 'conf_unfold.dump'), | ||
type_map = ['O', 'H']) | ||
self.system = self.tmp_system.sub_system([1]) | ||
|
||
def test_nframes (self) : | ||
self.assertEqual(self.tmp_system.get_nframes(), 2) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@y1xiaoc The scaled coordinates are converted to Cartesian coordinates, is it the expected behavior?
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.
For
orig
equals to zero this should be correct.For a Cartesian and folded coordinates (with keys
x
,y
andz
, i.e. the originally supported one) with a non-zeroorig
, this will change the behavior by forcing the shifted coordinate fit into the cell. For example, for a coord orginally range in (0,10) and a orig = 5, original version will lead to a coord range in (-5,5) but current version (due to the%1
operation) will warp the coord back into range (0, 10) again.I'm not sure what is the
orig
parameter used for (and it seems to be ignored for scaled coordinates in both original and current version) so I cannot tell this change of behavior is problematic or not.