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_bulkvol(): """Test cell bulk volume calculation.""" grd = Grid(GRIDQC1) cellvol_rms = GridProperty(GRIDQC1_CELLVOL) bulk = grd.get_bulk_volume() logger.info("Sum this: %s", bulk.values.sum()) logger.info("Sum RMS: %s", cellvol_rms.values.sum()) assert bulk.values.sum() == pytest.approx(cellvol_rms.values.sum(), rel=0.001)