Skip to content

Commit

Permalink
Stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dilkins committed Oct 16, 2018
1 parent 0e84d60 commit 60ecca8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ipi/engine/thermostats.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from ipi.engine.normalmodes import NormalModes


__all__ = ['Thermostat', 'ThermoLangevin', 'ThermoPILE_L', 'ThermoPILE_G', 'ThermoSVR',
'ThermoGLE', 'ThermoNMGLE', 'ThermoNMGLEG', 'ThermoCL', 'MultiThermo', 'ThermoFFL']
__all__ = ['Thermostat', 'ThermoLangevin', 'ThermoFFL', 'ThermoPILE_L', 'ThermoPILE_G', 'ThermoSVR',
'ThermoGLE', 'ThermoNMGLE', 'ThermoNMGLEG', 'ThermoCL', 'MultiThermo']


class Thermostat(dobject):
Expand Down
12 changes: 6 additions & 6 deletions ipi/inputs/thermostats.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class InputThermoBase(Input):
"""

attribs = {"mode": (InputAttribute, {"dtype": str,
"options": ["", "langevin", "svr", "pile_l", "pile_g", "gle", "nm_gle", "nm_gle_g", "cl", "FFL"],
"help": "The style of thermostatting. 'langevin' specifies a white noise langevin equation to be attached to the cartesian representation of the momenta. 'svr' attaches a velocity rescaling thermostat to the cartesian representation of the momenta. Both 'pile_l' and 'pile_g' attaches a white noise langevin thermostat to the normal mode representation, with 'pile_l' attaching a local langevin thermostat to the centroid mode and 'pile_g' instead attaching a global velocity rescaling thermostat. 'gle' attaches a coloured noise langevin thermostat to the cartesian representation of the momenta, 'nm_gle' attaches a coloured noise langevin thermostat to the normal mode representation of the momenta and a langevin thermostat to the centroid and 'nm_gle_g' attaches a gle thermostat to the normal modes and a svr thermostat to the centroid. 'cl' represents a modified langevin thermostat which compensates for additional white noise from noisy forces or for dissipative effects. 'FFL' is the fast-forward langevin thermostat, in which momenta are flipped back whenever the action of the thermostat changes its direction. 'multiple' is a special thermostat mode, in which one can define multiple thermostats _inside_ the thermostat tag."
"options": ["", "langevin", "svr", "pile_l", "pile_g", "gle", "nm_gle", "nm_gle_g", "cl", "ffl"],
"help": "The style of thermostatting. 'langevin' specifies a white noise langevin equation to be attached to the cartesian representation of the momenta. 'svr' attaches a velocity rescaling thermostat to the cartesian representation of the momenta. Both 'pile_l' and 'pile_g' attaches a white noise langevin thermostat to the normal mode representation, with 'pile_l' attaching a local langevin thermostat to the centroid mode and 'pile_g' instead attaching a global velocity rescaling thermostat. 'gle' attaches a coloured noise langevin thermostat to the cartesian representation of the momenta, 'nm_gle' attaches a coloured noise langevin thermostat to the normal mode representation of the momenta and a langevin thermostat to the centroid and 'nm_gle_g' attaches a gle thermostat to the normal modes and a svr thermostat to the centroid. 'cl' represents a modified langevin thermostat which compensates for additional white noise from noisy forces or for dissipative effects. 'ffl' is the fast-forward langevin thermostat, in which momenta are flipped back whenever the action of the thermostat changes its direction. 'multiple' is a special thermostat mode, in which one can define multiple thermostats _inside_ the thermostat tag."
})}
fields = {"ethermo": (InputValue, {"dtype": float,
"default": 0.0,
Expand Down Expand Up @@ -91,7 +91,7 @@ class InputThermoBase(Input):
"dimension": "time"}),
"flip": (InputValue, {"dtype": str,
"default": "rescale",
"help": "Flipping type for FFL thermostat ('soft', 'hard', 'rescale', 'none')"})
"help": "Flipping type for ffl thermostat ('soft', 'hard', 'rescale', 'none')"})
}

dynamic = {}
Expand Down Expand Up @@ -150,7 +150,7 @@ def store(self, thermo):
self.idtau.store(thermo.idtau)
self.apat.store(thermo.apat)
elif type(thermo) is ethermostats.ThermoFFL:
self.mode.store("FFL")
self.mode.store("ffl")
self.tau.store(thermo.tau)
self.flip.store(thermo.flip)
elif type(thermo) is ethermostats.Thermostat:
Expand Down Expand Up @@ -199,7 +199,7 @@ def fetch(self):
thermo.s = self.s.fetch()
elif self.mode.fetch() == "cl":
thermo = ethermostats.ThermoCL(tau=self.tau.fetch(), intau=self.intau.fetch(), idtau=self.idtau.fetch(), apat=self.apat.fetch())
elif self.mode.fetch() == "FFL":
elif self.mode.fetch() == "ffl":
thermo = ethermostats.ThermoFFL(tau=self.tau.fetch(),flip=self.flip.fetch())
elif self.mode.fetch() == "":
thermo = ethermostats.Thermostat()
Expand All @@ -216,7 +216,7 @@ def check(self):
super(InputThermoBase, self).check()
mode = self.mode.fetch()

if mode in ["langevin", "svr", "pile_l", "pile_g", "nm_gle_g", "FFL"]:
if mode in ["langevin", "svr", "pile_l", "pile_g", "nm_gle_g", "ffl"]:
if self.tau.fetch() <= 0:
raise ValueError("The thermostat friction coefficient must be set to a positive value")
if mode == "cl":
Expand Down

0 comments on commit 60ecca8

Please sign in to comment.