diff --git a/psiflow/sampling/sampling.py b/psiflow/sampling/sampling.py index b0f8727..ec5ff62 100644 --- a/psiflow/sampling/sampling.py +++ b/psiflow/sampling/sampling.py @@ -121,20 +121,14 @@ def setup_motion(walker: Walker, fix_com: bool) -> ET.Element: else: dynamics.append(thermostat) elif walker.npt: - if walker.volume_constrained: - mode = "nst" - else: - mode = "npt" + mode = "npt" dynamics = ET.Element("dynamics", mode=mode) dynamics.append(timestep_element) if walker.pimd: dynamics.append(thermostat_pimd) else: dynamics.append(thermostat) - if walker.volume_constrained: - mode = "anisotropic" - else: - mode = "flexible" + mode = "flexible" barostat = ET.Element("barostat", mode=mode) tau = ET.Element("tau", units="femtosecond") tau.text = "200" diff --git a/psiflow/sampling/walker.py b/psiflow/sampling/walker.py index 8db0454..45cb350 100644 --- a/psiflow/sampling/walker.py +++ b/psiflow/sampling/walker.py @@ -49,7 +49,6 @@ class Walker: state: Union[Geometry, AppFuture, None] temperature: Optional[float] pressure: Optional[float] - volume_constrained: bool nbeads: int timestep: float coupling: Optional[Coupling] @@ -63,7 +62,6 @@ def __init__( state: Union[Geometry, AppFuture, None] = None, temperature: Optional[float] = 300, pressure: Optional[float] = None, - volume_constrained: bool = False, nbeads: int = 1, timestep: float = 0.5, metadynamics: Optional[Metadynamics] = None, @@ -82,7 +80,6 @@ def __init__( self.temperature = temperature self.pressure = pressure - self.volume_constrained = volume_constrained self.nbeads = nbeads self.timestep = timestep diff --git a/tests/test_sampling.py b/tests/test_sampling.py index 219d87d..ab47170 100644 --- a/tests/test_sampling.py +++ b/tests/test_sampling.py @@ -295,25 +295,6 @@ def test_npt(dataset): output.state.result().cell, ) - walker = Walker( - dataset[0], - einstein, - temperature=600, - pressure=0, - volume_constrained=True, - ) - output = sample([walker], steps=30)[0] - # cell should have changed, but not the volume - assert not np.allclose( - walker.start.result().cell, - output.state.result().cell, - ) - # volume actually does change with barostat mode='nst' (?) - # assert np.allclose( - # np.linalg.det(walker.start.result().cell), - # np.linalg.det(output.state.result().cell), - # ) - def test_reset(dataset): einstein = EinsteinCrystal(dataset[0], force_constant=0.1)