mirror of
https://github.com/NehZio/Crystal-MEC
synced 2025-01-03 10:05:59 +01:00
Corrected a bug in the generation of the big cell
This commit is contained in:
parent
ca0318c37b
commit
9b68ebdc52
@ -60,15 +60,19 @@ def big_cell(generator,symGenerator,a,b,c,alpha,beta,gamma,nA,nB,nC):
|
|||||||
r1 = np.array(coords[i][:3])
|
r1 = np.array(coords[i][:3])
|
||||||
r2 = np.array(coords[j][:3])
|
r2 = np.array(coords[j][:3])
|
||||||
r12 = r1-r2
|
r12 = r1-r2
|
||||||
|
da = np.sqrt(r12[0]**2+r12[1]**2+r12[2]**2)
|
||||||
r12 = r12 - np.round(r12)
|
r12 = r12 - np.round(r12)
|
||||||
|
db = da - np.sqrt(r12[0]**2+r12[1]**2+r12[2]**2)
|
||||||
r12 = np.matmul(fracToCart,r12)
|
r12 = np.matmul(fracToCart,r12)
|
||||||
d = np.sqrt(r12[0]**2+r12[1]**2+r12[2]**2)
|
d = np.sqrt(r12[0]**2+r12[1]**2+r12[2]**2)
|
||||||
|
|
||||||
if(d<1e-5):
|
if(d<1e-2):
|
||||||
# We check if we don't already want to delete this atom
|
# We check if we don't already want to delete this atom
|
||||||
if j not in toDel:
|
if j not in toDel:
|
||||||
toDel.append(j)
|
toDel.append(j)
|
||||||
|
|
||||||
|
toDel = sorted(toDel)
|
||||||
|
|
||||||
# We delete the atoms in the list
|
# We delete the atoms in the list
|
||||||
for i in range(len(toDel)):
|
for i in range(len(toDel)):
|
||||||
coords.pop(toDel[i]-i)
|
coords.pop(toDel[i]-i)
|
||||||
@ -101,6 +105,7 @@ def big_cell(generator,symGenerator,a,b,c,alpha,beta,gamma,nA,nB,nC):
|
|||||||
rxyz = np.matmul(fracToCart,r)
|
rxyz = np.matmul(fracToCart,r)
|
||||||
coords.append([rxyz[0],rxyz[1],rxyz[2],at[3],'C'])
|
coords.append([rxyz[0],rxyz[1],rxyz[2],at[3],'C'])
|
||||||
|
|
||||||
|
|
||||||
# Returns the list of the atoms [x,y,z,label,second_label]
|
# Returns the list of the atoms [x,y,z,label,second_label]
|
||||||
return coords
|
return coords
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user