diff --git a/examples/mliap/mliap_numpy_Ta06A.py b/examples/mliap/mliap_numpy_Ta06A.py index 25c928cd89..180d221d35 100644 --- a/examples/mliap/mliap_numpy_Ta06A.py +++ b/examples/mliap/mliap_numpy_Ta06A.py @@ -85,8 +85,7 @@ class LinearModel(): def __call__(self,elems,bispectrum,beta,energy): energy[:] = bispectrum @ self.weights + self.bias beta[:] = self.weights - - + mymodel = LinearModel("Ta06A.mliap.model") import lammps @@ -98,4 +97,5 @@ lammps.mliap.activate_mliappy(lmp) lmp.commands_string(before_loading) lammps.mliap.load_model(mymodel) lmp.commands_string(after_loading) - +lmp.close() +lmp.finalize() diff --git a/examples/mliap/mliap_pytorch_Ta06A.py b/examples/mliap/mliap_pytorch_Ta06A.py index 589c9661b8..7c8949d8d6 100644 --- a/examples/mliap/mliap_pytorch_Ta06A.py +++ b/examples/mliap/mliap_pytorch_Ta06A.py @@ -103,6 +103,8 @@ model = torch.load(torch_model) # Connect the PyTorch model to the mliap pair style. lammps.mliap.load_model(model) - + # run the simulation with the mliap pair style lmp.commands_string(after_loading) +lmp.close() +lmp.finalize() diff --git a/examples/mliap/mliap_pytorch_Ta06A_kokkos.py b/examples/mliap/mliap_pytorch_Ta06A_kokkos.py index f0d2b9bf3e..8afa3f0df3 100644 --- a/examples/mliap/mliap_pytorch_Ta06A_kokkos.py +++ b/examples/mliap/mliap_pytorch_Ta06A_kokkos.py @@ -103,6 +103,8 @@ model = torch.load(torch_model) # Connect the PyTorch model to the mliap pair style. lammps.mliap.load_model_kokkos(model) - + # run the simulation with the mliap pair style lmp.commands_string(after_loading) +lmp.close() +lmp.finalize() diff --git a/examples/mliap/mliap_unified_lj_Ar.py b/examples/mliap/mliap_unified_lj_Ar.py index 2b404bd98e..d48bdd385a 100644 --- a/examples/mliap/mliap_unified_lj_Ar.py +++ b/examples/mliap/mliap_unified_lj_Ar.py @@ -6,30 +6,30 @@ before_loading =\ """# 3d Lennard-Jones melt -units lj -atom_style atomic +units lj +atom_style atomic -lattice fcc 0.8442 -region box block 0 10 0 10 0 10 -create_box 1 box -create_atoms 1 box -mass 1 1.0 +lattice fcc 0.8442 +region box block 0 10 0 10 0 10 +create_box 1 box +create_atoms 1 box +mass 1 1.0 -velocity all create 3.0 87287 loop geom +velocity all create 3.0 87287 loop geom """ after_loading =\ """ -pair_style mliap unified EXISTS -pair_coeff * * Ar +pair_style mliap unified EXISTS +pair_coeff * * Ar -neighbor 0.3 bin -neigh_modify every 20 delay 0 check no +neighbor 0.3 bin +neigh_modify every 20 delay 0 check no -fix 1 all nve +fix 1 all nve -thermo 50 -run 250 +thermo 50 +run 250 """ import lammps @@ -63,3 +63,5 @@ lammps.mliap.load_unified(unified) # Run the simulation with the mliap unified pair style # Use pre-loaded model by specifying model filename as "EXISTS" lmp.commands_string(after_loading) +lmp.close() +lmp.finalize()