@@ -609,6 +609,8 @@ def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
609609 if ensemble_loc is not None and self .save_ensemble :
610610 self .minim .ensemble .save_bin (ensemble_loc , pop )
611611
612+
613+
612614 self .minim .population = pop
613615 self .minim .init (delete_previous_data = False )
614616
@@ -625,6 +627,11 @@ def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
625627 stress_tensor *= sscha .SchaMinimizer .__RyBohr3_to_evA3__
626628 stress_err *= sscha .SchaMinimizer .__RyBohr3_to_evA3__
627629
630+ # Check if the stress tensor is actually loaded in the ensemble
631+ if np .max (np .abs (self .minim .ensemble .stresses )) < 1e-10 :
632+ # Probably there is an error in the submission of the stress tensor calculation
633+ raise ValueError ("Error, the stress tensor is not loaded in the ensemble. Check the stress tensor calculation." )
634+
628635 # Get the pressure
629636 Press = np .trace (stress_tensor ) / 3
630637
@@ -676,7 +683,7 @@ def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
676683 Gibbs Free energy = {:.10e} eV {}
677684 Zero energy = {:.10e} eV
678685
679- """ .format (Press / CC .Units .GPA_TO_EV_PER_A3 , press_err / CC .Units .GPA_TO_EV_PER_A3 , target_press , Vol ,target_press_evA3 * Vol , helmoltz , mark_helmoltz , gibbs , mark_gibbs , self .minim .eq_energy )
686+ """ .format (Press / CC .Units .GPA_TO_EV_PER_A3 , press_err / CC .Units .GPA_TO_EV_PER_A3 , target_press , target_press , Vol , target_press_evA3 * Vol , helmoltz , mark_helmoltz , gibbs , mark_gibbs , self .minim .eq_energy )
680687 print (message )
681688 # print " ====================== "
682689 # print " ENTHALPIC CONTRIBUTION "
0 commit comments