Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
006ba39f
Commit
006ba39f
authored
Jan 22, 2021
by
Lauri Himanen
Browse files
Updated Crystal parser and fixed small issue in system wrapping.
parent
c2810c34
Pipeline
#91958
passed with stages
in 20 minutes and 42 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
crystal
@
b31800d8
Compare
df1175fa
...
b31800d8
Subproject commit
df1175fab88a5216da20b75f81c7374d8df938df
Subproject commit
b31800d887ce99d21a7a4048fdfbfe9aff8df33b
nomad/atomutils.py
View file @
006ba39f
...
...
@@ -65,7 +65,7 @@ def wrap_positions(
cell
:
np
.
ndarray
=
None
,
pbc
:
Union
[
bool
,
np
.
ndarray
]
=
True
,
center
:
np
.
ndarray
=
[
0.5
,
0.5
,
0.5
],
eps
:
float
=
1e-
7
)
->
np
.
ndarray
:
eps
:
float
=
1e-
12
)
->
np
.
ndarray
:
"""Wraps the given position so that they are within the unit cell. If no
cell is given, scaled positions are assumed. For wrapping cartesian
positions you also need to provide the cell.
...
...
@@ -93,13 +93,14 @@ def wrap_positions(
if
cell
is
None
:
fractional
=
positions
else
:
fractional
=
to_scaled
(
positions
)
-
shift
fractional
=
to_scaled
(
positions
,
cell
)
fractional
-=
shift
for
i
,
periodic
in
enumerate
(
pbc
):
if
periodic
:
fractional
[:,
i
]
%=
1.0
fractional
[:,
i
]
+=
shift
[
i
]
if
cell
:
fractional
[:,
i
]
+=
shift
[
i
]
if
cell
is
not
None
:
return
np
.
dot
(
fractional
,
cell
)
else
:
return
fractional
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment