本文整理汇总了Python中ecl.eclfile.EclKW.create_actnum方法的典型用法代码示例。如果您正苦于以下问题:Python EclKW.create_actnum方法的具体用法?Python EclKW.create_actnum怎么用?Python EclKW.create_actnum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ecl.eclfile.EclKW
的用法示例。
在下文中一共展示了EclKW.create_actnum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_fmu_stat_workflow
# 需要导入模块: from ecl.eclfile import EclKW [as 别名]
# 或者: from ecl.eclfile.EclKW import create_actnum [as 别名]
def test_fmu_stat_workflow(self):
N = 100
global_size = 100
active_size = 50
with TestAreaContext("FMU_FILES"):
for i in range(N):
permx = EclKW("PERMX", active_size, EclDataType.ECL_FLOAT)
poro = EclKW("PORO", active_size, EclDataType.ECL_FLOAT)
porv = EclKW("PORV", global_size, EclDataType.ECL_FLOAT)
porv.assign(0)
for g in random.sample( range(global_size), active_size):
porv[g] = 1
permx.assign(random.random())
poro.assign(random.random())
with openFortIO("TEST%d.INIT" % i, FortIO.WRITE_MODE) as f:
permx.fwrite(f)
poro.fwrite(f)
porv.fwrite(f)
mean_permx = EclKW("PERMX", global_size, EclDataType.ECL_FLOAT)
std_permx = EclKW("PERMX", global_size, EclDataType.ECL_FLOAT)
mean_poro = EclKW("PORO", global_size, EclDataType.ECL_FLOAT)
std_poro = EclKW("PORO", global_size, EclDataType.ECL_FLOAT)
count = EclKW("COUNT", global_size, EclDataType.ECL_INT)
for i in range(N):
f = EclFile("TEST%d.INIT" % i)
porv = f["PORV"][0]
permx = f["PERMX"][0]
poro = f["PORO"][0]
actnum = porv.create_actnum()
global_permx = permx.scatter_copy( actnum )
mean_permx += global_permx
std_permx.add_squared( global_permx)
global_poro = poro.scatter_copy( actnum )
mean_poro += global_poro
std_poro.add_squared( global_poro)
count += actnum
mean_permx.safe_div(count)
std_permx.safe_div(count)
std_permx -= mean_permx * mean_permx
std_permx.isqrt()
mean_poro.safe_div(count)
std_poro.safe_div(count)
std_poro -= mean_poro * mean_poro
std_poro.isqrt()
示例2: test_porv_kw
# 需要导入模块: from ecl.eclfile import EclKW [as 别名]
# 或者: from ecl.eclfile.EclKW import create_actnum [as 别名]
def test_porv_kw(self):
porv_int = EclKW( "PORV", 100, EclDataType.ECL_INT)
with self.assertRaises(TypeError):
actnum = porv_int.create_actnum()
prv = EclKW("PRV", 100, EclDataType.ECL_FLOAT)
with self.assertRaises(ValueError):
actnum = prv.create_actnum()
porv = EclKW("PORV", 4, EclDataType.ECL_FLOAT)
porv[0] = 0
porv[1] = 0.50
porv[2] = 0.50
porv[3] = 0
actnum = porv.create_actnum()
self.assertEqual(tuple(actnum), (0,1,1,0))