Skip to content

Commit

Permalink
Merge pull request #27 from ICAMS/update/ts
Browse files Browse the repository at this point in the history
enable separate switching times for fe and ts modes
  • Loading branch information
srmnitc authored Mar 11, 2022
2 parents fb4ba73 + 321bce5 commit e66e33b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions calphy/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def read_yamlfile(file):
#eqbr and switching time
"te": 25000,
"ts": 50000,
#enable separate switching time for rs
"ts_rs": 50000,
"tguess": None,
"dtemp": 200,
"maxattempts": 5,
Expand Down Expand Up @@ -171,6 +173,15 @@ def read_yamlfile(file):
options["md"]["pair_style"] = check_and_convert_to_list(indata["md"]["pair_style"])
options["md"]["pair_coeff"] = fix_paths(check_and_convert_to_list(indata["md"]["pair_coeff"]))

#now modify ts;
if isinstance(options["md"]["ts"], list):
ts1 = options["md"]["ts"][0]
ts2 = options["md"]["ts"][1]
options["md"]["ts"] = ts1
options["md"]["ts_rs"] = ts2
else:
options["md"]["ts_rs"] = options["md"]["ts"]

if not len(options["element"]) == len(options["mass"]):
raise ValueError("length of elements and mass should be same!")
options["nelements"] = len(options["element"])
Expand Down
4 changes: 2 additions & 2 deletions calphy/phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def reversible_scaling(self, iteration=1):
lmp.command("dump d1 all custom %d traj.forward_%d.dat id type mass x y z vx vy vz"%(self.options["md"]["traj_interval"],
iteration))

lmp.command("run %d"%self.options["md"]["ts"])
lmp.command("run %d"%self.options["md"]["ts_rs"])

#unfix
lmp.command("unfix f3")
Expand Down Expand Up @@ -401,7 +401,7 @@ def reversible_scaling(self, iteration=1):
lmp.command("dump d1 all custom %d traj.backward_%d.dat id type mass x y z vx vy vz"%(self.options["md"]["traj_interval"],
iteration))

lmp.command("run %d"%self.options["md"]["ts"])
lmp.command("run %d"%self.options["md"]["ts_rs"])

lmp.command("unfix f3")
lmp.command("unfix f1")
Expand Down

0 comments on commit e66e33b

Please sign in to comment.