From 95f98c05113cee196b00fc6cafa43280c286246c Mon Sep 17 00:00:00 2001 From: Marvin Poul Date: Mon, 24 Jun 2024 11:26:12 +0200 Subject: [PATCH] Do not fix NH during NVT melting --- calphy/liquid.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/calphy/liquid.py b/calphy/liquid.py index 9f0d32f..6473199 100644 --- a/calphy/liquid.py +++ b/calphy/liquid.py @@ -58,10 +58,10 @@ def melt_structure(self, lmp): """ """ melted = False - + #this is the multiplier for thigh to try melting routines for thmult in np.arange(1.0, 2.0, 0.1): - + trajfile = os.path.join(self.simfolder, "traj.melt") if os.path.exists(trajfile): os.remove(trajfile) @@ -69,10 +69,12 @@ def melt_structure(self, lmp): self.logger.info("Starting melting cycle with thigh temp %f, factor %f"%(self.calc._temperature_high, thmult)) factor = (self.calc._temperature_high/self.calc._temperature)*thmult lmp.velocity("all create", self.calc._temperature*factor, np.random.randint(1, 10000)) - self.fix_nose_hoover(lmp, temp_start_factor=factor, temp_end_factor=factor) + if self.calc._pressure is not None: + self.fix_nose_hoover(lmp, temp_start_factor=factor, temp_end_factor=factor) lmp.run(int(self.calc.md.n_small_steps)) - self.unfix_nose_hoover(lmp) - + if self.calc._pressure is not None: + self.unfix_nose_hoover(lmp) + self.dump_current_snapshot(lmp, "traj.melt") #we have to check if the structure melted @@ -81,7 +83,7 @@ def melt_structure(self, lmp): if (solids/self.natoms < self.calc.tolerance.liquid_fraction): melted = True break - + #if melting cycle is over and still not melted, raise error if not melted: lmp.close()