From 9a7489615a924284a2b33c8209e183e13c831fc7 Mon Sep 17 00:00:00 2001 From: Hongyi Zhao Date: Tue, 13 Feb 2024 18:33:55 +0800 Subject: [PATCH 1/3] Fix the project to run . --- OgreInterface/example.py | 13 +++++-------- OgreInterface/interfaces/interface.py | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/OgreInterface/example.py b/OgreInterface/example.py index 1d28a19..b21004f 100644 --- a/OgreInterface/example.py +++ b/OgreInterface/example.py @@ -9,11 +9,9 @@ film="./poscars/POSCAR_Al_conv", max_film_index=2, max_substrate_index=2, - max_linear_strain=0.01, - max_angle_strain=0.01, + max_strain=0.01, max_area_mismatch=0.01, - max_area=200, - convert_to_conventional=True, + max_area=200 ) ms.run_scan() ms.plot_misfits(fontsize=14, labelrotation=-20, figure_scale=1) @@ -35,8 +33,8 @@ ) # Select which Surface you want from the list of Surface's -sub = subs.slabs[0] -film = films.slabs[0] +sub = subs._slabs[0] +film = films._slabs[0] # Optional way to remove layers from the substrate or film (Usefull for complete control of termination) # sub.remove_layers(num_layers=3, top=False) @@ -46,8 +44,7 @@ interface_generator = InterfaceGenerator( substrate=sub, film=film, - max_linear_strain=0.01, - max_angle_strain=0.01, + max_strain=0.01, max_area_mismatch=0.01, max_area=200, interfacial_distance=2.0, diff --git a/OgreInterface/interfaces/interface.py b/OgreInterface/interfaces/interface.py index ef52ea8..a66b462 100644 --- a/OgreInterface/interfaces/interface.py +++ b/OgreInterface/interfaces/interface.py @@ -493,7 +493,7 @@ def write_file( if relax: poscar.selective_dynamics = to_relax - poscar_str = poscar.get_string() + poscar_str = poscar.get_str() else: syms = [site.specie.symbol for site in slab] From df9a502d1f84328a1a901f33a10ccaa19dcf8299 Mon Sep 17 00:00:00 2001 From: Hongyi Zhao Date: Wed, 14 Feb 2024 12:35:03 +0800 Subject: [PATCH 2/3] Fix the OgreInterface/example.py to use `center=True` to avoid atoms being erroneously placed in the box. --- OgreInterface/example.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OgreInterface/example.py b/OgreInterface/example.py index b21004f..b926278 100644 --- a/OgreInterface/example.py +++ b/OgreInterface/example.py @@ -47,8 +47,9 @@ max_strain=0.01, max_area_mismatch=0.01, max_area=200, - interfacial_distance=2.0, - vacuum=40, + interfacial_distance=4.0, + vacuum=20, + center=True, ) # Generate the interfaces From f36564e14d0c4744a8955f09bb21b62809038912 Mon Sep 17 00:00:00 2001 From: Hongyi Zhao Date: Fri, 16 Feb 2024 21:15:33 +0800 Subject: [PATCH 3/3] Change `get_string` to `get_str` to fix the following problem: AttributeError: 'Poscar' object has no attribute 'get_string' --- OgreInterface/interfaces/interface.py | 2 +- OgreInterface/interfaces/old_interface.py | 4 ++-- OgreInterface/surfaces/surface.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OgreInterface/interfaces/interface.py b/OgreInterface/interfaces/interface.py index a66b462..365ed3c 100644 --- a/OgreInterface/interfaces/interface.py +++ b/OgreInterface/interfaces/interface.py @@ -538,7 +538,7 @@ def write_file( if relax: poscar.selective_dynamics = to_relax - poscar_str = poscar.get_string().split("\n") + poscar_str = poscar.get_str().split("\n") poscar_str[5] = " ".join(new_atom_types) poscar_str[6] = " ".join(list(map(str, n_atoms))) poscar_str = "\n".join(poscar_str) diff --git a/OgreInterface/interfaces/old_interface.py b/OgreInterface/interfaces/old_interface.py index 5d35909..48e1138 100644 --- a/OgreInterface/interfaces/old_interface.py +++ b/OgreInterface/interfaces/old_interface.py @@ -944,7 +944,7 @@ def write_file( if relax: poscar.selective_dynamics = to_relax - poscar_str = poscar.get_string() + poscar_str = poscar.get_str() else: syms = [site.specie.symbol for site in slab] @@ -987,7 +987,7 @@ def write_file( if relax: poscar.selective_dynamics = to_relax - poscar_str = poscar.get_string().split("\n") + poscar_str = poscar.get_str().split("\n") poscar_str[5] = " ".join(new_atom_types) poscar_str[6] = " ".join(list(map(str, n_atoms))) poscar_str = "\n".join(poscar_str) diff --git a/OgreInterface/surfaces/surface.py b/OgreInterface/surfaces/surface.py index cb2c1d4..5410a88 100644 --- a/OgreInterface/surfaces/surface.py +++ b/OgreInterface/surfaces/surface.py @@ -177,7 +177,7 @@ def write_file( comment = self._get_base_poscar_comment_str(orthogonal=orthogonal) if not self._passivated: - poscar_str = Poscar(slab, comment=comment).get_string() + poscar_str = Poscar(slab, comment=comment).get_str() else: if relax: atomic_numbers = np.array(slab.atomic_numbers) @@ -231,7 +231,7 @@ def write_file( if relax: poscar.selective_dynamics = selective_dynamics - poscar_str = poscar.get_string().split("\n") + poscar_str = poscar.get_str().split("\n") poscar_str[5] = " ".join(new_atom_types) poscar_str[6] = " ".join(list(map(str, n_atoms))) poscar_str = "\n".join(poscar_str)