Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order #106

Merged
merged 8 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand Down
11 changes: 9 additions & 2 deletions calphy/liquid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down
15 changes: 12 additions & 3 deletions calphy/phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
25 changes: 19 additions & 6 deletions calphy/solid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
Loading