当前位置: 首页>>代码示例>>Python>>正文


Python EclGridGenerator.create_grid方法代码示例

本文整理汇总了Python中ecl.grid.EclGridGenerator.create_grid方法的典型用法代码示例。如果您正苦于以下问题:Python EclGridGenerator.create_grid方法的具体用法?Python EclGridGenerator.create_grid怎么用?Python EclGridGenerator.create_grid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ecl.grid.EclGridGenerator的用法示例。


在下文中一共展示了EclGridGenerator.create_grid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createContainmentTestBase

# 需要导入模块: from ecl.grid import EclGridGenerator [as 别名]
# 或者: from ecl.grid.EclGridGenerator import create_grid [as 别名]
def createContainmentTestBase():
    return [
            (3,  GridGen.create_grid((6,6,6), (1,1,1), offset=1)),
            (10, GridGen.create_grid((3,3,3), (1,1,1), offset=1, concave=True)),
            (4,  GridGen.create_grid((10,10,1), (1,1,1), offset=0., misalign=True)),
            (3,
                GridGen.create_grid((6,6,6), (1,1,1), offset=0.,
                    escape_origo_shift=(100, 100, 0),
                    irregular_offset=True, concave=True, irregular=True,
                    scale=1.5, translation=(5,5,0),
                    misalign=True
                    )
                )
            ]
开发者ID:,项目名称:,代码行数:16,代码来源:

示例2: test_subgrid_translation

# 需要导入模块: from ecl.grid import EclGridGenerator [as 别名]
# 或者: from ecl.grid.EclGridGenerator import create_grid [as 别名]
    def test_subgrid_translation(self):
        grid = GridGen.create_grid((4,4,4), (1,1,1), offset=0.5,
                    irregular=True, irregular_offset=True, concave=True,
                    translation=(10,10,0))

        # Create grid with MAPAXES
        mapaxes = EclKW("MAPAXES", 6, EclDataType.ECL_FLOAT)
        for i, val in enumerate([1200, 1400, 2500, 2500, 3700, 4000]):
            mapaxes[i] = val

        grid = EclGrid.create(
                grid.getDims(),
                grid.export_zcorn(),
                grid.export_coord(),
                None,
                mapaxes=mapaxes
                )

        for translation in [
                (0,0,0),
                (10, 10, 100),
                (-1, -1, -1)
                ]:
            subgrid = GridGen.extract_subgrid(
                                        grid,
                                        ((0,3), (0,3), (0,3)),
                                        translation=translation
                                        )

            self.assertEqual(grid.getDims(), subgrid.getDims())

            translation = numpy.array(translation)
            for gindex in range(grid.getGlobalSize()):
                grid_corners = [
                                grid.getCellCorner(i, global_index=gindex)
                                for i in range(8)
                              ]

                subgrid_corners = [
                                subgrid.getCellCorner(i, global_index=gindex)
                                for i in range(8)
                                ]

                subgrid_corners = [
                                list(numpy.array(corner) - translation)
                                for corner in subgrid_corners
                                ]

                for gc, sc in zip(grid_corners, subgrid_corners):
                    self.assertAlmostEqualList(
                            gc,
                            sc,
                            msg="Failed to translate corners correctly." +
                                "Expected %s, was %s." % (gc, sc),
                            tolerance=10e-10
                            )
开发者ID:OPM,项目名称:ResInsight,代码行数:58,代码来源:test_grid_generator.py

示例3: setUp

# 需要导入模块: from ecl.grid import EclGridGenerator [as 别名]
# 或者: from ecl.grid.EclGridGenerator import create_grid [as 别名]
 def setUp(self):
     self.test_base = [
         (
             list(GridGen.create_coord((4,4,4), (1,1,1))),
             list(GridGen.create_zcorn((4,4,4), (1,1,1), offset=0)),
             GridGen.create_grid((4,4,4), (1,1,1), offset=0)
         ),
         (
             list(
                 GridGen.create_coord((5,5,5), (1,1,1),
                 translation=(10,10,0))
                 ),
             list(
                 GridGen.create_zcorn((5,5,5), (1,1,1), offset=0.5,
                 irregular_offset=True, concave=True, irregular=True)
                 ),
             GridGen.create_grid(
                 (5,5,5), (1,1,1), offset=0.5,
                 irregular=True, irregular_offset=True, concave=True,
                 translation=(10,10,0)
                 )
         )
         ]
开发者ID:OPM,项目名称:ResInsight,代码行数:25,代码来源:test_grid_generator.py

示例4: createVolumeTestGridBase

# 需要导入模块: from ecl.grid import EclGridGenerator [as 别名]
# 或者: from ecl.grid.EclGridGenerator import create_grid [as 别名]
def createVolumeTestGridBase(dim, dV, offset=1):
    return [
            GridGen.create_grid(dim, dV, offset=0),
            GridGen.create_grid(dim, dV, offset=offset),
            GridGen.create_grid(dim, dV, offset=offset, irregular_offset=True),
            GridGen.create_grid(dim, dV, offset=offset, concave=True),
            GridGen.create_grid(dim, dV, offset=offset, irregular=True),
            GridGen.create_grid(dim, dV, offset=offset, concave=True, irregular=True),
            GridGen.create_grid(dim, dV, offset=offset, irregular_offset=True, concave=True),
            GridGen.create_grid(dim, dV, offset=0, faults=True),
            GridGen.create_grid(dim, dV, offset=offset, faults=True),
            GridGen.create_grid(dim, dV, escape_origo_shift=(100, 100, 0), scale=2),
            GridGen.create_grid(dim, dV, escape_origo_shift=(100, 100, 0), scale=0.5),
            GridGen.create_grid(dim, dV, escape_origo_shift=(100, 100, 0), translation=(50,50,0)),
            GridGen.create_grid(dim, dV, escape_origo_shift=(100, 100, 0), rotate=True),
            GridGen.create_grid(dim, dV, escape_origo_shift=(100, 100, 0), misalign=True),
            GridGen.create_grid(dim, dV, offset=offset, escape_origo_shift=(100, 100, 0),
                irregular_offset=True, concave=True, irregular=True,
                scale=1.5, translation=(5,5,0), rotate=True,
                misalign=True)
            ]
开发者ID:,项目名称:,代码行数:23,代码来源:


注:本文中的ecl.grid.EclGridGenerator.create_grid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。