Skip to content

Commit

Permalink
Changing the formatting in the dump comppand so that it can handle dy…
Browse files Browse the repository at this point in the history
…namic vectors. (#124)

Fixing the fact that the property/atoms compute should be a vector of undefined length and not an array.

Fixes #114
  • Loading branch information
JPchico authored Apr 26, 2024
1 parent b2f119b commit bd3d402
Show file tree
Hide file tree
Showing 14 changed files with 862 additions and 627 deletions.
45 changes: 45 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ def parameters_minimize() -> AttributeDict:
"ke/atom": [{"type": [{"keyword": " ", "value": " "}], "group": "all"}],
"stress/atom": [{"type": ["NULL"], "group": "all"}],
"pressure": [{"type": ["thermo_temp"], "group": "all"}],
"property/atom": [
{
"type": [
{"keyword": " ", "value": "fx"},
{"keyword": " ", "value": "fy"},
],
"group": "all",
}
],
}

parameters.minimize = {
Expand Down Expand Up @@ -170,6 +179,15 @@ def parameters_minimize_groups() -> AttributeDict:
"stress/atom": [{"type": ["NULL"], "group": "all"}],
"pressure": [{"type": ["thermo_temp"], "group": "all"}],
"ke": [{"type": [{"keyword": " ", "value": " "}], "group": "test"}],
"property/atom": [
{
"type": [
{"keyword": " ", "value": "fx"},
{"keyword": " ", "value": "fy"},
],
"group": "all",
}
],
}

parameters.minimize = {
Expand Down Expand Up @@ -217,6 +235,15 @@ def parameters_md_nve() -> AttributeDict:
"ke/atom": [{"type": [{"keyword": " ", "value": " "}], "group": "all"}],
"stress/atom": [{"type": ["NULL"], "group": "all"}],
"pressure": [{"type": ["thermo_temp"], "group": "all"}],
"property/atom": [
{
"type": [
{"keyword": " ", "value": "fx"},
{"keyword": " ", "value": "fy"},
],
"group": "all",
}
],
}
parameters.md = {
"integration": {
Expand Down Expand Up @@ -261,6 +288,15 @@ def parameters_md_nvt() -> AttributeDict:
"ke/atom": [{"type": [{"keyword": " ", "value": " "}], "group": "all"}],
"stress/atom": [{"type": ["NULL"], "group": "all"}],
"pressure": [{"type": ["thermo_temp"], "group": "all"}],
"property/atom": [
{
"type": [
{"keyword": " ", "value": "fx"},
{"keyword": " ", "value": "fy"},
],
"group": "all",
}
],
}
parameters.md = {
"integration": {
Expand Down Expand Up @@ -308,6 +344,15 @@ def parameters_md_npt() -> AttributeDict:
"ke/atom": [{"type": [{"keyword": " ", "value": " "}], "group": "all"}],
"stress/atom": [{"type": ["NULL"], "group": "all"}],
"pressure": [{"type": ["thermo_temp"], "group": "all"}],
"property/atom": [
{
"type": [
{"keyword": " ", "value": "fx"},
{"keyword": " ", "value": "fy"},
],
"group": "all",
}
],
}
parameters.md = {
"integration": {
Expand Down
4 changes: 2 additions & 2 deletions src/aiida_lammps/parsers/inputfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,8 @@ def write_dump_block(
dump_block += f'{" ".join(computes_list)}\n'
dump_block += "dump_modify aiida sort id\n"
dump_block += f'dump_modify aiida element {" ".join(kind_symbols)}\n'
dump_block += "dump_modify aiida format line "
dump_block += f'"%6d %4d %4s {" ".join(["%16.10f"]*num_double)}"\n'
dump_block += "dump_modify aiida format int ' %d ' \n"
dump_block += "dump_modify aiida format float ' %16.10e ' \n"
dump_block += generate_header("End of the Dump information")

return dump_block
Expand Down
6 changes: 3 additions & 3 deletions src/aiida_lammps/parsers/variables_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
"pressure": {"type": "mixed", "size": 6, "locality": "global", "printable": true},
"pressure/cylinder": {"type": "array", "size": 0, "locality": "global", "printable": true},
"pressure/uef": {"type": "scalar", "size": 0, "locality": "global", "printable": true},
"property/atom": {"type": "array", "size": 0, "locality": "local", "printable": true},
"property/chunk": {"type": "array", "size": 0, "locality": "global", "printable": false},
"property/local": {"type": "array", "size": 0, "locality": "global", "printable": true},
"property/atom": {"type": "vector", "size": 0, "locality": "local", "printable": true},
"property/chunk": {"type": "vector", "size": 0, "locality": "global", "printable": false},
"property/local": {"type": "vector", "size": 0, "locality": "global", "printable": true},
"ptm/atom": {"type": "scalar", "size": 0, "locality": "local", "printable": true},
"rdf": {"type": "array", "size": 0, "locality": "global", "printable": false},
"reduce": {"type": "mixed", "size": 0, "locality": "global", "printable": true},
Expand Down
Loading

0 comments on commit bd3d402

Please sign in to comment.