本文整理汇总了Python中ert.ecl.EclRegion.select_kslice方法的典型用法代码示例。如果您正苦于以下问题:Python EclRegion.select_kslice方法的具体用法?Python EclRegion.select_kslice怎么用?Python EclRegion.select_kslice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ert.ecl.EclRegion
的用法示例。
在下文中一共展示了EclRegion.select_kslice方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from ert.ecl import EclRegion [as 别名]
# 或者: from ert.ecl.EclRegion import select_kslice [as 别名]
def setUp(self):
self.grid = EclGrid.create_rectangular( (10,10,10) , (1,1,1) )
self.kw = EclKW.create( "FAULTBLK" , self.grid.size , EclTypeEnum.ECL_INT_TYPE )
self.kw.assign( 1 )
reg = EclRegion( self.grid , False )
for k in range(self.grid.getNZ()):
reg.clear( )
reg.select_kslice( k , k )
self.kw.assign( k , mask = reg )
self.kw[ k * self.grid.getNX() * self.grid.getNY() + 7] = 177
示例2: test_slice
# 需要导入模块: from ert.ecl import EclRegion [as 别名]
# 或者: from ert.ecl.EclRegion import select_kslice [as 别名]
def test_slice(self):
reg = EclRegion(self.grid, False)
reg.select_islice(0, 5)
OK = True
global_list = reg.global_list
self.assertEqual(global_list.parent(), reg)
for gi in global_list:
(i, j, k) = self.grid.get_ijk(global_index=gi)
if i > 5:
OK = False
self.assertTrue(OK)
self.assertTrue(self.grid.ny * self.grid.nz * 6 == len(reg.global_list))
reg.select_jslice(7, 8, intersect=True)
OK = True
for gi in reg.global_list:
(i, j, k) = self.grid.get_ijk(global_index=gi)
if i > 5:
OK = False
if j < 7 or j > 8:
OK = False
self.assertTrue(OK)
self.assertTrue(2 * self.grid.nz * 6 == len(reg.global_list))
reg2 = EclRegion(self.grid, False)
reg2.select_kslice(3, 5)
reg &= reg2
OK = True
for gi in reg.global_list:
(i, j, k) = self.grid.get_ijk(global_index=gi)
if i > 5:
OK = False
if j < 7 or j > 8:
OK = False
if k < 3 or k > 5:
OK = False
self.assertTrue(OK)
self.assertTrue(2 * 3 * 6 == len(reg.global_list))