From 19a92fb4319a29b3c46f45aa7f92aaeb54aba561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Gaspard?= Date: Wed, 10 Mar 2021 18:31:18 +0100 Subject: [PATCH] Corrected a bug when not using evjen --- crystal_mec.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crystal_mec.py b/crystal_mec.py index f833494..583229e 100644 --- a/crystal_mec.py +++ b/crystal_mec.py @@ -131,10 +131,11 @@ if __name__=='__main__': charges = evjen_charges(coordinates,atoms) else: charges = [] + atoms = np.array(atoms).flatten() for i in range(len(coordinates)): li = coordinates[i][3] - ii = np.where(atoms=li)[0] - charges.append(atoms[ii+1]) + ii = np.where(atoms==li)[0] + charges.append(float(atoms[ii+1])) if verbose > 1: print("The total charge fragment+pseudopotential+bath is : % 8.6f\n"%np.sum(charges))