Files
ResInsight/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/CaseInfoStreamingExample.py
Gaute Lindkvist 824ec5cef6 Python: Rename example directory to PythonExamples
* This is so that when we add the folder to the Script Path it will look more sensible to the user.
2019-08-19 08:46:09 +02:00

23 lines
590 B
Python

import rips
resInsight = rips.Instance.find()
case = resInsight.project.case(id = 0)
cellCounts = case.cellCount()
print("Number of active cells: " + str(cellCounts.active_cell_count))
activeCellInfoChunks = case.cellInfoForActiveCells()
#print("Number of grids: " + str(gridCount))
#print(gridDimensions)
receivedActiveCells = []
for activeCellChunk in activeCellInfoChunks:
for activeCell in activeCellChunk.data:
receivedActiveCells.append(activeCell)
assert(cellCounts.active_cell_count == len(receivedActiveCells))
print("First active cell: ")
print(receivedActiveCells[0])