Example #1
0
 def __init__(self, atoms, timestep, temperature, friction, fixcm=True,
              trajectory=None, communicator=gpaw_world):
     MolecularDynamics.__init__(self, atoms, timestep, trajectory)
     self.temp = temperature
     self.frict = friction
     self.fixcm = fixcm  # will the center of mass be held fixed?
     self.communicator = communicator
     self.updatevars()
Example #2
0
 def __init__(self, atoms, 
              timestep, temperature, externalstress, ttime, pfactor,
              mask=None, trajectory=None):
     MolecularDynamics.__init__(self, atoms, timestep, trajectory)
     #self.atoms = atoms
     #self.timestep = timestep
     self.zero_center_of_mass_momentum(verbose=1)
     self.temperature = temperature
     self.set_stress(externalstress)
     self.set_mask(mask)
     self.eta = zeros((3,3), float)
     self.zeta = 0.0
     self.zeta_integrated = 0.0
     self.initialized = 0
     self.ttime = ttime
     self.pfactor_given = pfactor
     self._calculateconstants()
     self.timeelapsed = 0.0
     self.frac_traceless = 1
Example #3
0
    def attach_atoms(self, atoms):
        """Assign atoms to a restored dynamics object.

        This function must be called to set the atoms immediately after the
        dynamics object has been read from a trajectory.
        """
        try:
            self.atoms
        except AttributeError:
            pass
        else:
            raise RuntimeError, "Cannot call attach_atoms on a dynamics which already has atoms."
        MolecularDynamics.__init__(self, atoms, self.dt)
        ####self.atoms = atoms
        limit = 1e-6
        h = self._getbox()
        if max(abs((h - self.h).ravel())) > limit:
            raise RuntimeError, "The unit cell of the atoms does not match the unit cell stored in the file."
        self.inv_h = linalg.inv(self.h)
        self._make_special_q_arrays()
        self.q[:] = dot(self.atoms.get_positions(),
                                           self.inv_h) - 0.5
        self._calculate_q_past_and_future()
        self.initialized = 1
Example #4
0
 def __init__(self, atoms, dt, trajectory=None):
     MolecularDynamics.__init__(self, atoms, dt, trajectory)