當前位置: 首頁>>代碼示例>>Python>>正文


Python EclRegion.getGlobalList方法代碼示例

本文整理匯總了Python中ert.ecl.EclRegion.getGlobalList方法的典型用法代碼示例。如果您正苦於以下問題:Python EclRegion.getGlobalList方法的具體用法?Python EclRegion.getGlobalList怎麽用?Python EclRegion.getGlobalList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ert.ecl.EclRegion的用法示例。


在下文中一共展示了EclRegion.getGlobalList方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_polygon

# 需要導入模塊: from ert.ecl import EclRegion [as 別名]
# 或者: from ert.ecl.EclRegion import getGlobalList [as 別名]
 def test_polygon(self):
     reg = EclRegion(self.grid, False)
     (x,y,z) = self.grid.get_xyz( ijk=(10,10,0) )
     dx = 0.1
     dy = 0.1
     reg.select_inside_polygon( [(x-dx,y-dy) , (x-dx,y+dy) , (x+dx,y+dy) , (x+dx,y-dy)] )
     self.assertTrue( self.grid.nz == len(reg.getGlobalList()))
開發者ID:agchitu,項目名稱:ert,代碼行數:9,代碼來源:test_region.py

示例2: test_heidrun

# 需要導入模塊: from ert.ecl import EclRegion [as 別名]
# 或者: from ert.ecl.EclRegion import getGlobalList [as 別名]
    def test_heidrun(self):
        root = self.createTestPath("Statoil/ECLIPSE/Heidrun")
        grid = EclGrid( "%s/FF12_2013B2_AMAP_AOP-J15_NO62_MOVEX.EGRID" % root)

        polygon = []
        with open("%s/polygon.ply" % root) as fileH:
            for line in fileH.readlines():
                tmp = line.split()
                polygon.append( (float(tmp[0]) , float(tmp[1])))
        self.assertEqual( len(polygon) , 11 )

        reg = EclRegion( grid , False )
        reg.select_inside_polygon( polygon )
        self.assertEqual( 0 , len(reg.getGlobalList()) % grid.getNZ())
開發者ID:Ensembles,項目名稱:ert,代碼行數:16,代碼來源:test_region_statoil.py

示例3: test_equal

# 需要導入模塊: from ert.ecl import EclRegion [as 別名]
# 或者: from ert.ecl.EclRegion import getGlobalList [as 別名]
    def test_equal(self):
        grid = EclGrid.createRectangular( (10,10,1) , (1,1,1))
        kw_int = EclKW( "INT" , grid.getGlobalSize( ) , EclDataType.ECL_INT )
        kw_float = EclKW( "FLOAT" , grid.getGlobalSize( ) , EclDataType.ECL_FLOAT )

        kw_int[0:49] = 1
        region = EclRegion(grid, False)
        region.select_equal( kw_int , 1 )
        glist = region.getGlobalList()
        for g in glist:
            self.assertEqual( kw_int[g] , 1 )

        with self.assertRaises(ValueError):
            region.select_equal( kw_float , 1 )
開發者ID:Ensembles,項目名稱:ert,代碼行數:16,代碼來源:test_region.py

示例4: test_layer

# 需要導入模塊: from ert.ecl import EclRegion [as 別名]
# 或者: from ert.ecl.EclRegion import getGlobalList [as 別名]
    def test_layer(self):
        region = EclRegion(self.grid, False)
        layer = Layer( self.grid.getNX() , self.grid.getNY() + 1)
        with self.assertRaises(ValueError):
            region.selectFromLayer( layer , 0 , 1 )

        layer = Layer( self.grid.getNX() , self.grid.getNY() )
        layer[0,0] = 1
        layer[1,1] = 1
        layer[2,2] = 1

        with self.assertRaises(ValueError):
            region.selectFromLayer( layer , -1 , 1 )

        with self.assertRaises(ValueError):
            region.selectFromLayer( layer , self.grid.getNZ() , 1 ) 
        
        region.selectFromLayer( layer , 0 , 2 )
        glist = region.getGlobalList()
        self.assertEqual(0 , len(glist))

        region.selectFromLayer( layer , 0 , 1 )
        glist = region.getGlobalList()
        self.assertEqual(3 , len(glist))
開發者ID:agchitu,項目名稱:ert,代碼行數:26,代碼來源:test_region.py

示例5: test_slice

# 需要導入模塊: from ert.ecl import EclRegion [as 別名]
# 或者: from ert.ecl.EclRegion import getGlobalList [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.getGlobalList()))
開發者ID:agchitu,項目名稱:ert,代碼行數:47,代碼來源:test_region.py

示例6: test_index_list

# 需要導入模塊: from ert.ecl import EclRegion [as 別名]
# 或者: from ert.ecl.EclRegion import getGlobalList [as 別名]
 def test_index_list(self):
     reg = EclRegion(self.grid, False)
     reg.select_islice(0, 5)
     active_list = reg.getActiveList()
     global_list = reg.getGlobalList()
開發者ID:Ensembles,項目名稱:ert,代碼行數:7,代碼來源:test_region_statoil.py


注:本文中的ert.ecl.EclRegion.getGlobalList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。