default_help="This is the top level class that deals with the running of the simulation, including holding the simulation specific properties such as the time step and outputting the data."
default_label="SIMULATION"
defstore(self,simul):
"""Takes a simulation instance and stores a minimal representation of it.
Args:
simul: A simulation object.
"""
super(InputSimulation,self).store()
self.forces.store(simul.flist)
self.ensemble.store(simul.ensemble)
self.beads.store(simul.beads)
self.normal_modes.store(simul.nm)
self.cell.store(simul.cell)
self.prng.store(simul.prng)
self.step.store(simul.step)
self.total_steps.store(simul.tsteps)
self.total_time.store(simul.ttime)
self.output.store(simul.outputs)
# this we pick from the messages class. kind of a "global" but it seems to
# be the best way to pass around the (global) information on the level of output.
ifverbosity.debug:
self.verbosity.store("debug")
elifverbosity.high:
self.verbosity.store("high")
elifverbosity.medium:
self.verbosity.store("medium")
elifverbosity.low:
self.verbosity.store("low")
elifverbosity.quiet:
self.verbosity.store("quiet")
else:
raiseValueError("Invalid verbosity level")
deffetch(self):
"""Creates a simulation object.
Returns:
A simulation object of the appropriate type and with the appropriate
properties and other objects given the attributes of the
InputSimulation object.
Raises:
TypeError: Raised if one of the file types in the stride keyword
is incorrect.
"""
super(InputSimulation,self).fetch()
# small hack: initialize here the verbosity level -- we really assume to have
# just one simulation object
verbosity.level=self.verbosity.fetch()
# this creates a simulation object which gathers all the little bits
#TODO use named arguments since this list is a bit too long...