Spaces:
Runtime error
Runtime error
Andrei tomut
commited on
Commit
•
c592240
1
Parent(s):
7459d43
ns
Browse files
interface_connection/latmatcher_interface.py
CHANGED
@@ -81,7 +81,7 @@ def compute_supercell_a(file_material_a, file_material_b,inter_distance , max_an
|
|
81 |
B_cell=B_structure["cell"]
|
82 |
|
83 |
inter_distance=[0,0,inter_distance]
|
84 |
-
super_xyz, min_supercel= compute_supercell(A_cell, B_cell, A_structure, B_structure, inter_distance )
|
85 |
rez=min_supercel.rez
|
86 |
|
87 |
# Write the new file:
|
@@ -93,7 +93,7 @@ def compute_supercell_a(file_material_a, file_material_b,inter_distance , max_an
|
|
93 |
|
94 |
|
95 |
xyz_content = f"{len(super_xyz)}\n"
|
96 |
-
xyz_content +="Lattice=\"{}\"".format(np.array2string(
|
97 |
separator=', ',
|
98 |
max_line_width=np.inf).replace("\n"," ").replace("[","").replace("]","").replace(",",""))+" pbc=\"T T F\""+"\n"
|
99 |
xyz_content += "\n".join([f"{atom[0]} {' '.join(map(str, atom[1]))}" for atom in super_xyz])
|
@@ -118,7 +118,7 @@ def compute_supercell(A_cell, B_cell,A_structure,B_structure,inter_distance ):
|
|
118 |
|
119 |
new_structure = min_supercel.get_new_structure(inter_distance)
|
120 |
super_xyz = structure_ato_list(new_structure)
|
121 |
-
return super_xyz, min_supercel
|
122 |
|
123 |
|
124 |
|
|
|
81 |
B_cell=B_structure["cell"]
|
82 |
|
83 |
inter_distance=[0,0,inter_distance]
|
84 |
+
super_xyz, min_supercel, new_structure= compute_supercell(A_cell, B_cell, A_structure, B_structure, inter_distance )
|
85 |
rez=min_supercel.rez
|
86 |
|
87 |
# Write the new file:
|
|
|
93 |
|
94 |
|
95 |
xyz_content = f"{len(super_xyz)}\n"
|
96 |
+
xyz_content +="Lattice=\"{}\"".format(np.array2string(new_structure['lattice_vectors'],
|
97 |
separator=', ',
|
98 |
max_line_width=np.inf).replace("\n"," ").replace("[","").replace("]","").replace(",",""))+" pbc=\"T T F\""+"\n"
|
99 |
xyz_content += "\n".join([f"{atom[0]} {' '.join(map(str, atom[1]))}" for atom in super_xyz])
|
|
|
118 |
|
119 |
new_structure = min_supercel.get_new_structure(inter_distance)
|
120 |
super_xyz = structure_ato_list(new_structure)
|
121 |
+
return super_xyz, min_supercel, new_structure
|
122 |
|
123 |
|
124 |
|