Skip to content
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

Add MACE potential #143

Merged
merged 6 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

# 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'

Check warning on line 327 in src/aiida_lammps/parsers/inputfile.py

View check run for this annotation

Codecov / codecov/patch

src/aiida_lammps/parsers/inputfile.py#L326-L327

Added lines #L326 - L327 were not covered by tests
# 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