2019-05-20 13:21:02 +02:00
|
|
|
import sys
|
|
|
|
|
import os
|
|
|
|
|
sys.path.insert(1, os.path.join(sys.path[0], '../api'))
|
|
|
|
|
import ResInsight
|
|
|
|
|
|
|
|
|
|
resInsight = ResInsight.Instance.find()
|
|
|
|
|
#gridCount = resInsight.gridInfo.getGridCount(caseId=0)
|
|
|
|
|
#gridDimensions = resInsight.gridInfo.getAllGridDimensions(caseId=0)
|
|
|
|
|
|
2019-05-22 16:03:03 +02:00
|
|
|
cellCounts = resInsight.gridInfo.cellCount(caseId=0)
|
|
|
|
|
print("Number of active cells: " + str(cellCounts.active_cell_count))
|
|
|
|
|
|
2019-05-22 15:30:09 +02:00
|
|
|
activeCellInfoChunks = resInsight.gridInfo.cellInfoForActiveCells(caseId=0)
|
2019-05-20 13:21:02 +02:00
|
|
|
|
|
|
|
|
#print("Number of grids: " + str(gridCount))
|
|
|
|
|
#print(gridDimensions)
|
|
|
|
|
|
|
|
|
|
receivedActiveCells = []
|
|
|
|
|
for activeCellChunk in activeCellInfoChunks:
|
|
|
|
|
for activeCell in activeCellChunk.data:
|
|
|
|
|
receivedActiveCells.append(activeCell)
|
2019-05-22 16:03:03 +02:00
|
|
|
|
|
|
|
|
assert(cellCounts.active_cell_count == len(receivedActiveCells))
|
2019-05-20 13:21:02 +02:00
|
|
|
print("First active cell: ")
|
|
|
|
|
print(receivedActiveCells[0])
|