@@ -1232,7 +1232,25 @@ def finalize(self, verbose = 1):
12321232 self .__gw_err__ [- 1 ] * __RyTomev__ ))
12331233 print ("Kong-Liu effective sample size = " , self .ensemble .get_effective_sample_size ())
12341234 print ()
1235-
1235+
1236+ # Print the total force on the structure
1237+ print ("Total force on the centroids [eV/A]:" )
1238+ forces , err = self .ensembe .get_average_forces ()
1239+ # Apply the symmetries
1240+ if not self .neglect_symmetries :
1241+ qe_sym = CC .symmetries .QE_Symmetry (self .dyn .structure )
1242+ if self .use_spglib :
1243+ qe_sym .SetupFromSPGLIB ()
1244+ else :
1245+ qe_sym .SetupQPoint ()
1246+ qe_sym .SymmetrizeVector (forces )
1247+ qe_sym .SymmetrizeVector (err )
1248+ err /= np .sqrt (qe_sym .QE_nsym )
1249+
1250+ for i in range (self .dyn .structure .N_atoms ):
1251+ print ("{:4d}) {:14.6f}{:14.6f}{:14.6f} +- {:14.6f}{:14.6f}{:14.6f}" .format (* list ([i ] + list (forces [i , :] * CC .Units .RY_TO_EV ) + list (err [i ,:] * CC .Units .RY_TO_EV )))
1252+ print ()
1253+
12361254 if self .ensemble .has_stress and verbose >= 1 :
12371255 print ()
12381256 print (" ==== STRESS TENSOR [GPa] ==== " )
@@ -1387,9 +1405,9 @@ def check_stop(self):
13871405 print ()
13881406 print ("The gw gradient satisfy the convergence condition." )
13891407
1390- if self .gradi_op == "gc" :
1408+ if self .gradi_op == "gc" or not self . minim_struct :
13911409 total_cond = gc_cond
1392- elif self .gradi_op == "gw" :
1410+ elif self .gradi_op == "gw" or not self . minim_dyn :
13931411 total_cond = gw_cond
13941412 elif self .gradi_op == "all" :
13951413 total_cond = gc_cond and gw_cond
0 commit comments