Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
2e716547
Commit
2e716547
authored
Nov 22, 2016
by
eric pellegrini
Browse files
raise an error when none or more than atom matches the mass stored in the LAMMPS config file
parent
e5f2828c
Changes
1
Hide whitespace changes
Inline
Side-by-side
MDANSE/Framework/Jobs/LAMMPS.py
View file @
2e716547
...
...
@@ -100,7 +100,12 @@ class LAMMPSConfigFile(dict):
for
j
in
range
(
1
,
self
[
"n_atom_types"
]
+
1
):
idx
,
mass
=
lines
[
i
+
j
].
strip
().
split
()
el
=
ELEMENTS
.
match_numeric_property
(
"atomic_weight"
,
float
(
mass
),
tolerance
=
1.0e-3
)
tolerance
=
1.0e-3
idx
=
int
(
idx
)
mass
=
float
(
mass
)
el
=
ELEMENTS
.
match_numeric_property
(
"atomic_weight"
,
mass
,
tolerance
=
tolerance
)
if
len
(
el
)
!=
1
:
raise
LAMMPSConfigFileError
(
"The atom %d with defined mass %f could not be assigned with a tolerance of %f. Please modify the mass in the config file to comply with MDANSE internal database"
%
(
idx
,
mass
,
tolerance
))
self
[
"elements"
][
idx
]
=
el
[
0
]
m
=
re
.
match
(
"^bonds$"
,
line
,
re
.
I
)
...
...
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