本文整理汇总了Python中pylith.meshio.MeshIOAscii.MeshIOAscii.coordsys方法的典型用法代码示例。如果您正苦于以下问题:Python MeshIOAscii.coordsys方法的具体用法?Python MeshIOAscii.coordsys怎么用?Python MeshIOAscii.coordsys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pylith.meshio.MeshIOAscii.MeshIOAscii
的用法示例。
在下文中一共展示了MeshIOAscii.coordsys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_readwrite
# 需要导入模块: from pylith.meshio.MeshIOAscii import MeshIOAscii [as 别名]
# 或者: from pylith.meshio.MeshIOAscii.MeshIOAscii import coordsys [as 别名]
def test_readwrite(self):
"""
Test read().
"""
filenameGmvIn = "data/cube2_ascii.gmv"
filenamePsetIn = "data/cube2_ascii.pset"
filenameOut = "data/cube2_test.txt"
filenameE = "data/cube2.txt"
from spatialdata.geocoords.CSCart import CSCart
cs = CSCart()
cs._configure()
# For now, we only test reading the file. We would like to write
# the file and compare against the original.
io = MeshIOLagrit()
io.inventory.filenameGmv = filenameGmvIn
io.inventory.filenamePset = filenamePsetIn
io._configure()
from spatialdata.units.Nondimensional import Nondimensional
normalizer = Nondimensional()
mesh = io.read(debug=False, interpolate=True)
testhandler = MeshIOAscii()
testhandler.filename(filenameOut)
testhandler.coordsys = cs
testhandler.write(mesh)
fileE = open(filenameE, "r")
linesE = fileE.readlines()
fileE.close()
fileT = open(filenameOut, "r")
linesT = fileT.readlines()
fileT.close()
self.assertEqual(len(linesE), len(linesT))
for (lineE, lineT) in zip(linesE, linesT):
self.assertEqual(lineE, lineT)
return
示例2: test_readwrite
# 需要导入模块: from pylith.meshio.MeshIOAscii import MeshIOAscii [as 别名]
# 或者: from pylith.meshio.MeshIOAscii.MeshIOAscii import coordsys [as 别名]
def test_readwrite(self):
"""
Test read().
"""
filenameIn = "data/twohex8.exo"
filenameOut = "data/twohex8_test.txt"
filenameE = "data/twohex8.txt"
from spatialdata.geocoords.CSCart import CSCart
cs = CSCart()
cs._configure()
# For now, we only test reading the file.
io = MeshIOCubit()
io.inventory.filename = filenameIn
io.inventory.useNames = False
io._configure()
from spatialdata.units.Nondimensional import Nondimensional
normalizer = Nondimensional()
mesh = io.read(debug=False, interpolate=False)
testhandler = MeshIOAscii()
testhandler.filename(filenameOut)
testhandler.coordsys = cs
testhandler.write(mesh)
fileE = open(filenameE, "r")
linesE = fileE.readlines()
fileE.close()
fileT = open(filenameOut, "r")
linesT = fileT.readlines()
fileT.close()
self.assertEqual(len(linesE), len(linesT))
for (lineE, lineT) in zip(linesE, linesT):
self.assertEqual(lineE, lineT)
return