示例#1
0
    def test_grdecl_load(self):
        with self.assertRaises(IOError):
            grid = EclGrid.loadFromGrdecl("/file/does/not/exists")

        with TestAreaContext("python/grid-test/grdeclLoad"):
            with open("grid.grdecl","w") as f:
                f.write("Hei ...")
                
            with self.assertRaises(ValueError):
                grid = EclGrid.loadFromGrdecl("grid.grdecl")
        
            actnum = IntVector(default_value = 1 , initial_size = 1000)
            actnum[0] = 0
            g1 = EclGrid.createRectangular((10,10,10) , (1,1,1) , actnum = actnum )
            self.assertEqual( g1.getNumActive() , actnum.elementSum() )
            g1.save_EGRID("G.EGRID")

            with openEclFile("G.EGRID") as f:
                with open("grid.grdecl" , "w") as f2:
                    f2.write("SPECGRID\n")
                    f2.write("  10  10  10  \'F\' /\n")

                    coord_kw = f["COORD"][0]
                    coord_kw.write_grdecl( f2 )
                    
                    zcorn_kw = f["ZCORN"][0]
                    zcorn_kw.write_grdecl( f2 )
                
                    actnum_kw = f["ACTNUM"][0]
                    actnum_kw.write_grdecl( f2 )
            
            g2 = EclGrid.loadFromGrdecl("grid.grdecl")
            self.assertTrue( g1.equal( g2 ))
示例#2
0
def main(fname):
    grid = EclGrid.loadFromGrdecl(fname)
    fig = pylab.figure()
    ax = Axes3D(fig)

    xs, ys, zs = find_surface(grid, 0, 20)  # global idx, n, scale
    ax.plot_trisurf(xs, ys, zs)
    pyplot.show()
示例#3
0
 def test_large_case(self):
     grdecl_file = self.createTestPath(
         "Statoil/ECLIPSE/1.6.0_issueGrdecl/test_aug2016_gridOnly.grdecl")
     grid = EclGrid.loadFromGrdecl(grdecl_file)
示例#4
0
 def test_large_case(self):
     grdecl_file = self.createTestPath("Statoil/ECLIPSE/1.6.0_issueGrdecl/test_aug2016_gridOnly.grdecl")
     grid = EclGrid.loadFromGrdecl( grdecl_file )