コード例 #1
0
ファイル: pbc.py プロジェクト: tufubin/trunk
	def testKineticEnergy(self):
		"PBC: utils.kineticEnergy considers only fluctuation velocity, not the velocity gradient"
		O.step() # updates velocity with homotheticCellResize
		# ½(mv²+ωIω)
		# #0 is still, no need to add it; #1 has zero angular velocity
		# we must take self.initVel since O.bodies[1].state.vel now contains the homothetic resize which utils.kineticEnergy is supposed to compensate back 
		Ek=.5*O.bodies[1].state.mass*self.initVel.squaredNorm()
		self.assertAlmostEqual(Ek,utils.kineticEnergy())
コード例 #2
0
 def testKineticEnergy(self):
     "PBC: utils.kineticEnergy considers only fluctuation velocity, not the velocity gradient"
     O.step()  # updates velocity with homotheticCellResize
     # ½(mv²+ωIω)
     # #0 is still, no need to add it; #1 has zero angular velocity
     # we must take self.initVel since O.bodies[1].state.vel now contains the homothetic resize which utils.kineticEnergy is supposed to compensate back
     Ek = .5 * O.bodies[1].state.mass * self.initVel.squaredNorm()
     self.assertAlmostEqual(Ek, utils.kineticEnergy())
コード例 #3
0
ファイル: watercolumn.py プロジェクト: yade/trunk
def addPlotData(): 
  plot.addData(t=O.time, Ekin=utils.kineticEnergy())
コード例 #4
0
ファイル: dam_break.py プロジェクト: marceloteixeira30/yade
def addPlotData():
    plot.addData(t=O.time, eKin=utils.kineticEnergy())