Skip to content

Commit

Permalink
Merge pull request #1017 from pyiron/lmp_pressure
Browse files Browse the repository at this point in the history
Fix Lammps pressure
  • Loading branch information
jan-janssen committed Oct 2, 2020
2 parents 999b08c + cad12e1 commit 17dac14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyiron/lammps/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ def pressure_to_lammps(self, pressure, rotation_matrix):

# Get something with six elements
if not hasattr(pressure, "__len__"):
pressure = np.append(pressure * np.ones(3), 3 * [None])
if not np.isclose(np.matrix.trace(rotation_matrix), 3) and pressure == 0.0:
pressure = np.append(pressure * np.ones(3), pressure * np.ones(3))
else:
pressure = np.append(pressure * np.ones(3), 3 * [None])
else:
if len(pressure) > 6:
raise ValueError("Pressure can have a maximum of 6 values, (x, y, z, xy, xz, and yz), but got " +
Expand Down

0 comments on commit 17dac14

Please sign in to comment.