From 9b68ebdc52e21718653181f2734e1ba66e805fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Gaspard?= Date: Wed, 10 Mar 2021 09:32:15 +0100 Subject: [PATCH] Corrected a bug in the generation of the big cell --- src/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index a366955..dfea4ea 100644 --- a/src/utils.py +++ b/src/utils.py @@ -60,15 +60,19 @@ def big_cell(generator,symGenerator,a,b,c,alpha,beta,gamma,nA,nB,nC): r1 = np.array(coords[i][:3]) r2 = np.array(coords[j][:3]) r12 = r1-r2 + da = np.sqrt(r12[0]**2+r12[1]**2+r12[2]**2) r12 = r12 - np.round(r12) + db = da - np.sqrt(r12[0]**2+r12[1]**2+r12[2]**2) r12 = np.matmul(fracToCart,r12) 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 if j not in toDel: toDel.append(j) + toDel = sorted(toDel) + # We delete the atoms in the list for i in range(len(toDel)): 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) coords.append([rxyz[0],rxyz[1],rxyz[2],at[3],'C']) + # Returns the list of the atoms [x,y,z,label,second_label] return coords