Skip to content

Commit

Permalink
Merge pull request #106 from ICAMS/fix_order
Browse files Browse the repository at this point in the history
Fix order
srmnitc authored Feb 17, 2024

Verified

This commit was signed with the committer’s verified signature.
driesvints Dries Vints
2 parents d8c50b6 + 880e651 commit 564d2bc
Showing 5 changed files with 54 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -18,3 +18,8 @@ tscale-*
pscale-*
alchemy-*
*.npy
*.data
*.dump
mts-*
melting_temperature-*
composition_scaling-*
11 changes: 9 additions & 2 deletions calphy/alchemy.py
Original file line number Diff line number Diff line change
@@ -77,11 +77,14 @@ def run_averaging(self):
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep,
self.calc.md.cmdargs, self.calc.md.init_commands)

lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#set up structure
lmp = ph.create_structure(lmp, self.calc)

#set up potential
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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")
@@ -143,6 +146,8 @@ def run_integration(self, iteration=1):
# Adiabatic switching parameters.
lmp.command("variable li equal 1.0")
lmp.command("variable lf equal 0.0")

lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#read dump file
#conf = os.path.join(self.simfolder, "conf.equilibration.dump")
@@ -151,7 +156,9 @@ def run_integration(self, iteration=1):

#set up hybrid potential
#here we only need to set one potential
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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
11 changes: 9 additions & 2 deletions calphy/liquid.py
Original file line number Diff line number Diff line change
@@ -113,11 +113,14 @@ def run_averaging(self):
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep,
self.calc.md.cmdargs, self.calc.md.init_commands)

lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#set up structure
lmp = ph.create_structure(lmp, self.calc)

#set up potential
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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))
@@ -175,14 +178,18 @@ def run_integration(self, iteration=1):
lmp.command("variable li equal 1.0")
lmp.command("variable lf equal 0.0")


lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#read in the conf file
#conf = os.path.join(self.simfolder, "conf.equilibration.dump")
conf = os.path.join(self.simfolder, "conf.equilibration.data")
lmp = ph.read_data(lmp, conf)

#set hybrid ufm and normal potential
#lmp = ph.set_hybrid_potential(lmp, self.options, self.eps)
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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)
15 changes: 12 additions & 3 deletions calphy/phase.py
Original file line number Diff line number Diff line change
@@ -728,13 +728,16 @@ def reversible_scaling(self, iteration=1):
lmp.command("variable li equal %f"%li)
lmp.command("variable lf equal %f"%lf)

lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#read in conf file
#conf = os.path.join(self.simfolder, "conf.equilibration.dump")
conf = os.path.join(self.simfolder, "conf.equilibration.data")
lmp = ph.read_data(lmp, conf)

#set up potential
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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)
@@ -916,13 +919,16 @@ def temperature_scaling(self, iteration=1):
lmp.command("variable li equal %f"%li)
lmp.command("variable lf equal %f"%lf)

lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#read in conf
#conf = os.path.join(self.simfolder, "conf.equilibration.dump")
conf = os.path.join(self.simfolder, "conf.equilibration.data")
lmp = ph.read_data(lmp, conf)

#set up potential
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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)
@@ -1005,13 +1011,16 @@ def pressure_scaling(self, iteration=1):
lmp.command("variable p0 equal %f"%p0)
lmp.command("variable pf equal %f"%pf)

lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#read in conf
#conf = os.path.join(self.simfolder, "conf.dump")
conf = os.path.join(self.simfolder, "conf.equilibration.data")
lmp = ph.read_data(lmp, conf)

#set up potential
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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)
25 changes: 19 additions & 6 deletions calphy/solid.py
Original file line number Diff line number Diff line change
@@ -211,14 +211,18 @@ def run_interactive_averaging(self):
init_commands=self.calc.md.init_commands,
script_mode=self.calc.script_mode)

#set up potential
if self.calc.potential_file is None:
lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#set up structure
lmp = ph.create_structure(lmp, self.calc)

#set up potential
if self.calc.potential_file is None:
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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")
@@ -286,14 +290,19 @@ def run_minimal_averaging(self):
init_commands=self.calc.md.init_commands,
script_mode=self.calc.script_mode)

#set up potential
if self.calc.potential_file is None:
lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#set up structure
lmp = ph.create_structure(lmp, self.calc, species=self.calc.n_elements+self.calc._ghost_element_count)

#set up potential
if self.calc.potential_file is None:
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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")
@@ -362,16 +371,20 @@ def run_integration(self, iteration=1):
init_commands=self.calc.md.init_commands,
script_mode=self.calc.script_mode)

#set up potential
if self.calc.potential_file is None:
lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')

#read in the conf file
#conf = os.path.join(self.simfolder, "conf.equilibration.dump")
conf = os.path.join(self.simfolder, "conf.equilibration.data")
lmp = ph.read_data(lmp, conf)

#set up potential
if self.calc.potential_file is None:
lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
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)

0 comments on commit 564d2bc

Please sign in to comment.