Skip to content
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.6.4
current_version = 1.6.5
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion calphy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from calphy.alchemy import Alchemy
from calphy.routines import MeltingTemp

__version__ = "1.6.4"
__version__ = "1.6.5"

def addtest(a,b):
return a+b
4 changes: 2 additions & 2 deletions calphy/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from ase.io import read, write
import shutil

__version__ = "1.6.4"
__version__ = "1.6.5"


def _check_equal(val):
Expand Down Expand Up @@ -317,7 +317,7 @@ class Calculation(BaseModel, title="Main input class"):
_temperature_stop: float = PrivateAttr(default=None)
_temperature_input: float = PrivateAttr(default=None)

melting_cycle: Annotated[bool, Field(default=True)]
melting_cycle: Annotated[bool, Field(default=False)]

pair_style: Annotated[
Union[List[str], None], BeforeValidator(to_list), Field(default=None)
Expand Down
34 changes: 33 additions & 1 deletion calphy/liquid.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,36 @@ def __init__(self, calculation=None, simfolder=None, log_to_screen=False):
calculation=calculation, simfolder=simfolder, log_to_screen=log_to_screen
)

def rattle_structure(self, lmp):
"""
Disorder the structure using random displacements followed by a
controlled NVT cool-down before liquid equilibration.

This is a lightweight alternative to :meth:`melt_structure`:
"""
self.logger.info(
"Rattling structure: velocities at 2*thigh=%f, NVT cool-down to T=%f",
self.calc._temperature_high,
self.calc._temperature,
)
lmp.command(
"displace_atoms all random 0.1 0.1 0.1 %d" % np.random.randint(1, 10000)
)
lmp.velocity(
"all create",
2.0 * self.calc._temperature_high,
np.random.randint(1, 10000),
)
lmp.command(
"fix nh_rattle all nvt temp %f %f %f"
% (
self.calc._temperature_high,
self.calc._temperature,
)
)
lmp.run(int(self.calc.md.n_small_steps))
lmp.command("unfix nh_rattle")

def melt_structure(self, lmp):
""" """
if self.calc._fix_lattice and self.calc.melting_cycle:
Expand Down Expand Up @@ -163,9 +193,11 @@ def run_averaging(self):
lmp.command("variable mlz equal lz")
lmp.command("variable mpress equal press")

# MELT
# Disorder the structure before equilibration
if self.calc.melting_cycle:
self.melt_structure(lmp)
else:
self.rattle_structure(lmp)

if not self.calc._fix_lattice:
# now assign correct temperature and equilibrate
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "calphy"
version = "1.6.4"
version = "1.6.5"
description = "free energy calculation for python"
readme = "README.md"
license = "GPL-3.0-only"
Expand Down
Loading