本文整理汇总了Python中ert.ecl.EclRegion.select_islice方法的典型用法代码示例。如果您正苦于以下问题:Python EclRegion.select_islice方法的具体用法?Python EclRegion.select_islice怎么用?Python EclRegion.select_islice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ert.ecl.EclRegion
的用法示例。
在下文中一共展示了EclRegion.select_islice方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_local_field
# 需要导入模块: from ert.ecl import EclRegion [as 别名]
# 或者: from ert.ecl.EclRegion import select_islice [as 别名]
def test_local_field(self):
with ErtTestContext('python/enkf/data/local_config', self.field_config) as test_context:
main = test_context.getErt()
local_config = main.getLocalConfig()
# Creating dataset
data_scale = local_config.createDataset('DATA_SCALE')
grid = local_config.getGrid()
ecl_reg = EclRegion(grid, False)
ecl_reg.select_islice(10, 20)
data_scale.addField('PERMX', ecl_reg)
self.assertEqual(1, len(data_scale))
示例2: test_slice
# 需要导入模块: from ert.ecl import EclRegion [as 别名]
# 或者: from ert.ecl.EclRegion import select_islice [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))
示例3: test_equal
# 需要导入模块: from ert.ecl import EclRegion [as 别名]
# 或者: from ert.ecl.EclRegion import select_islice [as 别名]
def test_equal(self):
reg1 = EclRegion(self.grid , False)
reg2 = EclRegion(self.grid , False)
self.assertTrue( reg1 == reg2 )
reg1.select_islice(4 , 6)
self.assertFalse( reg1 == reg2 )
reg2.select_islice(4,7)
self.assertFalse( reg1 == reg2 )
reg1.select_islice(7,7)
self.assertTrue( reg1 == reg2 )
示例4: test_index_list
# 需要导入模块: from ert.ecl import EclRegion [as 别名]
# 或者: from ert.ecl.EclRegion import select_islice [as 别名]
def test_index_list(self):
reg = EclRegion(self.grid, False)
reg.select_islice(0, 5)
active_list = reg.active_list
global_list = reg.global_list