def test_bulkvol_speed(): """Test cell bulk volume calculation speed.""" dimens = (100, 500, 50) grd = Grid() grd.create_box(dimension=dimens) grd._xtgformat2() t0 = xtg.timer() _ = grd.get_bulk_volume() ncells = np.prod(dimens) print(xtg.timer(t0), ncells)
def test_from_to_grdeclgrid_write(tmp_path, grdecl_grid): xtggrid = Grid() grdecl_grid.to_file(tmp_path / "xtggrid.grdecl") xtggrid = Grid(tmp_path / "xtggrid.grdecl", fformat="grdecl") xtggrid._xtgformat2() if grdecl_grid.actnum is None: assert np.all(xtggrid._actnumsv) else: assert grdecl_grid.xtgeo_actnum().tolist() == xtggrid._actnumsv.tolist( ) assert grdecl_grid.xtgeo_coord() == pytest.approx(xtggrid._coordsv, abs=0.02) assert grdecl_grid.xtgeo_zcorn() == pytest.approx(xtggrid._zcornsv, abs=0.02)