Skip to content

Commit b142278

Browse files
committed
Added the possibility to save the ensemble
1 parent ccf37a4 commit b142278

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Modules/Relax.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def __init__(self, minimizer = None, ase_calculator=None, N_configs=1, max_pop =
8989
# If the ensemble must be saved at each iteration.
9090
#
9191
self.save_ensemble = save_ensemble
92+
self.save_dyn = True # Save the dynamical matrix at each iteration
9293
self.data_dir = "data"
9394

9495

@@ -379,7 +380,7 @@ def relax(self, restart_from_ens = False, get_stress = False,
379380
self.minim.dyn.dynmats[iq] = fcq[iq, :, :]
380381

381382
# Save the dynamical matrix
382-
if self.save_ensemble:
383+
if self.save_ensemble or self.save_dyn:
383384
self.minim.dyn.save_qe("dyn_pop%d_" % pop)
384385

385386
# Check if it is converged
@@ -700,7 +701,8 @@ def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
700701
self.minim.dyn.dynmats[iq] = fcq[iq, :, :]
701702

702703
# Save the dynamical matrix
703-
self.minim.dyn.save_qe("dyn_pop%d_" % pop)
704+
if self.save_ensemble or self.save_dyn:
705+
self.minim.dyn.save_qe("dyn_pop%d_" % pop)
704706

705707
# Check if the constant volume calculation is converged
706708
running1 = not self.minim.is_converged()

0 commit comments

Comments
 (0)