Ejemplo n.º 1
0
 def kineticEnergy(self, phys):
    """
    @type phys: Physical
    @param phys: Physical system.
    
    @rtype: float
    @return: Kinetic energy, as a sum of 0.5*m*v^2 for each atom.
    """
    return TopologyUtilities.kineticEnergy(phys.myTop, phys.velvec)
Ejemplo n.º 2
0
 def kineticEnergy(self, phys):
     """
   @type phys: Physical
   @param phys: Physical system.
   
   @rtype: float
   @return: Kinetic energy, as a sum of 0.5*m*v^2 for each atom.
   """
     return TopologyUtilities.kineticEnergy(phys.myTop, phys.velvec)
Ejemplo n.º 3
0
   def totalEnergy(self, phys):
      """
      @type phys: Physical
      @param phys: Physical system.
      
      @rtype: float
      @return: Total energy, as a sum of potential and kinetic.
      """

      # potentialEnergy() is a member function of ScalarStructure
      return phys.app.energies.potentialEnergy()+TopologyUtilities.kineticEnergy(phys.myTop, phys.velvec)
Ejemplo n.º 4
0
    def totalEnergy(self, phys):
        """
      @type phys: Physical
      @param phys: Physical system.
      
      @rtype: float
      @return: Total energy, as a sum of potential and kinetic.
      """

        # potentialEnergy() is a member function of ScalarStructure
        return phys.app.energies.potentialEnergy(
        ) + TopologyUtilities.kineticEnergy(phys.myTop, phys.velvec)
Ejemplo n.º 5
0
   def plotTotal(self, phys, forces, step):
      """
      Similar, for total energy

      @type phys: Physical
      @param phys: The physical system

      @type forces: Forces
      @param forces: MDL Forces object

      @type step: int
      @param step: Simulation step number      
      """      
      self.plotQuantity(step, forces.energies.potentialEnergy(phys)+TopologyUtilities.kineticEnergy(phys.myTop, phys.velvec), 'totalenergy')