Exemplo n.º 1
0
    def initialize(self):
        # Standard initialization of Verlet algorithm
        self.gpos[:] = 0.0
        self.ff.update_pos(self.pos)
        self.epot = self.ff.compute(self.gpos)
        self.acc = -self.gpos/self.masses.reshape(-1,1)

        # Allow for specialized initializations by the Verlet hooks.
        self.call_verlet_hooks('init')

        # Configure the number of degrees of freedom if needed
        if self.ndof is None:
            self.ndof = self.pos.size

        # Common post-processing of the initialization
        self.compute_properties()
        Iterative.initialize(self) # Includes calls to conventional hooks
Exemplo n.º 2
0
    def initialize(self):
        # Standard initialization of Verlet algorithm
        self.gpos[:] = 0.0
        self.ff.update_pos(self.pos)
        self.epot = self.ff.compute(self.gpos)
        self.acc = -self.gpos / self.masses.reshape(-1, 1)
        self.posoud = self.pos.copy()

        # Allow for specialized initializations by the Verlet hooks.
        self.call_verlet_hooks('init')

        # Configure the number of degrees of freedom if needed
        if self.ndof is None:
            self.ndof = self.pos.size

        # Common post-processing of the initialization
        self.compute_properties(self.restart_h5)
        Iterative.initialize(self)  # Includes calls to conventional hooks
Exemplo n.º 3
0
Arquivo: opt.py Projeto: tovrstra/yaff
 def initialize(self):
     # The first call to check_convergence will never flag convergence, but
     # it is need to keep track of some convergence criteria.
     self.dof.check_convergence()
     Iterative.initialize(self)
Exemplo n.º 4
0
Arquivo: opt.py Projeto: boegel/yaff
 def initialize(self):
     # The first call to check_convergence will never flag convergence, but
     # it is need to keep track of some convergence criteria.
     self.dof.check_convergence()
     Iterative.initialize(self)