mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use commit 0e1e780fd6f18ce93119061e36a4fca9711bc020 Excluded multibuild folder, as this caused git issues
32 lines
786 B
Python
32 lines
786 B
Python
#!/usr/bin/env python
|
|
import sys
|
|
from ecl.grid import EclGrid, EclRegion
|
|
|
|
|
|
def volume_min_max(grid):
|
|
vols = [c.volume for c in grid if c.active]
|
|
return min(vols), max(vols)
|
|
|
|
def main(grid):
|
|
vmin,vmax = volume_min_max(grid)
|
|
|
|
dz_limit = 0.3
|
|
region = EclRegion(grid, False)
|
|
region.select_thin(dz_limit)
|
|
|
|
print "Smallest cell : %g" % vmin
|
|
print "Largest cell : %g" % vmax
|
|
print "Thin active cells : %d" % region.active_size()
|
|
|
|
for ai in region.get_active_list():
|
|
c = grid.cell(active_index=ai)
|
|
print('dz(%2d, %2d, %2d) = %.3f' % (c.i, c.j, c.k, c.dz))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) < 2:
|
|
exit('usage: grid_info.py path/to/file.EGRID')
|
|
case = sys.argv[1]
|
|
grid = EclGrid(case)
|
|
main(grid)
|