|
11 | 11 |
|
12 | 12 | from dpgen.auto_test.common_equi import make_equi, run_equi |
13 | 13 | from dpgen.auto_test.Lammps import Lammps |
14 | | -from dpgen.auto_test.lib.lammps import inter_deepmd |
| 14 | +from dpgen.auto_test.lib.lammps import inter_deepmd, inter_eam_alloy, inter_meam |
15 | 15 |
|
16 | 16 | from .context import setUpModule # noqa: F401 |
17 | 17 |
|
@@ -72,6 +72,32 @@ def test_set_model_param(self): |
72 | 72 | } |
73 | 73 | self.assertEqual(model_param, self.Lammps.model_param) |
74 | 74 |
|
| 75 | + def test_meam_model_parameters_generate_two_file_command(self): |
| 76 | + interaction = { |
| 77 | + "type": "meam", |
| 78 | + "model": ["lammps_input/meam.lib", "lammps_input/Al.meam"], |
| 79 | + "type_map": {"Al": 0}, |
| 80 | + } |
| 81 | + calculator = Lammps(interaction, self.source_path + "/Al-fcc.vasp") |
| 82 | + calculator.set_model_param() |
| 83 | + |
| 84 | + self.assertEqual(calculator.model_param["model_name"], ["meam.lib", "Al.meam"]) |
| 85 | + command = inter_meam(calculator.model_param) |
| 86 | + self.assertIn("pair_coeff * * meam.lib Al Al.meam Al", command) |
| 87 | + |
| 88 | + def test_eam_alloy_command_uses_plain_filename(self): |
| 89 | + interaction = { |
| 90 | + "type": "eam_alloy", |
| 91 | + "model": "lammps_input/Al.eam.alloy", |
| 92 | + "type_map": {"Al": 0}, |
| 93 | + } |
| 94 | + calculator = Lammps(interaction, self.source_path + "/Al-fcc.vasp") |
| 95 | + calculator.set_model_param() |
| 96 | + |
| 97 | + command = inter_eam_alloy(calculator.model_param) |
| 98 | + self.assertIn("pair_coeff * * Al.eam.alloy Al", command) |
| 99 | + self.assertNotIn("['Al.eam.alloy']", command) |
| 100 | + |
75 | 101 | def test_make_potential_files(self): |
76 | 102 | cwd = os.getcwd() |
77 | 103 | abs_equi_path = os.path.abspath(self.equi_path) |
|
0 commit comments