From 0ec186cb8d7c5b8e4c51b8de8a37dea3f2ea6f2c Mon Sep 17 00:00:00 2001 From: Sarath Menon Date: Fri, 16 Feb 2024 18:10:19 +0100 Subject: [PATCH] add mass command --- calphy/alchemy.py | 3 +++ calphy/liquid.py | 2 ++ calphy/phase.py | 3 +++ calphy/solid.py | 3 +++ 4 files changed, 11 insertions(+) diff --git a/calphy/alchemy.py b/calphy/alchemy.py index 53b6cf0..85e5ce7 100644 --- a/calphy/alchemy.py +++ b/calphy/alchemy.py @@ -84,6 +84,7 @@ def run_averaging(self): #set up potential lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #add some computes lmp.command("variable mvol equal vol") @@ -156,6 +157,8 @@ def run_integration(self, iteration=1): #set up hybrid potential #here we only need to set one potential lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) + #lmp = ph.set_double_hybrid_potential(lmp, self.options, self.calc._pressureair_style, self.calc._pressureair_coeff) #remap the box to get the correct pressure diff --git a/calphy/liquid.py b/calphy/liquid.py index 6f83a43..c07bad9 100644 --- a/calphy/liquid.py +++ b/calphy/liquid.py @@ -120,6 +120,7 @@ def run_averaging(self): #set up potential lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #Melt regime for the liquid lmp.velocity("all create", self.calc._temperature_high, np.random.randint(1, 10000)) @@ -188,6 +189,7 @@ def run_integration(self, iteration=1): #set hybrid ufm and normal potential #lmp = ph.set_hybrid_potential(lmp, self.options, self.eps) lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #remap the box to get the correct pressure lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz) diff --git a/calphy/phase.py b/calphy/phase.py index 06a6597..291f1bd 100644 --- a/calphy/phase.py +++ b/calphy/phase.py @@ -737,6 +737,7 @@ def reversible_scaling(self, iteration=1): #set up potential lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #remap the box to get the correct pressure lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz) @@ -927,6 +928,7 @@ def temperature_scaling(self, iteration=1): #set up potential lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #remap the box to get the correct pressure lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz) @@ -1018,6 +1020,7 @@ def pressure_scaling(self, iteration=1): #set up potential lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #remap the box to get the correct pressure lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz) diff --git a/calphy/solid.py b/calphy/solid.py index 9ac49d5..78c7c9c 100644 --- a/calphy/solid.py +++ b/calphy/solid.py @@ -222,6 +222,7 @@ def run_interactive_averaging(self): lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') else: lmp.command("include %s"%self.calc.potential_file) + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #add some computes lmp.command("variable mvol equal vol") @@ -300,6 +301,7 @@ def run_minimal_averaging(self): lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') else: lmp.command("include %s"%self.calc.potential_file) + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #add some computes @@ -382,6 +384,7 @@ def run_integration(self, iteration=1): lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}') else: lmp.command("include %s"%self.calc.potential_file) + lmp = ph.set_mass(lmp, self.calc, ghost_elements==self.calc._ghost_element_count) #remap the box to get the correct pressure lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz)