当前位置: 首页>>代码示例>>Python>>正文


Python Nondimensional.lengthScale方法代码示例

本文整理汇总了Python中spatialdata.units.Nondimensional.Nondimensional.lengthScale方法的典型用法代码示例。如果您正苦于以下问题:Python Nondimensional.lengthScale方法的具体用法?Python Nondimensional.lengthScale怎么用?Python Nondimensional.lengthScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在spatialdata.units.Nondimensional.Nondimensional的用法示例。


在下文中一共展示了Nondimensional.lengthScale方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_densityScale

# 需要导入模块: from spatialdata.units.Nondimensional import Nondimensional [as 别名]
# 或者: from spatialdata.units.Nondimensional.Nondimensional import lengthScale [as 别名]
  def test_densityScale(self):
    dim = Nondimensional()
    dim._configure()
    dim.setDensityScale(2.0*kilogram/meter**3)

    self.assertEqual(1.0*meter, dim.lengthScale())
    self.assertEqual(1.0*pascal, dim.pressureScale())
    self.assertEqual(1.0*second, dim.timeScale())
    self.assertEqual(2.0*kilogram/meter**3, dim.densityScale())
    return
开发者ID:geodynamics,项目名称:spatialdata,代码行数:12,代码来源:TestNondimensional.py

示例2: test_temperatureScale

# 需要导入模块: from spatialdata.units.Nondimensional import Nondimensional [as 别名]
# 或者: from spatialdata.units.Nondimensional.Nondimensional import lengthScale [as 别名]
  def test_temperatureScale(self):
    dim = Nondimensional()
    dim._configure()
    dim.setTemperatureScale(2.0*kelvin)

    self.assertEqual(1.0*meter, dim.lengthScale())
    self.assertEqual(1.0*pascal, dim.pressureScale())
    self.assertEqual(1.0*second, dim.timeScale())
    self.assertEqual(2.0*kelvin, dim.temperatureScale())
    return
开发者ID:geodynamics,项目名称:spatialdata,代码行数:12,代码来源:TestNondimensional.py

示例3: test_constructor

# 需要导入模块: from spatialdata.units.Nondimensional import Nondimensional [as 别名]
# 或者: from spatialdata.units.Nondimensional.Nondimensional import lengthScale [as 别名]
  def test_constructor(self):
    dim = Nondimensional()
    dim._configure()

    self.assertEqual(1.0*meter, dim.lengthScale())
    self.assertEqual(1.0*pascal, dim.pressureScale())
    self.assertEqual(1.0*second, dim.timeScale())
    self.assertEqual(1.0*kilogram/meter**3, dim.densityScale())
    self.assertEqual(1.0*kelvin, dim.temperatureScale())

    return
开发者ID:geodynamics,项目名称:spatialdata,代码行数:13,代码来源:TestNondimensional.py

示例4: _initialize

# 需要导入模块: from spatialdata.units.Nondimensional import Nondimensional [as 别名]
# 或者: from spatialdata.units.Nondimensional.Nondimensional import lengthScale [as 别名]
  def _initialize(self, mesh, integrator):
    """
    Initialize integrator.
    """
    dt = 2.3
    
    from spatialdata.units.Nondimensional import Nondimensional
    normalizer = Nondimensional()
    normalizer._configure()

    from pyre.units.time import s
    integrator.initialize(totalTime=0.0*s, numTimeSteps=1,
                          normalizer=normalizer)
    integrator.timeStep(dt)

    # Setup fields
    from pylith.topology.SolutionFields import SolutionFields
    fields = SolutionFields(mesh)
    fields.add("residual", "residual")
    fields.add("disp(t+dt)", "displacement")
    fields.add("disp(t)", "displacement")
    fields.add("disp(t-dt)", "displacement")
    fields.add("velocity(t)", "velocity")
    fields.add("acceleration(t)", "acceleration")
    fields.solutionName("disp(t+dt)")

    residual = fields.get("residual")
    spaceDim = mesh.coordsys().spaceDim()
    lengthScale = normalizer.lengthScale()
    residual.subfieldAdd("displacement", spaceDim, residual.VECTOR, lengthScale.value);
    residual.subfieldAdd("lagrange_multiplier", spaceDim, residual.VECTOR);
    
    residual.subfieldsSetup();
    residual.setupSolnChart();
    residual.setupSolnDof(spaceDim);
    residual.allocate();
    residual.zeroAll();
    fields.copyLayout("residual")

    return fields
开发者ID:geodynamics,项目名称:pylith,代码行数:42,代码来源:TestElasticityExplicitLgDeform.py


注:本文中的spatialdata.units.Nondimensional.Nondimensional.lengthScale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。