Skip to content

Commit b4a9f94

Browse files
committed
Other fix in the load_noncomputed_ensemble
1 parent 54c8ad9 commit b4a9f94

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

Modules/Ensemble.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,9 @@ def load(self, data_dir, population, N, verbose = False, load_displacements = Tr
681681

682682

683683

684+
if timer:
685+
timer.add_timer("Load_all_configurations", time.time() - t_before_for)
686+
684687
if verbose:
685688
print( "[LOAD ENSEMBLE]: time elapsed for the cycle over the configurations:", time.time() - t_before_for)
686689

@@ -692,9 +695,6 @@ def load(self, data_dir, population, N, verbose = False, load_displacements = Tr
692695
total_energies = np.loadtxt(os.path.join(data_dir, "energies_supercell_population%d.dat" % (population)))
693696
self.energies = total_energies[:N]
694697

695-
# Initialize all the auxiliary harmonic quantities for this ensemble
696-
self.init()
697-
698698
# Setup the initial weight
699699
self.rho = np.ones(self.N, dtype = np.float64)
700700

@@ -773,6 +773,11 @@ def load_from_calculator_output(self, directory, out_ext = ".pwo", timer=None):
773773

774774
self.u_disps = np.zeros( (self.N, nat_sc * 3), order = "F", dtype = np.float64)
775775

776+
# Initialize the computation of energy and forces
777+
self.force_computed = np.ones(self.N, dtype = bool)
778+
self.stress_computed = np.ones(self.N, dtype = bool)
779+
self.all_properties = [None] * self.N
780+
776781
# Add a counter to check if all the stress tensors are present
777782
count_stress = 0
778783

@@ -815,16 +820,12 @@ def load_from_calculator_output(self, directory, out_ext = ".pwo", timer=None):
815820
except:
816821
pass
817822

818-
819-
# Initialize the SSCHA quantities
820-
self.init()
821-
822823
self.rho = np.ones(self.N, dtype = np.float64)
823824

824825
t1 = time.time()
825-
self.q_start = CC.Manipulate.GetQ_vectors(self.structures, dyn_supercell, self.u_disps)
826+
# self.q_start = CC.Manipulate.GetQ_vectors(self.structures, dyn_supercell, self.u_disps)
826827
t2 = time.time()
827-
self.current_q = self.q_start.copy()
828+
# self.current_q = self.q_start.copy()
828829

829830
if count_stress == self.N:
830831
self.has_stress = True

0 commit comments

Comments
 (0)