Skip to content

Commit

Permalink
Merge branch 'master' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
JPchico authored Sep 12, 2024
2 parents be4f33e + ec8583d commit 853d187
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/aiida_lammps/calculations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,12 @@ def prepare_for_submission(self, folder):
handle.write(structure_filecontent)

# Write the potential to the remote folder
with folder.open(self._POTENTIAL_FILENAME, "w") as handle:
handle.write(self.inputs.potential.get_content())
with folder.open(self._POTENTIAL_FILENAME, "wb") as handle:
# Read the contents of the potential file in binary mode
with self.inputs.potential.open(mode="rb") as potential_handle:
potential_content = potential_handle.read()

handle.write(potential_content)

# Write the input file content. This function will also check the
# sanity of the passed parameters when comparing it to a schema
Expand Down
2 changes: 2 additions & 0 deletions src/aiida_lammps/data/lammps_potentials.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@
"lj/mdf":{"units": "metal", "atom_style": "atomic", "read_from_file": false},
"buck/mdf":{"units": "unknown", "atom_style": "atomic", "read_from_file": false},
"lennard/mdf":{"units": "unknown", "atom_style": "atomic", "read_from_file": false},
"mace":{"units": "unknown", "atom_style": "atomic", "read_from_file": true},
"mace no_domain_decomposition":{"units": "unknown", "atom_style": "atomic", "read_from_file": true},
"meam":{"units": "unknown", "atom_style": "atomic", "read_from_file": true},
"meam/spline":{"units": "unknown", "atom_style": "atomic", "read_from_file": true},
"meam/sw/spline":{"units": "unknown", "atom_style": "atomic", "read_from_file": true},
Expand Down
5 changes: 5 additions & 0 deletions src/aiida_lammps/parsers/inputfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ def write_structure_block(

# Set the atom style for the structure
structure_block += f'atom_style {parameters_structure["atom_style"]}\n'

# Set the atom modify for the structure
if "atom_modify" in parameters_structure:
structure_block += "atom_modify"
structure_block += f' {parameters_structure["atom_modify"]}\n'
# Write the command to read the structure from a file
structure_block += f"read_data {structure_filename}\n"
# Set the groups which will be used for the calculations
Expand Down
3 changes: 3 additions & 0 deletions src/aiida_lammps/validation/schemas/lammps_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
]
}
},
"atom_modify": {
"type": "array"
},
"box_tilt": {
"type": "string",
"propertyNames": {
Expand Down

0 comments on commit 853d187

Please sign in to comment.