本文整理汇总了Python中spatialdata.units.Nondimensional.Nondimensional.setTimeScale方法的典型用法代码示例。如果您正苦于以下问题:Python Nondimensional.setTimeScale方法的具体用法?Python Nondimensional.setTimeScale怎么用?Python Nondimensional.setTimeScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spatialdata.units.Nondimensional.Nondimensional
的用法示例。
在下文中一共展示了Nondimensional.setTimeScale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_timeScale
# 需要导入模块: from spatialdata.units.Nondimensional import Nondimensional [as 别名]
# 或者: from spatialdata.units.Nondimensional.Nondimensional import setTimeScale [as 别名]
def test_timeScale(self):
dim = Nondimensional()
dim._configure()
dim.setTimeScale(2.0*second)
self.assertEqual(1.0*meter, dim.lengthScale())
self.assertEqual(1.0*pascal, dim.pressureScale())
self.assertEqual(2.0*second, dim.timeScale())
self.assertEqual(1.0*kilogram/meter**3, dim.densityScale())
return
示例2: setUp
# 需要导入模块: from spatialdata.units.Nondimensional import Nondimensional [as 别名]
# 或者: from spatialdata.units.Nondimensional.Nondimensional import setTimeScale [as 别名]
def setUp(self):
from spatialdata.units.Nondimensional import Nondimensional
normalizer = Nondimensional()
normalizer._configure()
normalizer.setTimeScale(2.0*second)
tstep = TimeStep()
tstep._configure()
tstep.preinitialize()
tstep.initialize(normalizer)
self.tstep = tstep
return
示例3: setUp
# 需要导入模块: from spatialdata.units.Nondimensional import Nondimensional [as 别名]
# 或者: from spatialdata.units.Nondimensional.Nondimensional import setTimeScale [as 别名]
def setUp(self):
from spatialdata.units.Nondimensional import Nondimensional
normalizer = Nondimensional()
normalizer._configure()
normalizer.setTimeScale(0.5*year)
tstep = TimeStepUser()
tstep._configure()
tstep.filename = "data/timesteps.txt"
tstep.preinitialize()
tstep.initialize(normalizer)
self.tstep = tstep
return