本文整理汇总了Python中ecl.grid.EclGrid.getLayerXYZ方法的典型用法代码示例。如果您正苦于以下问题:Python EclGrid.getLayerXYZ方法的具体用法?Python EclGrid.getLayerXYZ怎么用?Python EclGrid.getLayerXYZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ecl.grid.EclGrid
的用法示例。
在下文中一共展示了EclGrid.getLayerXYZ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_corner
# 需要导入模块: from ecl.grid import EclGrid [as 别名]
# 或者: from ecl.grid.EclGrid import getLayerXYZ [as 别名]
def test_corner(self):
grid = EclGrid(self.egrid_file())
nx = grid.getNX()
ny = grid.getNY()
nz = grid.getNZ()
(x1,y1,z1) = grid.getCellCorner( 0 , ijk = (0,0,0))
(x2,y2,z2) = grid.getLayerXYZ( 0 , 0 )
self.assertEqual(x1,x2)
self.assertEqual(y1,y2)
self.assertEqual(z1,z2)
(x1,y1,z1) = grid.getCellCorner( 0 , ijk = (0,1,0))
(x2,y2,z2) = grid.getLayerXYZ( (nx + 1) , 0 )
self.assertEqual(x1,x2)
self.assertEqual(y1,y2)
self.assertEqual(z1,z2)
(x1,y1,z1) = grid.getCellCorner( 1 , ijk = (nx - 1,0,0))
(x2,y2,z2) = grid.getLayerXYZ( nx , 0 )
self.assertEqual(x1,x2)
self.assertEqual(y1,y2)
self.assertEqual(z1,z2)
(x1,y1,z1) = grid.getCellCorner( 4 , ijk = (0,0,nz-1))
(x2,y2,z2) = grid.getLayerXYZ( 0 , nz )
self.assertEqual(x1,x2)
self.assertEqual(y1,y2)
self.assertEqual(z1,z2)
(x1,y1,z1) = grid.getCellCorner( 7 , ijk = (nx-1,ny-1,nz-1))
(x2,y2,z2) = grid.getLayerXYZ( (nx + 1)*(ny + 1) - 1 , nz )
self.assertEqual(x1,x2)
self.assertEqual(y1,y2)
self.assertEqual(z1,z2)
with self.assertRaises(IndexError):
grid.getLayerXYZ( -1 , 0 )
with self.assertRaises(IndexError):
grid.getLayerXYZ( (nx + 1)*(ny + 1) , 0 )
with self.assertRaises(IndexError):
grid.getLayerXYZ( 0 , -1 )
with self.assertRaises(IndexError):
grid.getLayerXYZ( 0 , nz + 1 )