本文整理汇总了Python中ecl.grid.EclGrid.loadFromGrdecl方法的典型用法代码示例。如果您正苦于以下问题:Python EclGrid.loadFromGrdecl方法的具体用法?Python EclGrid.loadFromGrdecl怎么用?Python EclGrid.loadFromGrdecl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ecl.grid.EclGrid
的用法示例。
在下文中一共展示了EclGrid.loadFromGrdecl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_grdecl_load
# 需要导入模块: from ecl.grid import EclGrid [as 别名]
# 或者: from ecl.grid.EclGrid import loadFromGrdecl [as 别名]
def test_grdecl_load(self):
with self.assertRaises(IOError):
grid = EclGrid.loadFromGrdecl("/file/does/not/exists")
with TestAreaContext("python/grid-test/grdeclLoad"):
with open("grid.grdecl","w") as f:
f.write("Hei ...")
with self.assertRaises(ValueError):
grid = EclGrid.loadFromGrdecl("grid.grdecl")
actnum = IntVector(default_value = 1 , initial_size = 1000)
actnum[0] = 0
g1 = EclGrid.createRectangular((10,10,10) , (1,1,1) , actnum = actnum )
self.assertEqual( g1.getNumActive() , actnum.elementSum() )
g1.save_EGRID("G.EGRID")
with open("grid.grdecl" , "w") as f2:
f2.write("SPECGRID\n")
f2.write(" 10 10 10 \'F\' /\n")
with openEclFile("G.EGRID") as f:
with copen("grid.grdecl" , "a") as f2:
coord_kw = f["COORD"][0]
coord_kw.write_grdecl( f2 )
zcorn_kw = f["ZCORN"][0]
zcorn_kw.write_grdecl( f2 )
actnum_kw = f["ACTNUM"][0]
actnum_kw.write_grdecl( f2 )
g2 = EclGrid.loadFromGrdecl("grid.grdecl")
self.assertTrue( g1.equal( g2 ))
示例2: test_large_case
# 需要导入模块: from ecl.grid import EclGrid [as 别名]
# 或者: from ecl.grid.EclGrid import loadFromGrdecl [as 别名]
def test_large_case(self):
grdecl_file = self.createTestPath("Statoil/ECLIPSE/1.6.0_issueGrdecl/test_aug2016_gridOnly.grdecl")
grid = EclGrid.loadFromGrdecl( grdecl_file )