From bb41b15c8b4425216b4e0e9cdeeaab998d33ba12 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 23 Apr 2024 15:35:18 -0500 Subject: [PATCH] More tests --- tests/test_ase_interface.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_ase_interface.py b/tests/test_ase_interface.py index 262e592..7dc001a 100644 --- a/tests/test_ase_interface.py +++ b/tests/test_ase_interface.py @@ -32,6 +32,8 @@ def test_static(self): ) lmp.interactive_lib_command("pair_style lj/cut 6.0") lmp.interactive_lib_command("pair_coeff 1 1 1.0 1.0 4.04") + lmp.interactive_lib_command(command="thermo_style custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol") + lmp.interactive_lib_command(command="thermo_modify format float %20.15g") lmp.interactive_lib_command("run 0") self.assertTrue(np.all(np.isclose(lmp.interactive_cells_getter(), structure.cell.array))) self.assertTrue(np.isclose(lmp.interactive_energy_pot_getter(), -0.04342932384411341)) @@ -41,17 +43,18 @@ def test_static(self): self.assertTrue(np.all(lmp.interactive_indices_getter() == [1] * len(structure))) self.assertEqual(lmp.interactive_steps_getter(), 0) self.assertEqual(lmp.interactive_temperatures_getter(), 0) + self.assertTrue(np.isclose(np.sum(lmp.interactive_pressures_getter()), -0.015661731917941832)) lmp.close() def test_static_with_statement(self): structure = bulk("Al").repeat([2, 2, 2]) with LammpsASELibrary( working_directory=None, - cores=1, + cores=2, comm=None, logger=None, log_file=None, - library=LammpsLibrary(cores=2, mode='local'), + library=None, diable_log_file=True, ) as lmp: lmp.interactive_lib_command(command="units lj") @@ -68,6 +71,8 @@ def test_static_with_statement(self): ) lmp.interactive_lib_command("pair_style lj/cut 6.0") lmp.interactive_lib_command("pair_coeff 1 1 1.0 1.0 4.04") + lmp.interactive_lib_command(command="thermo_style custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol") + lmp.interactive_lib_command(command="thermo_modify format float %20.15g") lmp.interactive_lib_command("run 0") self.assertTrue(np.isclose(lmp.interactive_energy_pot_getter(), -0.3083820387630098)) self.assertTrue(np.isclose(lmp.interactive_energy_tot_getter(), -0.3083820387630098)) @@ -76,3 +81,4 @@ def test_static_with_statement(self): self.assertTrue(np.all(lmp.interactive_indices_getter() == [1] * len(structure))) self.assertEqual(lmp.interactive_steps_getter(), 0) self.assertEqual(lmp.interactive_temperatures_getter(), 0) + self.assertTrue(np.isclose(np.sum(lmp.interactive_pressures_getter()), -0.00937227406237915))