Skip to content

Remove hybrid styles from LAMMPS export #1203

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- "3.12"
- "3.13"
openeye:
- true
- false
openmm:
- true
Expand Down
6 changes: 3 additions & 3 deletions examples/lammps/lammps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@
"boundary p p p\n",
"\n",
"# Bonded interactions in Sage force field\n",
"bond_style hybrid harmonic\n",
"angle_style hybrid harmonic\n",
"dihedral_style hybrid fourier\n",
"bond_style harmonic\n",
"angle_style harmonic\n",
"dihedral_style fourier\n",
"improper_style cvff\n",
"special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.8333333333\n",
"\n",
Expand Down
6 changes: 3 additions & 3 deletions openff/interchange/components/mdconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@
)

if len(interchange["Bonds"].key_map) > 0:
lmp.write("bond_style hybrid harmonic\n")
lmp.write("bond_style harmonic\n")

if len(interchange["Angles"].key_map) > 0:
lmp.write("angle_style hybrid harmonic\n")
lmp.write("angle_style harmonic\n")

try:
if len(interchange["ProperTorsions"].key_map) > 0:
lmp.write("dihedral_style hybrid fourier\n")
lmp.write("dihedral_style fourier\n")

Check warning on line 297 in openff/interchange/components/mdconfig.py

View check run for this annotation

Codecov / codecov/patch

openff/interchange/components/mdconfig.py#L297

Added line #L297 was not covered by tests
except LookupError:
# no torsions here
pass
Expand Down
6 changes: 3 additions & 3 deletions openff/interchange/interop/lammps/export/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
k = k * 0.5 # Account for LAMMPS wrapping 1/2 into k
length = params["length"].to(unit.angstrom).magnitude

lmp_file.write(f"{bond_type_idx + 1:d} harmonic\t{k:.16g}\t{length:.16g}\n")
lmp_file.write(f"{bond_type_idx + 1:d}\t{k:.16g}\t{length:.16g}\n")

Check warning on line 164 in openff/interchange/interop/lammps/export/export.py

View check run for this annotation

Codecov / codecov/patch

openff/interchange/interop/lammps/export/export.py#L164

Added line #L164 was not covered by tests

lmp_file.write("\n")

Expand All @@ -180,7 +180,7 @@
k = k * 0.5 # Account for LAMMPS wrapping 1/2 into k
theta = params["angle"].to(unit.degree).magnitude

lmp_file.write(f"{angle_type_idx + 1:d} harmonic\t{k:.16g}\t{theta:.16g}\n")
lmp_file.write(f"{angle_type_idx + 1:d}\t{k:.16g}\t{theta:.16g}\n")

Check warning on line 183 in openff/interchange/interop/lammps/export/export.py

View check run for this annotation

Codecov / codecov/patch

openff/interchange/interop/lammps/export/export.py#L183

Added line #L183 was not covered by tests

lmp_file.write("\n")

Expand All @@ -202,7 +202,7 @@
k = k / idivf

lmp_file.write(
f"{proper_type_idx + 1:d} fourier 1\t{k:.16g}\t{n:d}\t{phase:.16g}\n",
f"{proper_type_idx + 1:d} 1\t{k:.16g}\t{n:d}\t{phase:.16g}\n",
)

lmp_file.write("\n")
Expand Down
Loading