Andrei tomut commited on
Commit
4883dc5
1 Parent(s): 9b962b2

interatomic distance

Browse files
backend/latmathcher/pipeline.py CHANGED
@@ -97,7 +97,7 @@ class PipelineLatMatch:
97
 
98
  return self.superA_xyz, self.superB_xyz
99
 
100
- def get_new_structure(self):
101
 
102
  structure = {"atoms": [],
103
  "lattice_vectors": self.sc_vec3,
@@ -124,6 +124,8 @@ class PipelineLatMatch:
124
  for element in superB_xyz:
125
  structure["host_guest"].append("guest")
126
  symbol = element[0]
 
 
127
  positions.append(element[1].tolist())
128
  atomic_number = getattr(periodictable, symbol)
129
  if atomic_number is not None:
 
97
 
98
  return self.superA_xyz, self.superB_xyz
99
 
100
+ def get_new_structure(self, inter_distance=[0,0,0]):
101
 
102
  structure = {"atoms": [],
103
  "lattice_vectors": self.sc_vec3,
 
124
  for element in superB_xyz:
125
  structure["host_guest"].append("guest")
126
  symbol = element[0]
127
+ pos=element[1].tolist()+inter_distance
128
+
129
  positions.append(element[1].tolist())
130
  atomic_number = getattr(periodictable, symbol)
131
  if atomic_number is not None:
interface_connection/latmatcher_interface.py CHANGED
@@ -80,8 +80,8 @@ def compute_supercell_a(file_material_a, file_material_b,inter_distance , max_an
80
  B_structure = extract_from_bespoke(file2)
81
  B_cell=B_structure["cell"]
82
 
83
-
84
- super_xyz, min_supercel= compute_supercell(A_cell, B_cell, A_structure, B_structure )
85
  rez=min_supercel.rez
86
 
87
  # Write the new file:
@@ -110,13 +110,13 @@ def compute_supercell_a(file_material_a, file_material_b,inter_distance , max_an
110
  def compute_supercell_b():
111
  pass
112
 
113
- def compute_supercell(A_cell, B_cell,A_structure,B_structure ):
114
 
115
  min_supercel = PipelineLatMatch(A_cell, B_cell, Aatoms3D=structure_ato_list(A_structure),
116
  Batoms3D=structure_ato_list(B_structure), dim=(10, 10), optimize_angle=True,
117
  optimize_strain=True)
118
 
119
- new_structure = min_supercel.get_new_structure()
120
  super_xyz = structure_ato_list(new_structure)
121
  return super_xyz, min_supercel
122
 
 
80
  B_structure = extract_from_bespoke(file2)
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:
 
110
  def compute_supercell_b():
111
  pass
112
 
113
+ def compute_supercell(A_cell, B_cell,A_structure,B_structure,inter_distance ):
114
 
115
  min_supercel = PipelineLatMatch(A_cell, B_cell, Aatoms3D=structure_ato_list(A_structure),
116
  Batoms3D=structure_ato_list(B_structure), dim=(10, 10), optimize_angle=True,
117
  optimize_strain=True)
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