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)
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)
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)
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)
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')