Andrei tomut commited on
Commit
fc322db
1 Parent(s): e2f1e25

strain problems

Browse files
backend/latmathcher/latmatcher.py CHANGED
@@ -94,6 +94,8 @@ class LatMatch:
94
  self.bounds = [(-smax[0], smax[0]), (-smax[1], smax[1])]
95
  else:
96
  smax = self.smax
 
 
97
  self.bounds = [(-smax[0], smax[0]), (-smax[1], smax[1]), (self.theta_range[0], self.theta_range[1])]
98
 
99
  print("cost without otimization", self.fitness([0, 0, 0]))
 
94
  self.bounds = [(-smax[0], smax[0]), (-smax[1], smax[1])]
95
  else:
96
  smax = self.smax
97
+ print("Smax:", smax)
98
+ print("theta_range:", self.theta_range)
99
  self.bounds = [(-smax[0], smax[0]), (-smax[1], smax[1]), (self.theta_range[0], self.theta_range[1])]
100
 
101
  print("cost without otimization", self.fitness([0, 0, 0]))
backend/latmathcher/pipeline.py CHANGED
@@ -8,7 +8,7 @@ from .latmatcher import LatMatch, SR
8
  class PipelineLatMatch:
9
 
10
  def __init__(self, Alat3D, Blat3D, Aatoms3D=None, Batoms3D=None, dim=10, sc_vec=None, optimize_angle=True,
11
- optimize_strain=True, dz=4, min_angle=5 * np.pi / 180, max_strain=0.1):
12
 
13
  self.Alat3D = Alat3D
14
  self.Blat3D = Blat3D
@@ -24,7 +24,7 @@ class PipelineLatMatch:
24
  else:
25
  self.matcher4 = LatMatch(scdim=dim, reference=self.Alat, target=self.Blat,
26
  optimize_angle=optimize_angle, optimize_strain=optimize_strain)
27
- self.matcher4.setMaxStrain([max_strain, max_strain])
28
  self.matcher4.setMaxStrain(min_angle)
29
  self.sc_vec = self.matcher4.supercell()
30
  self.rez = self.matcher4.result
 
8
  class PipelineLatMatch:
9
 
10
  def __init__(self, Alat3D, Blat3D, Aatoms3D=None, Batoms3D=None, dim=10, sc_vec=None, optimize_angle=True,
11
+ optimize_strain=True, dz=4, min_angle=5 * np.pi / 180, max_strain=[0.1, 0.1]):
12
 
13
  self.Alat3D = Alat3D
14
  self.Blat3D = Blat3D
 
24
  else:
25
  self.matcher4 = LatMatch(scdim=dim, reference=self.Alat, target=self.Blat,
26
  optimize_angle=optimize_angle, optimize_strain=optimize_strain)
27
+ self.matcher4.setMaxStrain(max_strain)
28
  self.matcher4.setMaxStrain(min_angle)
29
  self.sc_vec = self.matcher4.supercell()
30
  self.rez = self.matcher4.result