本文整理匯總了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))