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

Allow custom cmdargs for lammps object #46

Merged
merged 4 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions calphy/alchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def run_averaging(self):
Fix lattice option is not implemented at present.
At the end of the run, the averaged box dimensions are calculated.
"""
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

#set up structure
lmp = ph.create_structure(lmp, self.calc)
Expand Down Expand Up @@ -137,7 +137,7 @@ def run_integration(self, iteration=1):
"""

#create lammps object
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

# Adiabatic switching parameters.
lmp.command("variable li equal 1.0")
Expand Down
4 changes: 2 additions & 2 deletions calphy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from pyscal.trajectory import Trajectory


def create_object(cores, directory, timestep):
def create_object(cores, directory, timestep, cmdargs=None):
"""
Create LAMMPS object
Expand All @@ -52,7 +52,7 @@ def create_object(cores, directory, timestep):
lmp : LammpsLibrary object
"""
lmp = LammpsLibrary(mode="local", cores=cores,
working_directory=directory)
working_directory=directory, cmdargs=cmdargs)

lmp.units("metal")
lmp.boundary("p p p")
Expand Down
3 changes: 2 additions & 1 deletion calphy/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def __init__(self):
self.md.n_cycles = 100
self.md.thermostat_damping = 0.1
self.md.barostat_damping = 0.1
self.md.cmdargs = None

self.nose_hoover = InputTemplate()
self.nose_hoover.thermostat_damping = 0.1
Expand Down Expand Up @@ -586,7 +587,7 @@ def fix_paths(self, potlist):
pcnew = " ".join([*pcraw[:2], filename, *pcraw[3:]])
fixedpots.append(pcnew)
else:
fixedpots.append(pcraw)
fixedpots.append(pot)
return fixedpots

def create_identifier(self):
Expand Down
4 changes: 2 additions & 2 deletions calphy/liquid.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run_averaging(self):
At the end of the run, the averaged box dimensions are calculated.
"""
#create lammps object
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

#set up structure
lmp = ph.create_structure(lmp, self.calc, species=self.calc.n_elements+self.calc._ghost_element_count)
Expand Down Expand Up @@ -171,7 +171,7 @@ def run_integration(self, iteration=1):
Run the integration routine where the initial and final systems are connected using
the lambda parameter. See algorithm 4 in publication.
"""
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

# Adiabatic switching parameters.
lmp.command("variable li equal 1.0")
Expand Down
6 changes: 3 additions & 3 deletions calphy/phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def reversible_scaling(self, iteration=1):
pf = lf*pi

#create lammps object
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

lmp.command("echo log")
lmp.command("variable li equal %f"%li)
Expand Down Expand Up @@ -835,7 +835,7 @@ def temperature_scaling(self, iteration=1):
pf = lf*p0

#create lammps object
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

lmp.command("echo log")
lmp.command("variable li equal %f"%li)
Expand Down Expand Up @@ -919,7 +919,7 @@ def pressure_scaling(self, iteration=1):
pf = self.calc._pressure_stop

#create lammps object
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

lmp.command("echo log")
lmp.command("variable li equal %f"%li)
Expand Down
4 changes: 2 additions & 2 deletions calphy/solid.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def run_averaging(self):
is calculated.
At the end of the run, the averaged box dimensions are calculated.
"""
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

#set up structure
lmp = ph.create_structure(lmp, self.calc, species=self.calc.n_elements+self.calc._ghost_element_count)
Expand Down Expand Up @@ -206,7 +206,7 @@ def run_integration(self, iteration=1):
Run the integration routine where the initial and final systems are connected using
the lambda parameter. See algorithm 4 in publication.
"""
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep)
lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep, self.calc.md.cmdargs)

#read in the conf file
conf = os.path.join(self.simfolder, "conf.equilibration.dump")
Expand Down